# HG changeset patch
# User Mads Kiilerich <[email protected]>
# Date 1300825830 -3600
# Node ID fd1efc5dd64f8fdcffb0c2e956d7931fb4c15505
# Parent 99e25d86a3bba5cc2f39232652bea81b9db04cf3
xfreerdp: proof of concept of alternative keymapping
This seems to work for me, at least on linux with evdev.
When and why will this fail to work?
(I could ask a lot of stupid questions to the existing way of doing it or try
to argue why this should work and might be preferable, but asking the other way
might get us straight to the interesting points.)
diff --git a/X11/xf_keyboard.c b/X11/xf_keyboard.c
--- a/X11/xf_keyboard.c
+++ b/X11/xf_keyboard.c
@@ -45,13 +45,25 @@
xfi->inst->settings->keyboard_layout = xf_kb_keyboard_layout;
};
+static unsigned char keycode_scancodes[] = {
+ 0, 0, 0, 0, 0, 0, 0, 28,
+ 29, 53, 55, 56, 0, 71, 72, 73,
+ 75, 77, 79, 80, 81, 82, 83, 0,
+ 0, 0, 0, 0, 0, 0, 69, 0,
+ 0, 0, 0, 0, 91, 92, 93,
+ };
+
void
xf_kb_send_key(xfInfo * xfi, int flags, uint8 keycode)
{
int scancode, rdpflags;
- rdpflags = flags;
- scancode = freerdp_kbd_get_scancode_by_keycode(keycode, &rdpflags);
+ rdpflags = (flags & KBD_FLAG_UP ? RDP_KEYRELEASE : RDP_KEYPRESS) |
+ ((keycode >= 97) ? KBD_FLAG_EXT : 0);
+ scancode = (keycode < 8) ? 0 :
+ (keycode < 97) ? keycode - 8 :
+ (keycode < 97 + sizeof(keycode_scancodes)) ?
keycode_scancodes[keycode - 97] :
+ 0;
if (scancode == 0)
{
printf("xf_kb_send_key: unknown key flags=0x%04X keycode=%d (X
keysym=0x%04X)\n",
------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software
be a part of the solution? Download the Intel(R) Manageability Checker
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Freerdp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freerdp-devel