From: Michael Stapelberg Date: Sun, 23 Oct 2011 18:37:28 +0000 (+0100) Subject: i3-input: Remove unused get_mod_mask from xcb.c X-Git-Tag: 4.1~59 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c2d04116d46da02152d655a1fe6d8924540d0575;p=i3%2Fi3 i3-input: Remove unused get_mod_mask from xcb.c --- diff --git a/i3-input/i3-input.h b/i3-input/i3-input.h index 3cdcbb78..981e5067 100644 --- a/i3-input/i3-input.h +++ b/i3-input/i3-input.h @@ -16,7 +16,6 @@ extern xcb_window_t root; char *convert_ucs_to_utf8(char *input); char *convert_utf8_to_ucs2(char *input, int *real_strlen); -uint32_t get_mod_mask(xcb_connection_t *conn, uint32_t keycode); xcb_window_t open_input_window(xcb_connection_t *conn, uint32_t width, uint32_t height); int get_font_id(xcb_connection_t *conn, char *pattern, int *font_height); diff --git a/i3-input/xcb.c b/i3-input/xcb.c index ae2dcd1b..ca0a7e76 100644 --- a/i3-input/xcb.c +++ b/i3-input/xcb.c @@ -20,39 +20,6 @@ #include "i3-input.h" -/* - * Returns the mask for Mode_switch (to be used for looking up keysymbols by - * keycode). - * - */ -uint32_t get_mod_mask(xcb_connection_t *conn, uint32_t keycode) { - xcb_key_symbols_t *symbols = xcb_key_symbols_alloc(conn); - - xcb_get_modifier_mapping_reply_t *modmap_r; - xcb_keycode_t *modmap, kc; - xcb_keycode_t *modeswitchcodes = xcb_key_symbols_get_keycode(symbols, keycode); - if (modeswitchcodes == NULL) - return 0; - - modmap_r = xcb_get_modifier_mapping_reply(conn, xcb_get_modifier_mapping(conn), NULL); - modmap = xcb_get_modifier_mapping_keycodes(modmap_r); - - for (int i = 0; i < 8; i++) - for (int j = 0; j < modmap_r->keycodes_per_modifier; j++) { - kc = modmap[i * modmap_r->keycodes_per_modifier + j]; - for (xcb_keycode_t *ktest = modeswitchcodes; *ktest; ktest++) { - if (*ktest != kc) - continue; - - free(modeswitchcodes); - free(modmap_r); - return (1 << i); - } - } - - return 0; -} - /* * Opens the window we use for input/output and maps it *