Skip to content

Commit

Permalink
Ignore key up events in teleop_turtle_key on Windows (#118)
Browse files Browse the repository at this point in the history
Signed-off-by: Michel Hidalgo <[email protected]>
  • Loading branch information
hidmic committed Apr 16, 2021
1 parent 83a3325 commit be98147
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions turtlesim/tutorials/teleop_turtle_key.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ class KeyboardReader
if(events > 0)
{
ReadConsoleInput(handle, &buffer, 1, &events);
if (!buffer.Event.KeyEvent.bKeyDown)
{
continue;
}
if (buffer.Event.KeyEvent.wVirtualKeyCode == VK_LEFT)
{
*c = KEYCODE_LEFT;
Expand Down

0 comments on commit be98147

Please sign in to comment.