Move get_mod_mask to libi3, use it in i3 and i3-config-wizard

Also, the API changed a bit. There are two functions now, both assume you
already got the keysyms (which is the case for i3 and i3-config-wizard),
one gets the modifier mapping for you (aio_get_mod_mask_for) while the other
assumes you also got that. No roundtrips are required for the latter.
This commit is contained in:
Michael Stapelberg
2011-10-23 21:26:15 +01:00
parent a512b99a51
commit 91134f75c0
9 changed files with 109 additions and 130 deletions

View File

@ -178,7 +178,7 @@ static void xkb_got_event(EV_P_ struct ev_io *w, int revents) {
xcb_key_symbols_free(keysyms);
keysyms = xcb_key_symbols_alloc(conn);
xcb_get_numlock_mask(conn);
xcb_numlock_mask = aio_get_mod_mask_for(XCB_NUM_LOCK, keysyms);
ungrab_all_keys(conn);
DLOG("Re-grabbing...\n");
@ -520,7 +520,7 @@ int main(int argc, char *argv[]) {
keysyms = xcb_key_symbols_alloc(conn);
xcb_get_numlock_mask(conn);
xcb_numlock_mask = aio_get_mod_mask_for(XCB_NUM_LOCK, keysyms);
translate_keysyms();
grab_all_keys(conn, false);