From 74b0a7f6f8f8f688c19b69ca79247c7a7eae03cf Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 18 Jun 2021 09:41:35 +0530 Subject: [PATCH] Make it clearer that there are separate keyboard mode stacks for main and alternate screens --- docs/keyboard-protocol.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/keyboard-protocol.rst b/docs/keyboard-protocol.rst index 4aa241c51..003fb2a45 100644 --- a/docs/keyboard-protocol.rst +++ b/docs/keyboard-protocol.rst @@ -41,12 +41,14 @@ If you are an application or library developer just interested in using this protocol to make keyboard handling simpler and more robust in your application, without too many changes, do the following: -#. Emit the escape code ``CSI > 1 u`` at application startup or when entering - alternate screen mode +#. Emit the escape code ``CSI > 1 u`` at application startup if using the main + screen or when entering alternate screen mode, if using the alternate + screen. #. All key events will now be sent in only a few forms to your application, that are easy to parse unambiguously. -#. Emit the escape sequence ``CSI < u`` at application exit or just before - leaving alternate screen mode to restore the previously used keyboard mode. +#. Emit the escape sequence ``CSI < u`` at application exit if using the main + screen or just before leaving alternate screen mode if using the alternate screen, + to restore the previously used keyboard mode. Key events will all be delivered to your application either as plain UTF-8 text, or using the following escape codes, for those keys that do not produce