Skip to content

Commit

Permalink
Merge pull request #410 from pvmm/pedro/main
Browse files Browse the repository at this point in the history
Adding space key to ansi sequences allows binding
  • Loading branch information
willmcgugan authored Jun 21, 2022
2 parents 94944f7 + 4743927 commit e406458
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/textual/_ansi_sequences.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# Mapping of vt100 escape codes to Keys.
ANSI_SEQUENCES: Dict[str, Tuple[Keys, ...]] = {
# Control keys.
" ": (Keys.Space,),
"\r": (Keys.Enter,),
"\x00": (Keys.ControlAt,), # Control-At (Also for Ctrl-Space)
"\x01": (Keys.ControlA,), # Control-A (home)
Expand Down
1 change: 1 addition & 0 deletions src/textual/keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ class Keys(str, Enum):
# Some 'Key' aliases (for backwardshift+compatibility).
ControlSpace = "ctrl-at"
Tab = "tab"
Space = "space"
Enter = "enter"
Backspace = "backspace"

Expand Down

0 comments on commit e406458

Please sign in to comment.