Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix evdev keycode problems #3113

Merged
merged 2 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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