Commit Graph

13 Commits

Author SHA1 Message Date
Michael Davis
bca71adad7
Implement "report alternate keys" from the Kitty Keyboard Protocol (#754)
The "report alternate keys" part of the Kitty keyboard protocol will
send an additional codepoint containing the "shifted" version of a
key based on the keyboard layout. This is useful for downstream
applications which set up keybindings based on symbols instead of
exact keys being pressed.

For example, underscore (_) with the Alt modifier is sent as minus (-)
with Alt and Shift modifiers. A terminal will send the underscore
codepoint as an alternate though, and we can use that information and
the presence of the Shift modifier to resolve the symbol. Other
examples are 'A-(' (sent as 'A-S-9') and 'A-)' (sent as 'A-S-0').

This change allows pushing the "report alternate keys" flag and
overwrites the keycode and modifiers for any shifted keys sent by the
terminal.
2023-02-11 10:40:11 +01:00
Michael Davis
3fe13e18d8
Add a function for checking keyboard enhancement support (#732)
* Add a function for checking keyboard enhancement support

This follows the Kitty documentation's recommended way to check for
progressive keyboard enhancement: query the flags and then query the
primary device attributes (which is broadly supported). If we receive
only the device attributes, the protocol is not supported.

* Check keyboard enhancement in the event-read example
2023-01-10 19:23:34 +01:00
Leon
bf9f78994a
Fix minor warnings and typos (#726) 2022-12-04 12:41:24 +01:00
Timon
5d02ed8c37
0.25 (#702) 2022-08-10 22:01:18 +02:00
Charlie Groves
1fee5ff30c
Add bracketed paste parsing (#693) 2022-08-10 09:16:56 +02:00
Jesse Weaver
2a612e0f24
Add extra modifiers/state from kitty keyboard protocol (#696) 2022-08-10 09:09:14 +02:00
Charlie Groves
069497b43b
Emit focus events (#689) 2022-07-28 12:07:01 +02:00
Koxiaet
6c0f8ebcf6
Fix clippy warnings (#533) 2021-01-02 15:24:34 +01:00
Timon
e46decc2f3
Fix wrong resize size return (#526) 2020-12-28 10:15:50 +01:00
Koxiaet
5be7d18475
Replace AnsiType with write_ansi (#523) 2020-12-28 07:56:32 +01:00
Timon
47e8366f2b
Moved examples back into crossterm (#332) 2019-12-10 21:07:15 +01:00
Timon
b4241e0107
Refactored Screen Module (#336) 2019-12-04 17:40:11 +01:00
Timon
f597cfd232
Input module Rewrite (#284) 2019-11-18 21:50:57 +01:00