mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-10-21 20:52:19 +00:00
If you live in the terminal, kitty is made for you! Cross-platform, fast, feature-rich, GPU based.
https://sw.kovidgoyal.net/kitty/
remap_modifier <from> <to>
Repeatable and off by default. The declarations compose as a single
simultaneous permutation applied once per event, so
remap_modifier ctrl super
remap_modifier super ctrl
exchanges the two rather than collapsing to the identity. Only shift, alt,
ctrl, super, hyper and meta may be named; anything else is rejected with an
error. The last declaration for a given source wins.
The remap is applied to the modifier mask BEFORE the platform produces the
keysym and text - in glfw_xkb_update_modifiers() before xkb_state_update_mask()
on Linux, and in remap_cocoa_flags() before UCKeyTranslate() and
interpretKeyEvents: on macOS. Applying it to the finished event instead
desynchronises the modifiers from the text for any modifier that participates
in text production: shift on Linux, and Option on macOS, which produces text
natively unless macos_option_as_alt is set.
Because the GLFW modifiers are themselves derived from that state, this is
application wide: kitty's own shortcuts, kitty_mod and the bytes sent to the
child all see the remapped modifier, and every mapping in kitty.conf is written
in terms of the modifier a key becomes. X11 pointer events do not go through
xkb, so translateState() - which only ever sees button and DND events - gets
the same treatment; Wayland pointer events already carry xkb-derived modifiers.
A modifier key's own event has its identity remapped too, so a program using
the full keyboard protocol does not see ctrl reported together with LEFT_HYPER.
The press/release state fixup on Linux is given the remapped modifier rather
than the physical one, so press and release agree.
--debug-input reports each remapped event.
Notes: on Wayland kitty only detects hyper and meta when
KITTY_WAYLAND_DETECT_MODIFIERS is set, so remapping to or from them has nothing
to act on there. On macOS hyper and meta have no Cocoa modifier flag, so a
remap onto them is left unapplied rather than silently dropping the modifier,
and interpretKeyEvents: is only approximately corrected because the event's
characters strings were computed by the OS from the physical flags; the
UCKeyTranslate() path, normally the one taken, is exact.
Generated option files and the glfw wrapper come from their generators.
|
||
|---|---|---|
| .github | ||
| 3rdparty | ||
| bypy | ||
| docs | ||
| gen | ||
| glad | ||
| glfw | ||
| kittens | ||
| kitty | ||
| kitty_tests | ||
| logo | ||
| shell-integration | ||
| terminfo | ||
| tools | ||
| .editorconfig | ||
| .gitattributes | ||
| .gitignore | ||
| __main__.py | ||
| benchmark.py | ||
| Brewfile | ||
| build-terminfo | ||
| CHANGELOG.rst | ||
| CONTRIBUTING.md | ||
| count-lines-of-code | ||
| dev.sh | ||
| embeds.go | ||
| go.mod | ||
| go.sum | ||
| INSTALL.md | ||
| key_encoding.json | ||
| LICENSE | ||
| local-agent.md | ||
| Makefile | ||
| publish.py | ||
| pyproject.toml | ||
| README.asciidoc | ||
| rsync-and-build.sh | ||
| SECURITY.md | ||
| session.vim | ||
| setup.py | ||
| shell.nix | ||
| staticcheck.conf | ||
| test.py | ||
| update-on-ox | ||
= kitty - the fast, feature-rich, cross-platform, GPU based terminal If you live in the terminal, *kitty* is made for **you**! See https://sw.kovidgoyal.net/kitty/[the kitty website]. image:https://github.com/kovidgoyal/kitty/workflows/CI/badge.svg["Build status", link="https://github.com/kovidgoyal/kitty/actions?query=workflow%3ACI"] https://sw.kovidgoyal.net/kitty/faq/[Frequently Asked Questions] To ask other questions about kitty usage, use either the https://github.com/kovidgoyal/kitty/discussions/[discussions on GitHub] or the https://www.reddit.com/r/KittyTerminal[Reddit community] Packaging status in various repositories: image:https://repology.org/badge/vertical-allrepos/kitty-terminal.svg?columns=3&header=kitty["Packaging status", link="https://repology.org/project/kitty-terminal/versions"]