-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to read used keysyms/keycodes for each modifier_map #480
Comments
Duplicate of #91. TL;DR: There is no such API. Could you explain you use case? |
I develop a driver for Asus laptops with hardware support for NumberPad. NumberPad is an illuminated numeric keypad integrated to the touchpad which appears when is done tap on the top right corner of the touchpad. In this branch of driver I try to add support for rebinding modifiers as well as other keys for wayland. For Xlib I will solve it with code as I posted in issue probably because atm does not exist bindings for this lib for python supporting x11. Atm I have in the mentioned WIP branch static table below which I would like to change to be filled dynamically (Shift might have someone spared to some other keys than are
A concrete example is when the user wants using this driver via NumberPad send |
@wismill What do you think? Should I try to implement the workaround solution mentioned in #91? About the proposed modification mentioned in #91 something like that does what I need. By index in keymap find all keycodes and return them thought pointer and as return value return the length of the keycodes array. |
The NumberPad is a very interesting feature! As for your use case: there is not such API yet so yeah you would need to implement a workaround. Keep in mind that the corresponding keys depends on the active layout. |
I wrote the code that returns for code
output
When I find for I use wrapper. |
I do not know this library but the following might help:
|
Thank you. With 2 mentioned changes I get now for output
|
I do not know how I can read keysyms or keycodes for each
modifier_map
below. Do I understand well used keysym are substitutable? ModifierShift
means can be pressed left or right Shift. I only care about first keysym in case previous statement is true. I know that funckeymap.get_as_string()
below returns at the end of output what I need but I would like to avoid usingregexp
and have another table translatingLFSH
->Shift_L
,RTSH
->Shift_R
for which then I could easily find keycode using funcxkb.keysym_from_name
and iterating over all keycodes inside keymap and comparing keysym for first level but I would prefer something similar toXlib
example below and I have not found an equivalent func insideKeyboardState
:Output of
keymap.get_as_string()
:Using
Xlib
I can do something like:Could help me anyone with a better understanding, please.
The text was updated successfully, but these errors were encountered: