Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for ctrl+Fn keys under rxvt #3737

Merged
merged 8 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Widgets can now have an ALLOW_CHILDREN (bool) classvar to disallow adding children to a widget https://github.com/Textualize/textual/pull/3758
- Added the ability to set the `label` property of a `Checkbox` https://github.com/Textualize/textual/pull/3765
- Added the ability to set the `label` property of a `RadioButton` https://github.com/Textualize/textual/pull/3765
- Added support for Ctrl+Fn and Ctrl+Shift+Fn keys in urxvt https://github.com/Textualize/textual/pull/3737
- Added support for various modified edit and navigation keys in urxvt https://github.com/Textualize/textual/pull/3739
davep marked this conversation as resolved.
Show resolved Hide resolved

### Changed

Expand Down
24 changes: 24 additions & 0 deletions src/textual/_ansi_sequences.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,30 @@
"\x1b[21;6~": (Keys.ControlF22,),
"\x1b[23;6~": (Keys.ControlF23,),
"\x1b[24;6~": (Keys.ControlF24,),
# rxvt-unicode control function keys:
"\x1b[11^": (Keys.ControlF1,),
"\x1b[12^": (Keys.ControlF2,),
"\x1b[13^": (Keys.ControlF3,),
"\x1b[14^": (Keys.ControlF4,),
"\x1b[15^": (Keys.ControlF5,),
"\x1b[17^": (Keys.ControlF6,),
"\x1b[18^": (Keys.ControlF7,),
"\x1b[19^": (Keys.ControlF8,),
"\x1b[20^": (Keys.ControlF9,),
"\x1b[21^": (Keys.ControlF10,),
"\x1b[23^": (Keys.ControlF11,),
"\x1b[24^": (Keys.ControlF12,),
# rxvt-unicode control+shift function keys:
"\x1b[25^": (Keys.ControlF13,),
"\x1b[26^": (Keys.ControlF14,),
"\x1b[28^": (Keys.ControlF15,),
"\x1b[29^": (Keys.ControlF16,),
"\x1b[31^": (Keys.ControlF17,),
"\x1b[32^": (Keys.ControlF18,),
"\x1b[33^": (Keys.ControlF19,),
"\x1b[34^": (Keys.ControlF20,),
"\x1b[23@": (Keys.ControlF21,),
"\x1b[24@": (Keys.ControlF22,),
# --
# Tmux (Win32 subsystem) sends the following scroll events.
"\x1b[62~": (Keys.ScrollUp,),
Expand Down
Loading