<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/input.c, branch 1.22.3</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.22.3</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.22.3'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2025-04-19T11:36:13Z</updated>
<entry>
<title>input: reset modifiers in keyboard_leave()</title>
<updated>2025-04-19T11:36:13Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-04-19T06:05:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ef4a680ae813b23e7b9d1b6dd67413dcad377655'/>
<id>urn:sha1:ef4a680ae813b23e7b9d1b6dd67413dcad377655</id>
<content type='text'>
Closes #2034
</content>
</entry>
<entry>
<title>wayland+input: add support for toplevel edge constraints</title>
<updated>2025-04-07T11:41:37Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-04-07T11:32:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=23431e3ecfb59f71627b332852b906dc3d0bfad7'/>
<id>urn:sha1:23431e3ecfb59f71627b332852b906dc3d0bfad7</id>
<content type='text'>
Edge constraints are new (not yet available in a wayland-protocols
release) toplevel states, acting as a complement to the existing tiled
states.

Tiled tells us we shouldn't draw shadows etc *outside our window
geometry*.

Constrained tells us the window cannot be resized in the constrained
direction.

This patch does a couple of things:

* Recognize the new states when debug logging

* Change is_top_left() etc to look at the new constrained state
  instead of the tiled state. These functions are used when both
  choosing cursor shape, and when determining if/how to resize a
  window on a CSD edge click-and-drag.

* Update cursor shape selection to use the default (left_ptr) shape
  when on a constrained edge (or corner).

* Update CSD resize triggering, to not trigger a resize when attempted
  on a constrained edge (or corner).

See
https://gitlab.freedesktop.org/wayland/wayland-protocols/-/commit/86750c99ed062c306e837f11bb9492df572ad677:

    An edge constraint is an complementery state to the tiled state,
    meaning that it's not only tiled, but constrained in a way that it
    can't resize in that direction.

    This typically means that the constrained edge is tiled against a
    monitor edge. An example configuration is two windows tiled next
    to each other on a single monitor. Together they cover the whole
    work area.

    The left window would have the following tiled and edge constraint
    state:

        [ tiled_top, tiled_right, tiled_bottom, tiled_left,
          constrained_top, constrained_bottom, constrained_left ]

    while the right window would have the following:

        [ tiled_top, tiled_right, tiled_bottom, tiled_left,
          constrained_top, constrained_bottom, constrained_right ]

    This aims to replace and deprecate the
    `gtk_surface1.configure_edges` event and the
    `gtk_surface1.edge_constraint` enum.
</content>
</entry>
<entry>
<title>input: xkb: ignore virtual modifiers</title>
<updated>2025-03-31T06:08:43Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-03-29T09:34:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=58910856c8a86095883625009a089cef464edc44'/>
<id>urn:sha1:58910856c8a86095883625009a089cef464edc44</id>
<content type='text'>
Some compositors (mutter/GNOME is one) adds _virtual_ modifiers to the
set of active modifiers when e.g. Alt, Meta, Super or Hyper is
pressed. For example, pressing Alt+b would result in *both* the Alt
*and* the Mod1 modifier being set.

Since foot makes close to zero assumptions on how the modifiers should
be interpreted, this causes various breakages.

For example, a foot shortcut defined as Mod1+b will not match, since
the Alt modifiers is also set. This has forced users to
redefine/override some of the default key bindings to include the
additional modifiers.

It also causes issues with the kitty keyboard protocol, for some key
combinations. Mainly whether or not to use unshifted key or not,
resulting in incorrect escape sequences.

Since all the "real" modifiers are always set as well, we can safely
ignore the virtual modifiers.

Closes #2009
</content>
</entry>
<entry>
<title>input: kitty: unittest: don't fail if system has no compose tables</title>
<updated>2025-03-11T07:42:03Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-03-11T07:42:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=cfa178ab259528a106a2855bdd2e07c34a822224'/>
<id>urn:sha1:cfa178ab259528a106a2855bdd2e07c34a822224</id>
<content type='text'>
</content>
</entry>
<entry>
<title>input: kitty: send release events for composed keys</title>
<updated>2025-03-11T07:36:37Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-03-11T07:36:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7976975a8a6382a1e81a5d6c2749bc5beb23ff41'/>
<id>urn:sha1:7976975a8a6382a1e81a5d6c2749bc5beb23ff41</id>
<content type='text'>
</content>
</entry>
<entry>
<title>input: kitty: regression test for #1987</title>
<updated>2025-03-11T07:23:23Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-03-11T07:23:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=04fcc5f5b5d0a3f45d752e987a0c87baa4e50779'/>
<id>urn:sha1:04fcc5f5b5d0a3f45d752e987a0c87baa4e50779</id>
<content type='text'>
</content>
</entry>
<entry>
<title>input: kitty: always use shifted key when it's the result of a compose</title>
<updated>2025-03-10T14:47:20Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-03-10T14:47:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=8d2627b1ef8fd7f8313e4441de3c76b873575a8e'/>
<id>urn:sha1:8d2627b1ef8fd7f8313e4441de3c76b873575a8e</id>
<content type='text'>
Closes #1987
</content>
</entry>
<entry>
<title>config+url: add support for user-defined regex patterns</title>
<updated>2025-02-05T12:35:17Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-02-03T07:55:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=051cd6ecfc8b98e1d80b399ebea40207fe040750'/>
<id>urn:sha1:051cd6ecfc8b98e1d80b399ebea40207fe040750</id>
<content type='text'>
Users can now define their own regex patterns, and use them via key
bindings:

    [regex:foo]
    regex=foo(bar)?
    launch=path-to-script-or-application {match}

    [key-bindings]
    regex-launch=[foo] Control+Shift+q
    regex-copy=[foo] Control+Mod1+Shift+q

That is, add a section called 'regex:', followed by an
identifier. Define a regex and a launcher command line.

Add a key-binding, regex-launch and/or regex-copy (similar to
show-urls-launch and show-urls-copy), and connect them to the regex
with the "[regex-name]" syntax (similar to how the pipe-* bindings
work).
</content>
</entry>
<entry>
<title>input: match unshifted key-bindings before shifted</title>
<updated>2025-01-31T08:07:42Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-01-31T08:07:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=51128a3484049e5f9b9b74276222977d12554d76'/>
<id>urn:sha1:51128a3484049e5f9b9b74276222977d12554d76</id>
<content type='text'>
That is, try to match e.g. Control+shift+a, before trying to match
Control+A.

In most cases, order doesn't matter. There are however a couple of
symbols where the layout consumes the shift-modifier, and the
generated symbol is the same in both the shifted and unshifted
form. One such example is backspace.

Before this patch, key-bindings with shift-backspace would be ignored,
if there were another key-binding with backspace.

So, for example, if we had one key-binding with Control+Backspace, and
another with Control+Shift+Backspace, the latter would never trigger,
as we would always match the first one.

By checking for unshifted matches first, we ensure
Control+Shift+Backspace does match.
</content>
</entry>
<entry>
<title>input: ignore key-bindings without modifiers when matching untranslated/raw</title>
<updated>2025-01-31T06:35:54Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-01-31T06:35:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=bee17a95b86a640522c25e650e13aebc82c7353d'/>
<id>urn:sha1:bee17a95b86a640522c25e650e13aebc82c7353d</id>
<content type='text'>
When matching the unshifted symbol, or the raw key code, ignore all
key bindings that don't have any modifiers.

This fixes an issue where it was impossible to enter (some of the)
numbers on the keypad, **if** there was a key-binding for
e.g. KP_Page_Up, or KP_Page_Down.
</content>
</entry>
<entry>
<title>input: close fd on no/unrecognized keymap format</title>
<updated>2025-01-30T10:58:19Z</updated>
<author>
<name>Attila Fidan</name>
<email>dev@print0.net</email>
</author>
<published>2025-01-30T09:39:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5286808b6cd439c0442a76169d7a58b1b7e71e8c'/>
<id>urn:sha1:5286808b6cd439c0442a76169d7a58b1b7e71e8c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>key-bindings: try all bindings in translated mode before matching untranslated, and then finally raw</title>
<updated>2025-01-27T11:31:40Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-01-27T09:51:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=8d6f0d0583a1cb7c245ff54ec472a03ebcdb6949'/>
<id>urn:sha1:8d6f0d0583a1cb7c245ff54ec472a03ebcdb6949</id>
<content type='text'>
When trying to match key bindings, we do three types of matching:

* Match the _translated_ symbol (e.g. Control+C)
* Match the _untranslated_ symbol (e.g. Control+Shift+c)
* Match raw keyboard codes

This was done for *each* key binding. This meant we sometimes matched
a keybinding in raw mode, even though there was a
translated/untranslated binding that would match it too. All depending
on the internal order of the key binding list.

This patch changes it, so that we first try all bindings in translated
mode, then all bindings in untranslated mode, and finally all bindings
in raw mode.

Closes #1929
</content>
</entry>
<entry>
<title>input: kitty: refactor, try to simplify and be less confusing</title>
<updated>2025-01-22T11:37:36Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-01-22T11:37:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ba7ecc4669ab0bef850318478cf739016a2fc6a9'/>
<id>urn:sha1:ba7ecc4669ab0bef850318478cf739016a2fc6a9</id>
<content type='text'>
Use better named variables while juggling the shifted vs. unshifted
key codes.

Switch to variable names appropriate for the kitty keyboard protocol
once we have all the unshifted, shifted and base key codes done. It's
not until then we can decide which key code to use as the main key,
and whether or not to report the alternate key code.
</content>
</entry>
<entry>
<title>input: kitty: add more test cases</title>
<updated>2025-01-22T11:24:06Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-01-22T11:24:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f301f6ecccc4a6be70da793c56814e50d13e93db'/>
<id>urn:sha1:f301f6ecccc4a6be70da793c56814e50d13e93db</id>
<content type='text'>
</content>
</entry>
<entry>
<title>input: kitty: only set 'alternate' if the "unshifted" code is printable</title>
<updated>2025-01-22T09:26:44Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-01-22T09:26:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=6ca1a2c2dcdcbd3432a953e19f55829b6f07e7f0'/>
<id>urn:sha1:6ca1a2c2dcdcbd3432a953e19f55829b6f07e7f0</id>
<content type='text'>
Fixes a regression where alt+backspace was reported as ^[[8:127;3u
instead of ^[[127;3u.
</content>
</entry>
<entry>
<title>input: codespell: indiciates -&gt; indicates</title>
<updated>2025-01-22T07:04:17Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-01-22T06:51:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f62a5ed1ff139b70d6c12ee3033cc956c3d93723'/>
<id>urn:sha1:f62a5ed1ff139b70d6c12ee3033cc956c3d93723</id>
<content type='text'>
</content>
</entry>
<entry>
<title>input: kitty: add initial unit test</title>
<updated>2025-01-22T07:04:17Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-01-21T07:37:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=09f718878f8afa54cb38d046db0af12e1ff679a2'/>
<id>urn:sha1:09f718878f8afa54cb38d046db0af12e1ff679a2</id>
<content type='text'>
Test a couple of key combos from the se and de(neo) layouts.

This unit test isn't intended to test _all_ key combinations, for all
kitty flag combinations, but to be more of a regression test -
whenever we discover a buggy, weird combo, add it here.
</content>
</entry>
<entry>
<title>input: kitty: improve handling of alternate+base keys even more</title>
<updated>2025-01-20T09:34:45Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-01-20T09:34:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=786037791c2e775c98287d794277b6ef0752aab4'/>
<id>urn:sha1:786037791c2e775c98287d794277b6ef0752aab4</id>
<content type='text'>
* Always do a base key lookup. Before this, we didn't do that if we
  matched the XKB sym to a lookup table entry (i.e. keypads, cursor keys
  etc.)
* Try to retrieve the unshifted symbol also when we matched the symbol
  to a lookup table entry. When successful, we now report an alternate
  key for keypad and cursor keys; before this patch, we only did that
  for keys that didn't have an entry in the lookup table (i.e. ASCII
  chars etc).

This improves compatibility with kitty (and the kitty keyboard
protocol) in more corner cases. One particular example is the neo
keyboard layout, where part of the regular keys act as keypad keys
when num-lock is active.
</content>
</entry>
<entry>
<title>input: kitty: fix alternate codepoint sometimes not being reported</title>
<updated>2025-01-20T08:08:47Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-01-20T08:08:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=2ff38e86a7fabd8fd90caa31c7eb0aea76fc981b'/>
<id>urn:sha1:2ff38e86a7fabd8fd90caa31c7eb0aea76fc981b</id>
<content type='text'>
When alternate key reporting is enabled (i.e. when we're supposed to
report the shifted key along with the unshifted key), we try to figure
out whether the key really is shifted or not (and thus which xkb
keysym to use for the unshifted and shifted keys in the escape).

This was done by getting the layout's *all* modifier combinations that
produce the shifted keysym, and if any of of them contained a modifier
that isn't supported by the kitty protocol, the shifted and unshifted
keys are derived from the same keysym. This is to ensure we handle
things like AltGr-combos correctly.

The issue is, since there may be more than one modifier combination
generating the shifted keysym, we may end up using the wrong keysym
just because _another_ combination set contains modifiers not
supported by the kitty protocol. What we're interrested in is whether
the *pressed* set of modifiers contains such modifiers.

Closes #1918
</content>
</entry>
<entry>
<title>kitty kbd: don't generate release events for plain Enter+Tab+Backspace</title>
<updated>2025-01-01T07:06:52Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2025-01-01T07:06:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e851d44ac949df533a31b7e40a6ab5752dac79f5'/>
<id>urn:sha1:e851d44ac949df533a31b7e40a6ab5752dac79f5</id>
<content type='text'>
From the specification:

    The Enter, Tab and Backspace keys will not have release events
    unless Report all keys as escape codes is also set, so that the
    user can still type reset at a shell prompt when a program that
    sets this mode ends without resetting it.

Closes #1892
</content>
</entry>
</feed>
