Skip to content

Commit

Permalink
gst-play: Handle KeyDown event instead of KeyUp on Win32 keyboard han…
Browse files Browse the repository at this point in the history
…dler

To handle long press case, KeyDown input should be handled instead of KeyUp.
Note that OS will take care of the sensitivity of KeyDown event, so we can safely
assume one KeyDown as one input. That will not break user experience.
  • Loading branch information
seungha-yang committed Nov 19, 2019
1 parent 60d5803 commit fd83086
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/gst-play-kb.c
Expand Up @@ -155,7 +155,7 @@ gst_play_kb_source_cb (Win32KeyHandler * handler)
if (PeekConsoleInput (h_input, &buffer, 1, &n) && n == 1) {
ReadConsoleInput (h_input, &buffer, 1, &n);

if (buffer.EventType == KEY_EVENT && !buffer.Event.KeyEvent.bKeyDown) {
if (buffer.EventType == KEY_EVENT && buffer.Event.KeyEvent.bKeyDown) {
gchar key_val[2] = { 0 };

switch (buffer.Event.KeyEvent.wVirtualKeyCode) {
Expand Down

0 comments on commit fd83086

Please sign in to comment.