-
Notifications
You must be signed in to change notification settings - Fork 123
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
API equivalent for 'xmodmap -pm' #91
Comments
There is no API which exposes such a thing directly. What you can do is use an imperative approach. Create a scratch If you need more pointers, or if it doesn't work for the use case, let us know. |
@bluetech That is a really roundabout way to get information that should be available directly. It would be really nice if there is a function for this. |
And, some of the keycodes, e.g. |
I guess it would be easier to consider if someone who needs this proposes an API that would have been useful for them (implementation not needed, just an API proposal). |
Since /**
* Get the keycodes associated with a modifier by index.
* @param[in] keymap The keymap
* @param[in] idx The index of the modifier
* @param[out] codes_out A buffer in which the codes should be stored
* @param[out] codes_size The size of the codes_out buffer
*
* @returns the number of key codes in the keysyms_out array.
*/
size_t xkb_keymap_mod_get_codes(struct xkb_keymap *keymap,
xkb_mod_index_t idx,
xkb_keycode_t *codes_out,
size_t codes_size); Although it might be nice (if a bit dangerous) to allow |
I added a feature similar to About your use case: do you need to know in advance the keys affecting the modifiers, or could it be simplier to just watch the keyboard state and update the key accordingly when you detect a modifier change? |
Hello,
I'm writing a 'touchscreen' keyboard (dockable, sticky etc.) for X11 (for a Linux-based tablet); the key sending method is based on
/dev/uinput
, so that the X keyboard settings will be taken into account as if the events come from a "real" keyboard device. I'm trying to find out what keys, when pressed, affect the modifiers of the keyboard, so that I can make those keys 1) remain depressed and 2) release automatically after another (non-modifier) key is pressed. Basically, I think, to find out the same infoxmodmap -pm
offers from the CLI. I may be daft, but I don't see a way to find out this information with xkbcommon API. Any idea? Thanks!The text was updated successfully, but these errors were encountered: