From aee54eca79e3f62d04b2390bb2020555d065c53c Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Thu, 23 Nov 2023 12:34:49 +0000 Subject: [PATCH 1/3] Add support for ctrl+Fn keys under rxvt See #3735 (and by extension #3440). --- src/textual/_ansi_sequences.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/textual/_ansi_sequences.py b/src/textual/_ansi_sequences.py index ac8b94f2ee..4e5f2d3fcb 100644 --- a/src/textual/_ansi_sequences.py +++ b/src/textual/_ansi_sequences.py @@ -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,), From 51047f0b00589b64ef889067355c50a299248e21 Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Thu, 23 Nov 2023 13:01:13 +0000 Subject: [PATCH 2/3] Update the CHANGELOG --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index af17082efd..e134a45fcf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ 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.42.0] - 2023-11-22 ### Fixed From a5650f73c4d5d9465cecb9b7b79aa3c9e7517619 Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Thu, 23 Nov 2023 15:58:56 +0000 Subject: [PATCH 3/3] Add missing CHANGELOG entry for related PR --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e134a45fcf..82b7b51cf1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Added - 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 ## [0.42.0] - 2023-11-22