diff options
author | 2012-05-16 19:23:20 +0200 | |
---|---|---|
committer | 2012-05-16 19:23:20 +0200 | |
commit | 5c0cf619bc0a4392e93129b5b957bbbc8bbae526 (patch) | |
tree | e6319d6c69285c3730510fef395da55df409725c /plugins | |
parent | 6f7335be726b8079ca5f26f7175240256f016535 (diff) |
gtkui: ignore numlock state when assigning hotkeys
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/gtkui/prefwin.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/plugins/gtkui/prefwin.c b/plugins/gtkui/prefwin.c index 6f447792..ddf9e395 100644 --- a/plugins/gtkui/prefwin.c +++ b/plugins/gtkui/prefwin.c @@ -197,6 +197,37 @@ on_hk_binding_edited (GtkCellRendererAccel *accel, gchar *path, guint accel_key, strcat (new_value, "Alt "); } + // translate numlock keycodes into non-numlock codes + switch (accel_key) { + case GDK_KP_0: + accel_key = GDK_KP_Insert; + break; + case GDK_KP_1: + accel_key = GDK_KP_End; + break; + case GDK_KP_2: + accel_key = GDK_KP_Down; + break; + case GDK_KP_3: + accel_key = GDK_KP_Page_Down; + break; + case GDK_KP_4: + accel_key = GDK_KP_Left; + break; + case GDK_KP_6: + accel_key = GDK_KP_Right; + break; + case GDK_KP_7: + accel_key = GDK_KP_Home; + break; + case GDK_KP_8: + accel_key = GDK_KP_Up; + break; + case GDK_KP_9: + accel_key = GDK_KP_Page_Up; + break; + } + // find key name from hotkeys plugin DB_plugin_t *hotkeys = deadbeef->plug_get_for_id ("hotkeys"); if (hotkeys) { |