Skip to content

Commit

Permalink
Merge pull request #3113 from matt335672/fix_evdev_keycode_problems
Browse files Browse the repository at this point in the history
Fix evdev keycode problems
  • Loading branch information
matt335672 committed Jun 14, 2024
2 parents a5a7ccc + 620f3b6 commit 8ee4a6c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions common/ms-rdpbcgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@
/* TODO: to be renamed */
#define KBD_FLAG_RIGHT 0x0001
#define KBD_FLAG_EXT 0x0100 /* KBDFLAGS_EXTENDED */
#define KBD_FLAG_EXT1 0x0200 /* KBDFLAGS_EXTENDED1 */
#define KBD_FLAG_QUIET 0x1000
#define KBD_FLAG_DOWN 0x4000
#define KBD_FLAG_UP 0x8000
Expand Down
5 changes: 5 additions & 0 deletions libxrdp/xrdp_fastpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ xrdp_fastpath_process_EVENT_SCANCODE(struct xrdp_fastpath *self,
flags |= KBD_FLAG_EXT;
}

if ((eventFlags & FASTPATH_INPUT_KBDFLAGS_EXTENDED1))
{
flags |= KBD_FLAG_EXT1;
}

xrdp_fastpath_session_callback(self, RDP_INPUT_SCANCODE,
code, 0, flags, 0);

Expand Down
10 changes: 9 additions & 1 deletion xup/xup.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,15 @@ lib_mod_event(struct mod *mod, int msg, tbus param1, tbus param2,
/* xup doesn't need the Unicode character mapping in param1. Send
* the X11 scancode instead, so xorgxrdp doesn't have to do this
* work again */
param1 = scancode_to_keycode(param3);
if ((param4 & KBD_FLAG_EXT) != 0)
{
// Extended key - set bit 9 of the scancode for the lookup
param1 = scancode_to_keycode(param3 | 0x100);
}
else
{
param1 = scancode_to_keycode(param3);
}
}

init_stream(s, 8192);
Expand Down

0 comments on commit 8ee4a6c

Please sign in to comment.