diff --git a/data/keyboard-layouts/README-KeyTab b/data/keyboard-layouts/README-KeyTab new file mode 100644 index 00000000..a9a737da --- /dev/null +++ b/data/keyboard-layouts/README-KeyTab @@ -0,0 +1,78 @@ +[README-KeyTab] + +The keytabs shown in the Edit Profile dialog -> Keyboard tab are taken from +*.keytab configuration files located in the system-wide location (typically +/usr/share/applications/konsole on Linux) or the writable location in the +user's home directory (typically ~/.local/share/applications/konsole on Linux). + +Keytabs allow users to configure the behavior of konsole on keyboard events, +especially functions keys. Have a look at doc/user/README.keyboard. + +The syntax of each entry/rule follows the pattern: + + "key" Keyname { ("+"|"-") Modename } ":" (String|Operation) + +Key names are those defined in with the "Qt::Key_" prefix +removed. For a list of key names check the Qt::Key enum at: +https://doc.qt.io/qt-5/qt.html#Key-enum + +Mode names are: + + - Shift : Shift Key pressed + - Alt : Alt Key pressed + - Control : Control Key pressed + + ( The VT100 emulation has modes that can affect the sequences emitted + by certain keys. Those modes are under control of the client program. + + - Newline : affects Return and Enter keys, when set makes them send + both \r and \n control characters; when reset makes them + send \r only. + + - Application : affects applications that use the Alternate Screen buffer. + + - Ansi : send ANSI escape and control sequences (v.s. sending VT52 + escape and control sequences). + + Since sending a state to a program that has set the state itself is + positivly wrong and obsolete design, better forget about this nasty + detail. I may well remove this "feature" in a future clean up round. ) + + A "+" preceding a Modename means the Key/mode is pressed/active respectively. + + A "-" preceding a Modename means the Key/mode isn't pressed/active respectively. + + If a mode isn't present in a key combination, its state is ignored. + + Note that the combination of Key and Modes (set/reset) has to be unique. + This means, that + + key A + Shift : "A" + key A : "a" + + will not accept the small letter "a" rule as you'd exepct, you'll have + to add a "- Shift" to the latter rule to make it work. + Use the stdout/stderr dianostics of konsole when modifying keytabs to + find problems like these. + +Supported operations are + +- scrollUpLine : scroll up one line in the history log +- scrollUpPage : scroll up one page in the history log +- scrollDownLine : scroll down one line in the history log +- scrollDownPage : scroll down one page in the history log +- scrollUpToTop : scroll up to the begining of the history log +- scrollDownToBottom : scroll down to the end of the history log + + +Strings have the syntax of C strings, +one may use the following escapes: + + - \E - Escape + - \\ - Backslash + - \" - Double quote + - \t - Tab + - \r - Carriage Return + - \n - New Line + - \b - Backspace + - \xHH - where HH are two hex digits (e.g. \x00 (the NUL character)) diff --git a/data/keyboard-layouts/README.KeyTab b/data/keyboard-layouts/README-KeyTab-original similarity index 100% rename from data/keyboard-layouts/README.KeyTab rename to data/keyboard-layouts/README-KeyTab-original diff --git a/data/keyboard-layouts/default.keytab b/data/keyboard-layouts/default.keytab index 56886d58..8c4120ed 100644 --- a/data/keyboard-layouts/default.keytab +++ b/data/keyboard-layouts/default.keytab @@ -1,183 +1,184 @@ # [README.default.Keytab] Default Keyboard Table # -# To customize your keyboard, copy this file to something -# ending with .keytab and change it to meet you needs. -# Please read the README.KeyTab and the README.keyboard +# To customize your keyboard, copy this file to something ending with +# .keytab and change it to meet you needs. +# +# Please read the README-KeyTab and the doc/user/README.keyboard files # in this case. # # -------------------------------------------------------------- keyboard "Default (XFree 4)" # -------------------------------------------------------------- # # Note that this particular table is a "risc" version made to # ease customization without bothering with obsolete details. # See VT100.keytab for the more hairy stuff. # # -------------------------------------------------------------- # common keys key Escape : "\E" key Tab -Shift : "\t" key Tab +Shift+Ansi : "\E[Z" key Tab +Shift-Ansi : "\t" key Backtab +Ansi : "\E[Z" key Backtab -Ansi : "\t" key Return-Shift-NewLine : "\r" key Return-Shift+NewLine : "\r\n" key Return+Shift : "\EOM" # Backspace and Delete codes are preserving CTRL-H. # Backspace without any modifiers sends '^?' key Backspace -AnyMod : "\x7f" # Match xterm behaviour: Backspace sends '^H' when Control is pressed # BS, hex \x08, \b key Backspace +Control : "\b" # Arrow keys in VT52 mode # shift up/down are reserved for scrolling. # shift left/right are reserved for switching between tabs (this is hardcoded). key Up -Shift-Ansi : "\EA" key Down -Shift-Ansi : "\EB" key Right-Shift-Ansi : "\EC" key Left -Shift-Ansi : "\ED" # Arrow keys in ANSI mode with Application - and Normal Cursor Mode) key Up -Shift-AnyMod+Ansi+AppCuKeys : "\EOA" key Down -Shift-AnyMod+Ansi+AppCuKeys : "\EOB" key Right -Shift-AnyMod+Ansi+AppCuKeys : "\EOC" key Left -Shift-AnyMod+Ansi+AppCuKeys : "\EOD" key Up -Shift-AnyMod+Ansi-AppCuKeys : "\E[A" key Down -Shift-AnyMod+Ansi-AppCuKeys : "\E[B" key Right -Shift-AnyMod+Ansi-AppCuKeys : "\E[C" key Left -Shift-AnyMod+Ansi-AppCuKeys : "\E[D" key Up -Shift+AnyMod+Ansi : "\E[1;*A" key Down -Shift+AnyMod+Ansi : "\E[1;*B" key Right -Shift+AnyMod+Ansi : "\E[1;*C" key Left -Shift+AnyMod+Ansi : "\E[1;*D" key Up +Shift+AppScreen : "\E[1;*A" key Down +Shift+AppScreen : "\E[1;*B" key Left +Shift+AppScreen : "\E[1;*D" key Right +Shift+AppScreen : "\E[1;*C" # Keypad keys with NumLock ON # (see "Numeric Keypad" section at http://www.nw.com/nw/WWW/products/wizcon/vt100.html ) # # Not enabled for now because it breaks the keypad in Vim. # #key 0 +KeyPad+AppKeyPad : "\EOp" #key 1 +KeyPad+AppKeyPad : "\EOq" #key 2 +KeyPad+AppKeyPad : "\EOr" #key 3 +KeyPad+AppKeyPad : "\EOs" #key 4 +KeyPad+AppKeyPad : "\EOt" #key 5 +KeyPad+AppKeyPad : "\EOu" #key 6 +KeyPad+AppKeyPad : "\EOv" #key 7 +KeyPad+AppKeyPad : "\EOw" #key 8 +KeyPad+AppKeyPad : "\EOx" #key 9 +KeyPad+AppKeyPad : "\EOy" #key + +KeyPad+AppKeyPad : "\EOl" #key - +KeyPad+AppKeyPad : "\EOm" #key . +KeyPad+AppKeyPad : "\EOn" #key * +KeyPad+AppKeyPad : "\EOM" #key Enter +KeyPad+AppKeyPad : "\r" # Keypad keys with NumLock Off key Up -Shift+Ansi+AppCuKeys+KeyPad : "\EOA" key Down -Shift+Ansi+AppCuKeys+KeyPad : "\EOB" key Right -Shift+Ansi+AppCuKeys+KeyPad : "\EOC" key Left -Shift+Ansi+AppCuKeys+KeyPad : "\EOD" key Up -Shift+Ansi-AppCuKeys+KeyPad : "\E[A" key Down -Shift+Ansi-AppCuKeys+KeyPad : "\E[B" key Right -Shift+Ansi-AppCuKeys+KeyPad : "\E[C" key Left -Shift+Ansi-AppCuKeys+KeyPad : "\E[D" key Home +AppCuKeys+KeyPad : "\EOH" key End +AppCuKeys+KeyPad : "\EOF" key Home -AppCuKeys+KeyPad : "\E[H" key End -AppCuKeys+KeyPad : "\E[F" key Insert +KeyPad : "\E[2~" key Delete +KeyPad : "\E[3~" key PgUp -Shift+KeyPad : "\E[5~" key PgDown -Shift+KeyPad : "\E[6~" # the key labelled 5 on the Keypad, is Qt::Key_Clear (a very intuitive # and discoverable name...) key Clear +KeyPad : "\E[E" # other grey PC keys key Enter+NewLine : "\r\n" key Enter-NewLine : "\r" key Home -AnyMod-AppCuKeys : "\E[H" key End -AnyMod-AppCuKeys : "\E[F" key Home -AnyMod+AppCuKeys : "\EOH" key End -AnyMod+AppCuKeys : "\EOF" key Home +AnyMod : "\E[1;*H" key End +AnyMod : "\E[1;*F" key Insert -AnyMod : "\E[2~" key Delete -AnyMod : "\E[3~" key Insert +AnyMod : "\E[2;*~" key Delete +AnyMod : "\E[3;*~" key PgUp -Shift-AnyMod : "\E[5~" key PgDown -Shift-AnyMod : "\E[6~" key PgUp -Shift+AnyMod : "\E[5;*~" key PgDown -Shift+AnyMod : "\E[6;*~" # Function keys key F1 -AnyMod : "\EOP" key F2 -AnyMod : "\EOQ" key F3 -AnyMod : "\EOR" key F4 -AnyMod : "\EOS" key F5 -AnyMod : "\E[15~" key F6 -AnyMod : "\E[17~" key F7 -AnyMod : "\E[18~" key F8 -AnyMod : "\E[19~" key F9 -AnyMod : "\E[20~" key F10 -AnyMod : "\E[21~" key F11 -AnyMod : "\E[23~" key F12 -AnyMod : "\E[24~" key F1 +AnyMod : "\EO*P" key F2 +AnyMod : "\EO*Q" key F3 +AnyMod : "\EO*R" key F4 +AnyMod : "\EO*S" key F5 +AnyMod : "\E[15;*~" key F6 +AnyMod : "\E[17;*~" key F7 +AnyMod : "\E[18;*~" key F8 +AnyMod : "\E[19;*~" key F9 +AnyMod : "\E[20;*~" key F10 +AnyMod : "\E[21;*~" key F11 +AnyMod : "\E[23;*~" key F12 +AnyMod : "\E[24;*~" # Work around dead keys key Space +Control : "\x00" # Some keys are used by konsole to cause operations. # The scroll* operations refer to the history buffer. key Up +Shift-AppScreen : scrollLineUp key PgUp +Shift-AppScreen : scrollPageUp key Home +Shift-AppScreen : scrollUpToTop key Down +Shift-AppScreen : scrollLineDown key PgDown +Shift-AppScreen : scrollPageDown key End +Shift-AppScreen : scrollDownToBottom diff --git a/doc/user/README.keyboard b/doc/user/README.keyboard index 09f0f018..2ce273a0 100644 --- a/doc/user/README.keyboard +++ b/doc/user/README.keyboard @@ -1,44 +1,44 @@ [README.keyboard] -The *.keytab files (located in $KDEDIR/share/apps/konsole) allow -to configure the keyboard due to your specific environment. +The *.keytab files (located in /usr/share/applications/konsole and +~/.local/share/applications/konsole) allow you to configure the keyboard +to suit your specific environment/requirements. -Beside that you can use them to make the keyboard emit virtually -any escape sequence you want, here a probe of more typical problems -related to keyboards, that can be coped with this way: +Beside that you can use them to make the keyboard emit virtually any +escape sequence you want, here are some notes about the more typical +problems related to keyboards, that can be coped with this way: - BS Hack - While one would expect, that the Backspace key send ASCII - Backspace, this is not the case in many Linux installations. + While one would expect, that the Backspace key send ASCII Backspace, + this is not the case in many Linux installations. The idea behind this hack is to preserve the CTRL-H. So the mapping is: CTRL-H -> 0x08 Backspace -> 0x7f Delete -> \E[3~ - Home/End Keys Home -> \E[1~ End -> \E[4~ or Home -> \E[H End -> \E[F Quite a lot of those key sequences are floating around. Consult your terminfo or termcap database for the expected values. Note that your system is not unlikely to have other keyboard databases which have to be in sync, too (e.g. /etc/inputrc for readline(3)). -If you want to adjust things to your needs, copy one of the -*.keytab files and edit it. When restarted, konsole offers -you this new entry on it's menu. +If you want to adjust things to your needs you can copy one of the *.keytab +files and edit it. The changes will take effect after restarting konsole. -In case your new keytab is likely to suit common needs, -please contribute to konsole by sending me the file. +In case your new keytab is likely to suit common needs, please contribute +to konsole by sending us the file.