Skip to content

Commit

Permalink
Merge pull request #3737 from davep/rxvt-keys
Browse files Browse the repository at this point in the history
Add support for ctrl+Fn keys under rxvt
  • Loading branch information
davep authored Nov 29, 2023
2 parents 382bf10 + 13124b6 commit b55b2db
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased

### Added

- Added support for Ctrl+Fn and Ctrl+Shift+Fn keys in urxvt https://github.com/Textualize/textual/pull/3737

## [0.43.2] - 2023-11-29

### Fixed
Expand Down Expand Up @@ -32,6 +38,7 @@ 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 various modified edit and navigation keys in urxvt https://github.com/Textualize/textual/pull/3739
- Added app focus/blur for textual-web https://github.com/Textualize/textual/pull/3767

### 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

0 comments on commit b55b2db

Please sign in to comment.