From 01be13d7c65a83598214d42422329500c7395f08 Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Thu, 30 Mar 2023 11:27:50 +0100 Subject: [PATCH] Add a FAQ about some keys not making it to Textual apps --- FAQ.md | 17 ++++++++++++++ ...ome-keys-not-make-it-to-my-app.question.md | 22 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 questions/why-do-some-keys-not-make-it-to-my-app.question.md diff --git a/FAQ.md b/FAQ.md index 54600ee36..1c48f2fed 100644 --- a/FAQ.md +++ b/FAQ.md @@ -7,6 +7,7 @@ - [How can I select and copy text in a Textual app?](#how-can-i-select-and-copy-text-in-a-textual-app) - [How do I center a widget in a screen?](#how-do-i-center-a-widget-in-a-screen) - [How do I pass arguments to an app?](#how-do-i-pass-arguments-to-an-app) +- [Why do some key combinations never make it to my app?](#why-do-some-key-combinations-never-make-it-to-my-app) - [Why doesn't Textual look good on macOS?](#why-doesn't-textual-look-good-on-macos) - [Why doesn't Textual support ANSI themes?](#why-doesn't-textual-support-ansi-themes) @@ -173,6 +174,22 @@ Greetings(to_greet="davep").run() Greetings("Well hello", "there").run() ``` + +## Why do some key combinations never make it to my app? + +Textual can only ever support key combinations that are passed on by your +terminal application. Which keys get passed on can differ from terminal to +terminal, and from operating system to operating system. + +When [creating bindings for your +application](https://textual.textualize.io/guide/input/#bindings) we +recommend picking keys and key combinations that are supported on as many +platforms as possible. + +The easiest way to test different environments to see which +[keys](https://textual.textualize.io/guide/input/#keyboard-input) can be +detected is to use `textual keys`. + ## Why doesn't Textual look good on macOS? diff --git a/questions/why-do-some-keys-not-make-it-to-my-app.question.md b/questions/why-do-some-keys-not-make-it-to-my-app.question.md new file mode 100644 index 000000000..b3f8a0b97 --- /dev/null +++ b/questions/why-do-some-keys-not-make-it-to-my-app.question.md @@ -0,0 +1,22 @@ +--- +title: "Why do some key combinations never make it to my app?" +alt_titles: + - "Cmd key isn't working" + - "Command key isn't working" + - "Alt key isn't working" + - "Ctrl and function key isn't working" + - "Control and function key isn't working" +--- + +Textual can only ever support key combinations that are passed on by your +terminal application. Which keys get passed on can differ from terminal to +terminal, and from operating system to operating system. + +When [creating bindings for your +application](https://textual.textualize.io/guide/input/#bindings) we +recommend picking keys and key combinations that are supported on as many +platforms as possible. + +The easiest way to test different environments to see which +[keys](https://textual.textualize.io/guide/input/#keyboard-input) can be +detected is to use `textual keys`.