From 2db125bc43d838baada476970bf86becb398c5f7 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Fri, 9 Jun 2006 08:06:14 +0000 Subject: [PATCH] Fixed the Fl::event_original_key() function for X11. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5189 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_x.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx index 0e4dd4a56..d7c909e32 100644 --- a/src/Fl_x.cxx +++ b/src/Fl_x.cxx @@ -834,8 +834,6 @@ int fl_handle(const XEvent& thisevent) else if (keysym == FL_BackSpace) got_backspace = 1; } # endif - // Store this so we can later know if the KP was used - Fl::e_original_keysym = keysym; // We have to get rid of the XK_KP_function keys, because they are // not produced on Windoze and thus case statements tend not to check // for them. There are 15 of these in the range 0xff91 ... 0xff9f @@ -843,6 +841,8 @@ int fl_handle(const XEvent& thisevent) // Map keypad keysym to character or keysym depending on // numlock state... unsigned long keysym1 = XKeycodeToKeysym(fl_display, keycode, 1); + if (keysym1 <= 0x7f || (keysym1 > 0xff9f && keysym1 <= FL_KP_Last)) + Fl::e_original_keysym = (int)(keysym1 | FL_KP); if ((xevent.xkey.state & Mod2Mask) && (keysym1 <= 0x7f || (keysym1 > 0xff9f && keysym1 <= FL_KP_Last))) { // Store ASCII numeric keypad value... @@ -858,6 +858,9 @@ int fl_handle(const XEvent& thisevent) 0xff0b/*XK_Clear*/, FL_Insert, FL_Delete}; keysym = table[keysym-0xff91]; } + } else { + // Store this so we can later know if the KP was used + Fl::e_original_keysym = (int)keysym; } Fl::e_keysym = int(keysym); set_event_xy();