Merge pull request #547 from llyzs/x11
x11: release all pressed keys when window is unmapped.
This commit is contained in:
commit
fcf07f780e
@ -559,6 +559,8 @@ boolean xf_event_UnmapNotify(xfInfo* xfi, XEvent* event, boolean app)
|
||||
rdpWindow* window;
|
||||
rdpRail* rail = ((rdpContext*) xfi->context)->rail;
|
||||
|
||||
xf_kbd_release_all_keypress(xfi);
|
||||
|
||||
if (app != true)
|
||||
return true;
|
||||
|
||||
|
@ -50,6 +50,22 @@ void xf_kbd_unset_keypress(xfInfo* xfi, uint8 keycode)
|
||||
return;
|
||||
}
|
||||
|
||||
void xf_kbd_release_all_keypress(xfInfo* xfi)
|
||||
{
|
||||
int keycode;
|
||||
RDP_SCANCODE rdp_scancode;
|
||||
|
||||
for (keycode = 0; keycode < ARRAY_SIZE(xfi->pressed_keys); keycode++)
|
||||
{
|
||||
if (xfi->pressed_keys[keycode] != NoSymbol)
|
||||
{
|
||||
rdp_scancode = freerdp_keyboard_get_rdp_scancode_from_x11_keycode(keycode);
|
||||
freerdp_input_send_keyboard_event_2(xfi->instance->input, false, rdp_scancode);
|
||||
xfi->pressed_keys[keycode] = NoSymbol;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
boolean xf_kbd_key_pressed(xfInfo* xfi, KeySym keysym)
|
||||
{
|
||||
KeyCode keycode = XKeysymToKeycode(xfi->display, keysym);
|
||||
|
@ -27,6 +27,7 @@
|
||||
void xf_kbd_init(xfInfo* xfi);
|
||||
void xf_kbd_set_keypress(xfInfo* xfi, uint8 keycode, KeySym keysym);
|
||||
void xf_kbd_unset_keypress(xfInfo* xfi, uint8 keycode);
|
||||
void xf_kbd_release_all_keypress(xfInfo* xfi);
|
||||
boolean xf_kbd_key_pressed(xfInfo* xfi, KeySym keysym);
|
||||
void xf_kbd_send_key(xfInfo* xfi, boolean down, uint8 keycode);
|
||||
int xf_kbd_read_keyboard_state(xfInfo* xfi);
|
||||
|
Loading…
Reference in New Issue
Block a user