72 Commits

Author SHA1 Message Date
Kovid Goyal
1dc3dfe58f
Distinguish shifted Pgup and PgDn keys in normal and application mode
Fixes #791
2018-08-05 17:17:15 +05:30
Kovid Goyal
c8fc21d336
Linux: Allow using XKB key names to bind shortcuts to keys not supported by GLFW
Useful to bind keys such as the play/pause or volume buttons. Also can
be used to bind non-ascii keys on international keyboards. Fixes #665
2018-06-22 12:41:50 +05:30
Kovid Goyal
7332561d8e
Add in the redundant ctrl+<234578`> key combinations in normal and application mode. They all conflict with other keys but by implementing them the same as other terminals, I can at least avoid having to explain how they Ctrl+number is broken in traditional terminals over and over again. 2018-05-28 20:37:48 +05:30
Kovid Goyal
fe65b346c1
Fix Ctrl+Alt+Space not working in normal and application keyboard modes.
Fixes #562
2018-05-22 14:52:00 +05:30
Kovid Goyal
7c47bd547f
Fix ctrl+alt+<special> not working in normal and application keyboard modes.
Fixes #548
2018-05-17 20:43:18 +05:30
Kovid Goyal
7ec989d485
Fix Ctrl+backspace acting as plain backspace in normal and application keyboard modes. Fixes #538 2018-05-16 00:07:54 +05:30
Kovid Goyal
2e693c31df
Refactor shortcut config parsing
Resolution of kitty_mod and creation of the maps now happens in one
central place after all config is parsed. Fixes #496

Also have --debug-config output multi-key shortcuts nicely as well.
2018-04-27 11:16:58 +05:30
Kovid Goyal
fe5b8f3aec
Fix using modifiers with subsequent keys in a muti-key shortcut not working 2018-04-24 09:42:37 +05:30
Kovid Goyal
fda57a81e1
Fix Shift+function key not working
Also support pressing F13-f25 function keys. Fixes #485
2018-04-23 11:28:02 +05:30
Kovid Goyal
530fd61125
Add support for multi-key shortcuts
Fixes #338
2018-03-31 12:21:37 +05:30
Kovid Goyal
527255e3a1
Fix compilation with gcc 8
Apparently some nitwit Linux distros have made an unreleased compiler
their default compiler. Fixes #376

Fixes various new warnings that GCC 8 issues
2018-03-12 10:38:12 +05:30
Kovid Goyal
740a89b77f
Treat Ctrl+Alt+letter as Esc,Ctrl+letter
Follows the behavior of some other terminals and is better than
generating nothing, since apparently there are some terminal programs
that use these keys. Fixes #345
2018-02-27 08:46:09 +05:30
Kovid Goyal
1fc605cbc0
Move needs_special_handling definition into keys.c 2018-02-22 14:37:51 +05:30
Kovid Goyal
1e4963e727
Revert change to make alt+bs emit werase
Most linux terminals emit ESC+BS instead. And iTerm2 in Esc+ mode also
emits this. So go with the majority for greatest ecosystem
compatibility. Fixes #264
2018-02-22 13:51:14 +05:30
Kovid Goyal
f9141120aa
A few fixes for the extended key protocol 2018-02-08 12:57:16 +05:30
Kovid Goyal
872d39eb2c
Have the ctrl+shift+<key> generate the ASCII C0 control codes for the few shifted control codes there are.
See #285
2018-01-14 11:18:30 +05:30
Kovid Goyal
3523ab283f
More trailing whitespace 2018-01-06 09:12:23 +05:30
Kovid Goyal
5b2a9b101d
Fix trailing whitespace 2018-01-05 21:27:24 +05:30
Kovid Goyal
fdcfcfa1b9
Make alt+backspace delete the previous word
i.e. alt+backspace now sends ^W (werase). THis matches the behavior of
terminal.app and gnome-terminal. Fixes #264
2018-01-05 21:08:42 +05:30
Kovid Goyal
c95418a947
Remove unused code 2017-12-05 20:21:13 +05:30
Kovid Goyal
c17c6cae4c
Support S8C1T mode
That is, eight bit control codes. When in S8C1T mode, kitty will send
only eight bit control codes to the client.
2017-12-05 20:21:12 +05:30
Kovid Goyal
e86c2f2000
Fix shift+up/down not generating correct escape codes
Fixes #186
2017-11-26 17:34:34 +05:30
Kovid Goyal
4dc6918b13
Get rid of the send_text_map code
Just transform send_text directives in the config file to map
directives.
2017-11-19 08:56:34 +05:30
Kovid Goyal
1f9acf99b0
Match extended keyboard protocol modifier bitmask with the CSIu protocol from xterm 2017-11-08 08:24:15 +05:30
Kovid Goyal
204b6fa3e8
Use nested switch statements for key lookup
Replace giant key look up table with nested switch statements.
A little slower, but reduces memory consumption and makes it easier to
add new keyboard modes in the future, if needed. Key lookup was not a
performance bottleneck, in any case.
2017-11-07 20:58:34 +05:30
Kovid Goyal
f137ea7094
Fix handling of alt (option) key on macOS
It now works just as in linux. i.e. alt+a sends <esc>a to the client.
No longer needs turning off alt to generate unicode at the OS level.
2017-11-07 16:19:37 +05:30
Kovid Goyal
34084e7ab5
Neaten up keys.h 2017-09-16 09:16:30 +05:30
Kovid Goyal
c5e989bc94
Move the key handler to C 2017-09-15 21:46:00 +05:30
Kovid Goyal
a4d71bcf5c
Move the text input callback to C 2017-09-15 18:33:45 +05:30
Kovid Goyal
b2c7272af1
Store key combos that need special handling in a table for fast lookup 2017-09-15 18:06:26 +05:30
Kovid Goyal
44c897a61a
Translate key presses to bytes using a lookup table 2017-09-15 10:45:27 +05:30
Kovid Goyal
b5af266b87
A spot of refactoring 2017-09-15 10:45:27 +05:30
Kovid Goyal
2de0c82f18
Fix incorrect full keyboard mode escape codes 2017-09-15 10:44:56 +05:30
Kovid Goyal
dd3af45043
Implement a send_text action to allow using keyboard shortcuts to send arbitrary text
Fixes #94
2017-07-23 14:37:15 +05:30
Kovid Goyal
3d5c65eaea
Fix #89 2017-06-21 10:19:45 +05:30
Kovid Goyal
ad21c7ed0f
Mimic behavior of xterm when pressing Ctrl+<key>
Where <key> is one of ,.;'-=

These dont map to control codes, xterm and libvte just ignore the Ctrl
and echo the key as if control was not pressed. Mimic that behavior
2017-05-22 21:09:20 +05:30
Kovid Goyal
38d2839206
Fix Ctrl+6 and Ctrl+/ not working
Fixes #79
2017-05-22 21:01:14 +05:30
Kovid Goyal
24d0bb8bd5
Allow IME to generate unicode characters using Alt+key which is used on OSX, I think 2017-05-20 12:01:50 +05:30
Kovid Goyal
08f336769f
Add tests for key mapping
Also fix Alt+Special keys no generating correct codes
2017-05-20 11:41:21 +05:30
Kovid Goyal
5525d4db49
Fix alt+key resulting in the upper case version of key even when shift is not pressed
Fixes #78
2017-05-20 08:47:02 +05:30
Kovid Goyal
defda41861 Use rmkx codes as basis for control+special key codes 2017-03-15 16:27:17 +05:30
Kovid Goyal
66c51798b8 Fix a regression that broke Ctrl+Left and Ctrl+Down
Fixes #56
2017-03-15 16:16:27 +05:30
Kovid Goyal
7d8e172ce2 Keyboard maps should be respected in extended keyboard mode as well 2017-02-12 14:27:03 +05:30
Kovid Goyal
72125701f5 No need ot build the key map on every startup 2017-02-11 10:48:36 +05:30
Kovid Goyal
a66d2b0890 Ensure the extended keyboard protocol key encoding is stable
Also use base85 instead of base64 for keyname encoding to reduce average
length
2017-02-11 10:41:04 +05:30
Kovid Goyal
211b771316 pep8 2017-02-11 10:02:48 +05:30
Kovid Goyal
d9563e52c8 Reduce size of encoded key event by using base64 encoding 2017-02-10 15:34:06 +05:30
Kovid Goyal
0f8b83755a Implement the extended keyboard protocol 2017-02-10 15:11:07 +05:30
Kovid Goyal
48a2a395c4 Spec for extended keyboard protocol 2017-02-10 11:34:38 +05:30
Kovid Goyal
142c883b0c Implement DECCKM 2017-02-05 15:30:16 +05:30