-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: state: add API for updating latched and locked mods & layout in…
… server state Up to now, the “server state” `xkb_state`` API only offered one entry point to update the server state - `xkb_state_update_key`, which reflects the direct keyboard keys state. But some updates come out-of-band from keyboard input events stream, for example, a GUI layout switcher. The X11 XKB protocol has a request which allows for such updates, `XkbLatchLockState`[^1], but xkbcommon does not have similar functionality. So server applications ended up using `xkb_state_update_state` for this, but that’s a function intended for client applications, not servers. Add support for updating the latched & locked state of the mods and layout. Note that the depressed states cannot be updated in this way -- XKB does not expect them to be updated out of band. [1]: https://www.x.org/releases/X11R7.7/doc/kbproto/xkbproto.html#Querying_and_Changing_Keyboard_State Fixes: #310 Signed-off-by: Ran Benita <[email protected]> Co-authored-by: Ran Benita <[email protected]> Co-authored-by: Pierre Le Marre <[email protected]>
- Loading branch information
Showing
7 changed files
with
504 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#ifndef STATE_H | ||
#define STATE_H | ||
|
||
#include "xkbcommon/xkbcommon.h" | ||
#include "keymap.h" | ||
|
||
void | ||
xkb_state_set_components( | ||
struct xkb_state *state, | ||
int32_t base_group, | ||
int32_t latched_group, | ||
int32_t locked_group, | ||
xkb_layout_index_t group, | ||
xkb_mod_mask_t base_mods, | ||
xkb_mod_mask_t latched_mods, | ||
xkb_mod_mask_t locked_mods, | ||
xkb_mod_mask_t mods, | ||
xkb_led_mask_t leds); | ||
|
||
#endif |
Oops, something went wrong.