Skip to content

Draft: symbols: add pointerkeys:numlock for numlock-based pointer keys

Peter Hutterer requested to merge whot/xkeyboard-config:wip/pointerkeys into master

Our keymap by default defines the various keypad keys (KP_7, ...) to be pointer actions, e.g.:

     interpret KP_7 {
          action = MovePtr(x=-1,y=-1);
      };

These are always defined in every keymap, see compat/mousekeys.

The Pointer_EnableKeys symbols is included via keypad:pointerkeys but its implementation is specific to the X server: if toggled on, the actions are handled as such, if toggled off, the X server replaces the key action during processing with NoAction, causing the normal symbol to be forwarded instead. This gives us access to both levels on the keypad (with/without numlock) and a third toggled layer fort the pointer keys.

Alas, libxkbcommon does not support PointerKeys through actions, so our current keypad:pointerkeys does not work.[1] mutter implements this with hardcoded symbols instead of relying on XKB.

We do have keysyms for the various pointer actions, so we can define our numlock to move the pointer without needing custom action handling. This replaces the symbol on that level so it's not as powerful but it can be implemented in compositors.

A new symbol group "pointerkeys" was picked so we can extend this group in the future.

[1] https://github.com/xkbcommon/libxkbcommon/issues/438


Draft because I'm not sure how much we want this, it's more a PoC. We'd need at least a few compositors to implement support for the various XKB_KEY_Pointer_Button1 first before this would make sense.

cc @svu, @wismill

Merge request reports