Revision: 4556 http://geany.svn.sourceforge.net/geany/?rev=4556&view=rev Author: eht16 Date: 2010-01-25 21:15:17 +0000 (Mon, 25 Jan 2010)
Log Message: ----------- Backport from trunk: Fix non-working Home and End keys on numpads.
Modified Paths: -------------- branches/geany-0.18.1/ChangeLog branches/geany-0.18.1/src/keybindings.c
Modified: branches/geany-0.18.1/ChangeLog =================================================================== --- branches/geany-0.18.1/ChangeLog 2010-01-25 20:38:17 UTC (rev 4555) +++ branches/geany-0.18.1/ChangeLog 2010-01-25 21:15:17 UTC (rev 4556) @@ -1,3 +1,9 @@ +2009-08-18 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de> + + * src/keybindings.c: + Fix non-working Home and End keys on numpads. + + 2009-08-17 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
* doc/geany.txt:
Modified: branches/geany-0.18.1/src/keybindings.c =================================================================== --- branches/geany-0.18.1/src/keybindings.c 2010-01-25 20:38:17 UTC (rev 4555) +++ branches/geany-0.18.1/src/keybindings.c 2010-01-25 21:15:17 UTC (rev 4556) @@ -1077,6 +1077,37 @@ #endif
+/* Map the keypad keys to their equivalent functions (taken from ScintillaGTK.cxx) */ +static guint key_kp_translate(guint key_in) +{ + switch (key_in) + { + case GDK_KP_Down: + return GDK_Down; + case GDK_KP_Up: + return GDK_Up; + case GDK_KP_Left: + return GDK_Left; + case GDK_KP_Right: + return GDK_Right; + case GDK_KP_Home: + return GDK_Home; + case GDK_KP_End: + return GDK_End; + case GDK_KP_Page_Up: + return GDK_Page_Up; + case GDK_KP_Page_Down: + return GDK_Page_Down; + case GDK_KP_Delete: + return GDK_Delete; + case GDK_KP_Insert: + return GDK_Insert; + default: + return key_in; + } +} + + /* central keypress event handler, almost all keypress events go to this function */ static gboolean on_key_press_event(GtkWidget *widget, GdkEventKey *ev, gpointer user_data) { @@ -1101,6 +1132,9 @@ if (keyval >= GDK_A && keyval <= GDK_Z) keyval += GDK_a - GDK_A;
+ if (keyval >= GDK_KP_Space && keyval < GDK_KP_Equal) + keyval = key_kp_translate(keyval); + /*geany_debug("%d (%d) %d (%d)", keyval, ev->keyval, state, ev->state);*/
/* special cases */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.