From 381e546e0917fe029645bd7bf6f77c789960e299 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Thu, 10 Mar 2011 11:56:17 +0000 Subject: Fix up numpad keys. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4356 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- vncviewer/DesktopWindow.cxx | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/vncviewer/DesktopWindow.cxx b/vncviewer/DesktopWindow.cxx index eca19836..0188f724 100644 --- a/vncviewer/DesktopWindow.cxx +++ b/vncviewer/DesktopWindow.cxx @@ -284,6 +284,10 @@ rdr::U32 DesktopWindow::translateKeyEvent(int keyCode, const char *keyText) if ((keyCode >= FL_F) && (keyCode <= FL_F_Last)) return XK_F1 + (keyCode - FL_F); + // Numpad numbers + if ((keyCode >= (FL_KP + '0')) && (keyCode <= (FL_KP + '9'))) + return XK_KP_0 + (keyCode - (FL_KP + '0')); + // Then other special keys switch (keyCode) { case FL_BackSpace: @@ -344,6 +348,22 @@ rdr::U32 DesktopWindow::translateKeyEvent(int keyCode, const char *keyText) return XK_Alt_R; case FL_Delete: return XK_Delete; + case FL_KP_Enter: + return XK_KP_Enter; + case FL_KP + '=': + return XK_KP_Equal; + case FL_KP + '*': + return XK_KP_Multiply; + case FL_KP + '+': + return XK_KP_Add; + case FL_KP + ',': + return XK_KP_Separator; + case FL_KP + '-': + return XK_KP_Subtract; + case FL_KP + '.': + return XK_KP_Decimal; + case FL_KP + '/': + return XK_KP_Divide; } // Unknown special key? -- cgit v1.2.3