emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Physical keyboard events


From: Cecilio Pardo
Subject: Re: Physical keyboard events
Date: Mon, 4 Nov 2024 00:44:17 +0100
User-agent: Mozilla Thunderbird

Hello,

This is my proposal as a draft patch.  It allows to detect double (or
triple) tap on shift, control, alt keys (left or right), and bind
commands to those.  Also can add Hyper modifier to next key.

- The change in emacs core (keyboard.c) is to define a new event
  'physical-key.  That event is bound to 'ignore on special-event-map,
  so will not interfere with anything, unless rebound.
- Then, particular term implementations add these events when
  needed.  The patch includes that for X, PGTK and ms-windows. Only
  rshift, lshift, lctrl, etc. generate events.  We could add a
  variable to completely disable this if required.
- Finally, the function physkey-init in physkey.el rebinds the event
  to physkey-handle.  Bindings for n-tap of the keys can be added with
  physkey-bind.  One can bind functions, commands, or the 'hyper symbol
  to add hyper modifier to the next key.

I made a bad choice by using the word 'physical'.  This is using key
identification provided by the OS input system, so no scan codes or
raw data.

I also think it is unobstrusive to those who don't want this.

And some related use cases that may be interesting, or not.

- Cycling over something with a key like C-tab, and only really
  selecting when releasing C, like the window cycling with Alt+Tab,
  which cycles trough thumbnails until your release Alt, and lets you
  cancel by pressing Esc.
- Better support for key-chords,
  https://github.com/emacsorphanage/key-chord
- MacOS style holding key to get accented version of character.
- Stenography input with standard keyboards.
- Feature request: Add support for key release event
  https://debbugs.gnu.org/cgi/bugreport.cgi?bug=22163

Attachment: 0001-Add-events-for-key-press-and-key-release-on-gui-syst.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]