summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2011-03-10 11:56:17 +0000
committerPierre Ossman <ossman@cendio.se>2011-03-10 11:56:17 +0000
commit381e546e0917fe029645bd7bf6f77c789960e299 (patch)
tree3606939c7e85abdb4bab19fc06dea45c8025c050
parent98486c1fc34005bcd7221057a72bb1a6ed226be3 (diff)
downloadtigervnc-381e546e0917fe029645bd7bf6f77c789960e299.tar.gz
tigervnc-381e546e0917fe029645bd7bf6f77c789960e299.zip
Fix up numpad keys.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4356 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r--vncviewer/DesktopWindow.cxx20
1 files changed, 20 insertions, 0 deletions
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?