Skip to content

Commit

Permalink
Filter out any NUL keystrokes that aren't Ctrl+2/Ctrl+space
Browse files Browse the repository at this point in the history
  • Loading branch information
davep committed Sep 11, 2023
1 parent 7ca5dd6 commit 0cdd369
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/textual/drivers/win32.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,13 @@ def run(self) -> None:
if (
key_event.dwControlKeyState
and key_event.wVirtualKeyCode == 0
) or (
# Filter out any NUL characters that don't
# appear to be Ctrl-2, AKA Ctrl-space.
#
# https://github.com/Textualize/textual/issues/872
key == "\x00"
and key_event.wVirtualKeyCode != 50
):
continue
append_key(key)
Expand Down

0 comments on commit 0cdd369

Please sign in to comment.