-#define SPI_DEC_MAX_SHIFT_KEYSYMS 15
-static long _shift_keysyms[SPI_DEC_MAX_SHIFT_KEYSYMS] =
- {XK_Shift_L, XK_Shift_R,
- XK_Control_L, XK_Control_R,
- XK_Caps_Lock, XK_Shift_Lock,
- XK_Alt_L, XK_Alt_R,
- XK_Meta_L, XK_Meta_R,
- XK_Super_L, XK_Super_R,
- XK_Hyper_L, XK_Hyper_R,
- 0};
-
-static gboolean
-spi_keycodes_contain (KeyCode keycodes[], KeyCode keycode)
-{
- int i = 0;
-
- if (keycode)
- {
- while (i < SPI_DEC_MAX_SHIFT_KEYSYMS)
- {
- if (keycodes[i] == keycode)
- return TRUE;
- ++i;
- }
- }
- return FALSE;
-}
-
-static void
-spi_dec_init_keycode_list (SpiDEController *controller)
-{
- DEControllerPrivateData *priv =
- g_object_get_qdata (G_OBJECT (controller), spi_dec_private_quark);
- KeyCode keycode;
- int i;
- priv->shift_keycodes = g_malloc (sizeof (KeyCode) *
- SPI_DEC_MAX_SHIFT_KEYSYMS);
- for (i = 0; _shift_keysyms[i] != 0; ++i)
- {
- keycode = keycode_for_keysym (_shift_keysyms [i]);
- priv->shift_keycodes [i] = keycode;
- }
- priv->shift_keycodes [i] = 0; /* terminate the list */
-}
-