Add support for raw keyboard in vncviewer
Make sure it can map between the key codes of the local system
in to the key codes used by the protocol.
diff --git a/vncviewer/menukey.cxx b/vncviewer/menukey.cxx
index 04e52d0..25f9f56 100644
--- a/vncviewer/menukey.cxx
+++ b/vncviewer/menukey.cxx
@@ -30,26 +30,26 @@
#include "parameters.h"
static const MenuKeySymbol menuSymbols[] = {
- {"F1", FL_F + 1, XK_F1},
- {"F2", FL_F + 2, XK_F2},
- {"F3", FL_F + 3, XK_F3},
- {"F4", FL_F + 4, XK_F4},
- {"F5", FL_F + 5, XK_F5},
- {"F6", FL_F + 6, XK_F6},
- {"F7", FL_F + 7, XK_F7},
- {"F8", FL_F + 8, XK_F8},
- {"F9", FL_F + 9, XK_F9},
- {"F10", FL_F + 10, XK_F10},
- {"F11", FL_F + 11, XK_F11},
- {"F12", FL_F + 12, XK_F12},
- {"Pause", FL_Pause, XK_Pause},
- {"Scroll_Lock", FL_Scroll_Lock, XK_Scroll_Lock},
- {"Escape", FL_Escape, XK_Escape},
- {"Insert", FL_Insert, XK_Insert},
- {"Delete", FL_Delete, XK_Delete},
- {"Home", FL_Home, XK_Home},
- {"Page_Up", FL_Page_Up, XK_Page_Up},
- {"Page_Down", FL_Page_Down, XK_Page_Down},
+ {"F1", FL_F + 1, 0x3b, XK_F1},
+ {"F2", FL_F + 2, 0x3c, XK_F2},
+ {"F3", FL_F + 3, 0x3d, XK_F3},
+ {"F4", FL_F + 4, 0x3e, XK_F4},
+ {"F5", FL_F + 5, 0x3f, XK_F5},
+ {"F6", FL_F + 6, 0x40, XK_F6},
+ {"F7", FL_F + 7, 0x41, XK_F7},
+ {"F8", FL_F + 8, 0x42, XK_F8},
+ {"F9", FL_F + 9, 0x43, XK_F9},
+ {"F10", FL_F + 10, 0x44, XK_F10},
+ {"F11", FL_F + 11, 0x57, XK_F11},
+ {"F12", FL_F + 12, 0x58, XK_F12},
+ {"Pause", FL_Pause, 0xc6, XK_Pause},
+ {"Scroll_Lock", FL_Scroll_Lock, 0x46, XK_Scroll_Lock},
+ {"Escape", FL_Escape, 0x01, XK_Escape},
+ {"Insert", FL_Insert, 0xd2, XK_Insert},
+ {"Delete", FL_Delete, 0xd3, XK_Delete},
+ {"Home", FL_Home, 0xc7, XK_Home},
+ {"Page_Up", FL_Page_Up, 0xc9, XK_Page_Up},
+ {"Page_Down", FL_Page_Down, 0xd1, XK_Page_Down},
};
int getMenuKeySymbolCount()
@@ -62,19 +62,21 @@
return menuSymbols;
}
-void getMenuKey(int *keycode, rdr::U32 *keysym)
+void getMenuKey(int *fltkcode, int *keycode, rdr::U32 *keysym)
{
const char *menuKeyStr;
menuKeyStr = menuKey;
for(int i = 0; i < getMenuKeySymbolCount(); i++) {
if (!strcmp(menuSymbols[i].name, menuKeyStr)) {
+ *fltkcode = menuSymbols[i].fltkcode;
*keycode = menuSymbols[i].keycode;
*keysym = menuSymbols[i].keysym;
return;
}
}
+ *fltkcode = 0;
*keycode = 0;
*keysym = 0;
}