49 Commits

Author SHA1 Message Date
Kovid Goyal
d7ce3eb66e Keyboard events: Fix turning on only the "Report all keys as escape codes" enhancement not reporting modifier+enter/tab/backspace using escape codes 2025-01-12 19:11:19 +05:30
Kovid Goyal
dd249df5eb Dont encode enter, tab and backspace when lock mods are set
Otherwise user cant type reset when num lock is set.
2025-01-01 06:10:47 +05:30
Kovid Goyal
b2391553f9 Keyboard protocol: Fix the Enter Tab and Backspace keys generating spurious release events even when report all keys as escape codes is not set
Fixes #7136
2024-02-18 11:12:24 +05:30
Kovid Goyal
5a2ee2f9a3 macOS: Fix kitten @ select-window leaving the keyboard in a partially functional state
Fixes #7074
2024-01-27 12:53:58 +05:30
Kovid Goyal
4c46d2bc95 ... 2024-01-26 20:07:55 +05:30
Kovid Goyal
c95fc3689b A single multi-key mapping should not prematurely complete as that confuses people trying out the feature
See #7073
2024-01-26 20:04:33 +05:30
Kovid Goyal
8c50632a10 Fix a single key mapping not overriding a previously defined multi-key mapping 2024-01-26 18:02:25 +05:30
Kovid Goyal
ae1bf69a3d Fix date in changelog 2024-01-26 17:24:45 +05:30
Kovid Goyal
4dfbcb539f Add basic tests for modal mappings 2024-01-25 14:42:27 +05:30
Kovid Goyal
d6e55f72c0 Forgot to stub out one method for the test 2024-01-25 14:18:09 +05:30
Kovid Goyal
cd30de3727 Fix #7055 2024-01-25 14:06:52 +05:30
Kovid Goyal
cec427777c Add some tests for mappings 2024-01-25 13:56:42 +05:30
Kovid Goyal
77292a16d6 Make shebangs consistent
Follow PEP 0394 and use /usr/bin/env python so that the python in the
users venv is respected. Not that the kitty python files are meant to be
executed standalone anyway, but, whatever.

Fixes #6810
2023-11-11 08:32:05 +05:30
Kovid Goyal
7fe5d7b58f Replace isort with ruff 2023-01-09 16:47:42 +05:30
Kovid Goyal
cd92d50a0d Keyboard protocol: Remove CSI R from the allowed encodings of the F3 key as it conflicts with the *Cursor Position Report* escape code 2022-12-24 10:32:28 +05:30
Kovid Goyal
e66c732b41 Forgot to adjust test for new mouse encoding 2022-04-07 17:23:23 +05:30
Kovid Goyal
6546c1da9b run pyupgrade to upgrade the codebase to python3.6 2021-10-21 12:43:55 +05:30
Kovid Goyal
efb0f6f24a Fix a regression in 0.20.0 that sent incorrect bytes for the F1-F4 keys in rmkx mode
Fixes #3586
2021-05-07 15:09:42 +05:30
Kovid Goyal
a7c5b8c634 Fix #3471 2021-04-13 09:53:57 +05:30
Ravi R Kiran
fdfba4ea04 Fix pyflakes failures 2021-03-30 14:57:41 -05:00
Ravi R Kiran
953253de99 Implementation of hyper and meta 2021-03-30 14:23:17 -05:00
Kovid Goyal
56fcbb95ab Key encoding: in legacy mode use legacy encoding for a few more combinations
Some legacy terminal applications get confused seeing CSI u escape
codes. Since it is relatively common to press ctrl or shift and
space/enter/tab/backspace, emit the same bytes as traditional terminals
do for these common keys.
2021-02-21 11:14:25 +05:30
Kovid Goyal
5675944c0c Recognize remaining ASCII keys for legacy mode as well 2021-02-15 05:33:57 +05:30
Kovid Goyal
6b9c280214 Add a test for encoding of : as a legacy ascii key 2021-02-15 05:27:32 +05:30
Kovid Goyal
2a8e8d4b38 Fix #3252 2021-01-20 16:02:28 +05:30
Kovid Goyal
e6644aebcb Add a test to ensure caps lock does not produce bytes in legacy mode 2021-01-19 09:19:34 +05:30
Kovid Goyal
39da92d8ab Now that glfw reports shifted keys, use it when encoding key events 2021-01-17 11:14:44 +05:30
Kovid Goyal
cf04a5a036 Add tests for encode/decode roundtripping 2021-01-16 20:52:15 +05:30
Kovid Goyal
0163bf3edb Fix enter/tab/backspace not being reported in all keys mode 2021-01-16 20:52:15 +05:30
Kovid Goyal
0714fd376b Fix handling of ctrl key in legacy mode
Also change the glfw constants used for the modifiers to match those
used in the terminal encoding. Less likely to make mistakes translating
that way.
2021-01-16 20:52:14 +05:30
Kovid Goyal
39f41faf9f Dont send events for modifier keys unless in all key mode 2021-01-16 20:52:14 +05:30
Kovid Goyal
c421fd56be Ensure typing in shell works in disambiguate mode 2021-01-16 20:52:14 +05:30
Kovid Goyal
47a901385f Implement reporting of all keys as escape codes with text 2021-01-16 20:52:13 +05:30
Kovid Goyal
819bd5cd70 Tests for alternate key reporting 2021-01-16 20:52:13 +05:30
Kovid Goyal
753ad68ca9 Add tests for event type reporting 2021-01-16 20:52:13 +05:30
Kovid Goyal
5498f4e526 ... 2021-01-16 20:52:13 +05:30
Kovid Goyal
83a01b6bf4 Add tests for the disambiguate flag 2021-01-16 20:52:13 +05:30
Kovid Goyal
c519013b20 Add tests for legacy letter key encodings 2021-01-16 20:52:13 +05:30
Kovid Goyal
eeacac227a Add tests for functional KP keys 2021-01-16 20:52:13 +05:30
Kovid Goyal
529e9f83f7 Finish up functional key tests 2021-01-16 20:52:13 +05:30
Kovid Goyal
1690718710 More removal of GLFW_KEY_ constants 2021-01-16 20:52:12 +05:30
Kovid Goyal
f06eee8fe1 Define special numbers in one place only 2021-01-16 20:52:12 +05:30
Kovid Goyal
a30ea2b7f8 Implement progressive enhancement of key event reporting 2021-01-16 20:52:12 +05:30
Trygve Aaberge
8efe08c45b Support more mouse buttons for terminal mouse events
Previously, the mouse back and forward buttons sent the same codes as
scroll up and down. Now they instead send the same codes as xterm. Mouse
button 10 (in X11 numbering) also now sends the same as xterm, instead
of not sending anything.

This also changes the `send_mouse_event` function which can be called
from kittens to use X11 numbering for mouse buttons instead of what it
previously used, which turns out to be a hybrid of X11 and GLFW. It was
documented to use GLFW numbering, but GLFW doesn't have numbers for
scroll events (that's separate events with x/y offsets) and 4 and 5 in
GLFW is actually back and forward, while `send_mouse_event` interpreted
it as scroll up and down.

That means that this is a breaking change for `send_mouse_event` because
it swaps the number for the middle and right button to be consistent
with X11. I did this because I think it's better to use one consistent
numbering scheme for the function, and because people probably know X11
numbering better than GLFW numbering and GLFW doesn't have numbers for
the scroll buttons.
2020-06-06 14:19:06 +02:00
Trygve Aaberge
43af6e3b8a Add support for sending mouse events from a kitten
This allows you to a control a program running in kitty from a kitten
using mouse events. If the program is not receiving mouse events of that
type, it is not sent.
2020-04-12 16:19:50 +02:00
Luflosi
a792c94ccf Use python3 shebang for all python scripts
Fixes #1624.
Use python3 shebang for all python scripts as python still defaults to python2 on many systems.
2019-05-20 14:44:24 +02:00
Kovid Goyal
ce230b071b Add tests for SGR protocol encoding 2018-01-07 23:48:16 +05:30
Kovid Goyal
c5e989bc94 Move the key handler to C 2017-09-15 21:46:00 +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