From 9d21a4f359490c808abae44a05f0f33f22cf102a Mon Sep 17 00:00:00 2001 From: Gokcehan Date: Wed, 6 Jun 2018 21:39:44 +0300 Subject: [PATCH] add key mappings to the doc --- doc.go | 47 +++++++++++++++++++++++++++++++++++++++++++++++ docstring.go | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+) diff --git a/doc.go b/doc.go index 845c854..463bdef 100644 --- a/doc.go +++ b/doc.go @@ -229,6 +229,53 @@ prefix. set info time }} +Key Mappings + +Regular keys are assigned to a command with the usual syntax: + + map a down + +Keys combined with the shift key simply use the uppercase letter: + + map A down + +Special keys are written in between '<' and '>' characters and always use +lowercase letters: + + map down + +Angle brackets can be assigned with their special names: + + map down + map down + +Function keys are prefixed with 'f' character: + + map down + +Keys combined with the control key are prefixed with 'c' character: + + map down + +Keys combined with the alt key are assigned in two different ways depending on +the behavior of your terminal. Older terminals (e.g. xterm) may set the 8th bit +of a character when the alt key is pressed. On these terminals, you can use the +corresponding byte for the mapping: + + map á down + +Newer terminals (e.g. gnome-terminal) may prefix the key with an escape key +when the alt key is pressed: lf uses the escape delaying mechanism to recognize +alt keys in these terminals (delay is 100ms). On these terminals, keys combined +with the alt key are prefixed with 'a' character: + + map down + +Please note that, some key combinations are not possible due to the way +terminals work (e.g. control and h combination sends a backspace key). The +easiest way to find the name of a key combination is to press the key while lf +is running and read the name of the key from the unknown mapping error. + Push Mappings The usual way to map a key sequence is to assign it to a named or unnamed diff --git a/docstring.go b/docstring.go index 246597d..5613be0 100644 --- a/docstring.go +++ b/docstring.go @@ -238,6 +238,54 @@ proper prefix. }} +Key Mappings + +Regular keys are assigned to a command with the usual syntax: + + map a down + +Keys combined with the shift key simply use the uppercase letter: + + map A down + +Special keys are written in between '<' and '>' characters and always use +lowercase letters: + + map down + +Angle brackets can be assigned with their special names: + + map down + map down + +Function keys are prefixed with 'f' character: + + map down + +Keys combined with the control key are prefixed with 'c' character: + + map down + +Keys combined with the alt key are assigned in two different ways depending +on the behavior of your terminal. Older terminals (e.g. xterm) may set the +8th bit of a character when the alt key is pressed. On these terminals, you +can use the corresponding byte for the mapping: + + map á down + +Newer terminals (e.g. gnome-terminal) may prefix the key with an escape key +when the alt key is pressed: lf uses the escape delaying mechanism to +recognize alt keys in these terminals (delay is 100ms). On these terminals, +keys combined with the alt key are prefixed with 'a' character: + + map down + +Please note that, some key combinations are not possible due to the way +terminals work (e.g. control and h combination sends a backspace key). The +easiest way to find the name of a key combination is to press the key while +lf is running and read the name of the key from the unknown mapping error. + + Push Mappings The usual way to map a key sequence is to assign it to a named or unnamed