<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/input.c, branch 1.13.1</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.13.1</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.13.1'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2022-08-12T14:15:55Z</updated>
<entry>
<title>input: ignore pointer motion events on unknown surfaces</title>
<updated>2022-08-12T14:15:55Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-08-12T14:13:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=20b8ca1601a8a80770110860ae70d4487c95081b'/>
<id>urn:sha1:20b8ca1601a8a80770110860ae70d4487c95081b</id>
<content type='text'>
In some cases, the compositor sends a pointer enter event with a NULL
surface. It’s unclear if this is a compositor bug, or a race (where
the compositor sends an enter event on a CSD surface at the same time
foot unmaps the CSDs). Regardless, this causes seat-&gt;mouse_focus to be
unset, which triggers a crash in foot on the next pointer motion
event.

This patch does two things:

a) log a warning when we receive a pointer event with a NULL surface
b) ignore motion events where seat-&gt;mouse_focus is NULL
</content>
</entry>
<entry>
<title>unicode-input: move input (key press) handling to unicode_mode_input()</title>
<updated>2022-07-29T07:26:42Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-07-28T17:34:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=001f96c4e3ae26a9b2807b549c782a094a36ff3a'/>
<id>urn:sha1:001f96c4e3ae26a9b2807b549c782a094a36ff3a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>input: add new Unicode input mode</title>
<updated>2022-07-29T07:26:31Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-07-28T16:09:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=8967dd9cfe51276d63ef8ff64e8fc76f80a6fa3d'/>
<id>urn:sha1:8967dd9cfe51276d63ef8ff64e8fc76f80a6fa3d</id>
<content type='text'>
This mode is activated through the new key-bindings.unicode-input and
search-bindings.unicode-input key bindings.

When active, the user can “build” a Unicode codepoint by typing its
hexadecimal value.

Note that there’s no visual feedback in this mode. This is
intentional. This mode is intended to be a fallback for users that
don’t use an IME.

Closes #1116
</content>
</entry>
<entry>
<title>input: kitty: always treat composed characters as ‘printable’</title>
<updated>2022-07-28T17:02:25Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-07-26T16:44:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=801970aa332da5786f91d2f9410d4ed9f440c6ec'/>
<id>urn:sha1:801970aa332da5786f91d2f9410d4ed9f440c6ec</id>
<content type='text'>
Certain dead key combinations results different escape sequences in
foot, compared to kitty, when the kitty keyboard protocol is used.

        if (composed &amp;&amp; is_text)
            key = utf32;
        else {
            key = xkb_keysym_to_utf32(sym_to_use);
            if (key == 0)
                return false;

            /* The *shifted* key. May be the same as the unshifted
             * key - if so, this is filtered out below, when
             * emitting the CSI */
            alternate = xkb_keysym_to_utf32(sym);
        }

If is_text=false, we’ll fall through to the non-composed
logic. is_text is set to true if the character is printable *and*
there aren’t any non-consumed modifiers enabled.

shift+space is one example where shift is *not* consumed (typically -
may be layouts where it is).

As a result, pressing ", followed by shift+space with the
international english keyboard layout (where " is a dead key) results
in different sequences in foot and kitty.

This patch fixes this by always treating composed characters as
printable.

Closes #1120
</content>
</entry>
<entry>
<title>input: don’t ignore keyboard enter/leave events when there’s no keymap</title>
<updated>2022-06-28T18:57:48Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-06-28T18:57:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d58290ea1213725ddf0f76be129fc5f680d9ccd2'/>
<id>urn:sha1:d58290ea1213725ddf0f76be129fc5f680d9ccd2</id>
<content type='text'>
The compositor _usually_ sends the keymap event *before* the enter
event. But not always.

Not (yet) having a keymap is not a reason to ignore the enter
event (now, on the other hand, getting a key press/release event
without a keymap is a compositor bug).

Closes #1097
</content>
</entry>
<entry>
<title>osc: add support for OSC 133;A (prompt markers)</title>
<updated>2022-06-16T17:02:10Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-06-15T16:44:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=bdb79e8b9fb36f627bb204ce2060dd5a877f3712'/>
<id>urn:sha1:bdb79e8b9fb36f627bb204ce2060dd5a877f3712</id>
<content type='text'>
This patch adds support for the OSC-133;A sequence, introduced by
FinalTerm and implemented by iTerm2, Kitty and more. See
https://iterm2.com/documentation-one-page.html#documentation-escape-codes.html.

The shell emits the OSC just before printing the prompt. This lets the
terminal know where, in the scrollback, there are prompts.

We implement this using a simple boolean in the row struct ("this row
has a prompt"). The prompt marker must be reflowed along with the text
on window resizes.

In an ideal world, erasing, or overwriting the cell where the OSC was
emitted, would remove the prompt mark. Since we don't store this
information in the cell struct, we can't do that. The best we can do
is reset it in erase_line(). This works well enough in the "normal"
screen, when used with a "normal" shell. It doesn't really work in
fullscreen apps, on the alt screen. But that doesn't matter since we
don't support jumping between prompts on the alt screen anyway.

To be able to jump between prompts, two new key bindings have been
added: prompt-prev and prompt-next, bound to ctrl+shift+z and
ctrl+shift+x respectively.

prompt-prev will jump to the previous, not currently visible, prompt,
by moving the viewport, ensuring the prompt is at the top of the
screen.

prompt-next jumps to the next prompt, visible or not. Again, by moving
the viewport to ensure the prompt is at the top of the screen. If
we're at the bottom of the scrollback, the viewport is instead moved
as far down as possible.

Closes #30
</content>
</entry>
<entry>
<title>url-mode: add support for XDG activation when opening URLs</title>
<updated>2022-05-05T08:02:28Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-05-03T17:37:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ea1aac88db3a6d9f368406676c3e5a0cedcafd57'/>
<id>urn:sha1:ea1aac88db3a6d9f368406676c3e5a0cedcafd57</id>
<content type='text'>
First, add a ‘token’ argument to spawn(). When non-NULL, spawn() will
set the ‘XDG_ACTIVATION_TOKEN’ environment variable in the forked
process. If DISPLAY is non-NULL, we also set DESKTOP_STARTUP_ID, for
compatibility with X11 applications. Note that failing to set either
of these environment variables are considered non-fatal - i.e. we
ignore failures.

Next, add a helper function, wayl_get_activation_token(), to generate
an XDG activation token, and call a user-provided callback when it’s
‘done (since token generation is asynchronous). This function takes an
optional ‘seat’ and ‘serial’ arguments - when both are non-NULL/zero,
we set the serial on the token. ‘win’ is a required argument, used to
set the surface on the token.

Re-write wayl_win_set_urgent() to use the new helper function.

Finally, rewrite activate_url() to first try to get an activation
token (and spawn the URL launcher in the token callback). If that
fails, or if we don’t have XDG activation support, spawn the URL
launcher immediately (like before this patch).

Closes #1058
</content>
</entry>
<entry>
<title>input: assert serial received from compositor is non-zero</title>
<updated>2022-04-24T18:18:51Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-23T13:54:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a26eb1ea09b9a3c49cb664937c736915e2ab07ee'/>
<id>urn:sha1:a26eb1ea09b9a3c49cb664937c736915e2ab07ee</id>
<content type='text'>
</content>
</entry>
<entry>
<title>input: codespell</title>
<updated>2022-04-20T17:03:48Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-20T17:03:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e4d085a17b4b82e7b20572b63898bfb0b55ddc2c'/>
<id>urn:sha1:e4d085a17b4b82e7b20572b63898bfb0b55ddc2c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>input: copy libxkbcommon’s keysym_is_modifier()</title>
<updated>2022-04-20T16:23:20Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-20T16:23:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=0504a3e71a2ead60c8623daac1d61ac74ba6bfc6'/>
<id>urn:sha1:0504a3e71a2ead60c8623daac1d61ac74ba6bfc6</id>
<content type='text'>
When determining whether a keysym is a modifier (to skip hiding the
pointer when [mouse].hide-when-typing=yes), use the same matching
logic xkbcommon does.

This function, xkb_keysym_is_modifier() is unfortunately not part of
the public API, which is why we copy it instead.
</content>
</entry>
<entry>
<title>wayland: refactor: remove ‘struct config’ pointer from wayland struct</title>
<updated>2022-04-17T14:34:04Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-17T14:29:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=24ee3dcc10c5e1cf57456cc39fa0b5e8700a06ed'/>
<id>urn:sha1:24ee3dcc10c5e1cf57456cc39fa0b5e8700a06ed</id>
<content type='text'>
The global config doesn’t necessarily reflect the correct
configuration to use - we should *always* use the current terminal
instance’s conf pointer.

* Move selection override modifier mask to the key_binding_set struct
* Always warn if XDG activation is unavailable, not just if
  bell.urgent is set (we no longer have access to this information)
* Pass ‘bool presentation_timings’ as a parameter to wayl_init()
* Remove ‘presentation_timings’ member from the ‘terminal’ struct

Closes #932
</content>
</entry>
<entry>
<title>key-binding: new API, for handling sets of key bindings</title>
<updated>2022-04-17T13:39:51Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-17T13:39:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=90a2ca966f657e5fdd82997aad9663e9984f3cc9'/>
<id>urn:sha1:90a2ca966f657e5fdd82997aad9663e9984f3cc9</id>
<content type='text'>
Up until now, our Wayland seats have been tracking key bindings. This
makes sense, since the seat’s keymap determines how the key bindings
are resolved.

However, tying bindings to the seat/keymap alone isn’t enough, since
we also depend on the current configuration (i.e. user settings) when
resolving a key binding.

This means configurations that doesn’t match the wayland object’s
configuration, currently don’t resolve key bindings correctly. This
applies to footclients where the user has overridden key bindings on
the command line (e.g. --override key-bindings.foo=bar).

Thus, to correctly resolve key bindings, each set of key bindings must
be tied *both* to a seat/keymap, *and* a configuration.

This patch introduces a key-binding manager, with an API to
add/remove/lookup, and load/unload keymaps from sets of key bindings.

In the API, sets are tied to a seat and terminal instance, since this
makes the most sense (we need to instantiate, or incref a set whenever
a new terminal instance is created). Internally, the set is tied to a
seat and the terminal’s configuration.

Sets are *added* when a new seat is added, and when a new terminal
instance is created. Since there can only be one instance of each
seat, sets are always removed when a seat is removed.

Terminals on the other hand can re-use the same configuration (and
typically do). Thus, sets ref-count the configuration. In other words,
when instantiating a new terminal, we may not have to instantiate a
new set of key bindings, but can often be incref:ed instead.

Whenever the keymap changes on a seat, all key bindings sets
associated with that seat reloads (re-resolves) their key bindings.

Closes #931
</content>
</entry>
<entry>
<title>url-mode: add a key binding that enables “persistent” URL mode</title>
<updated>2022-04-17T09:24:27Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-03-22T18:07:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=501a9fbb5e1ec09c26cf61c464cf5b4ae6dba28a'/>
<id>urn:sha1:501a9fbb5e1ec09c26cf61c464cf5b4ae6dba28a</id>
<content type='text'>
This is an alternative to ‘show-urls-launch’, where we stay in URL
mode after activating an URL.

Closes #964
</content>
</entry>
<entry>
<title>wayland: optionally disable pointer input on subsurfaces</title>
<updated>2022-04-16T15:41:14Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-16T15:41:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=129deaffa82650a1383f5816aa46f4a78a73b2ed'/>
<id>urn:sha1:129deaffa82650a1383f5816aa46f4a78a73b2ed</id>
<content type='text'>
We have a number of sub-surfaces for which we are *not* interrested in
pointer (or touch) input.

Up until now, we’ve manually dealt with these, by recognizing these
surfaces in all pointer events, and ignoring them.

But, lo and behold, there are better ways of doing this. By clearing
the subsurface’s input region, the compositor will do this for us -
when a pointer is outside a surface’s input region, the event is
passed to the next surface underneath it.

This is exactly what we want! Do this for all subsurfaces, *except*
the CSDs.
</content>
</entry>
<entry>
<title>input: improve XTerm compatibility when modifyOtherKeys=2</title>
<updated>2022-04-10T16:34:51Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-07T10:42:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5d6eaf606b5713365a232f188c922454943f2c09'/>
<id>urn:sha1:5d6eaf606b5713365a232f188c922454943f2c09</id>
<content type='text'>
Before this, foot always emitted a CSI if _any_ modifier was
active. XTerm doesn’t behave quite like this. Instead, it appears to
special-case shift somewhat:

If the generated symbol (e.g ‘A’) is the upper case version of the
pressed key’s base symbol (‘a’), and is in the range a-z, emit a CSI.

If not emit a plain symbol:

Examples (Swedish layout):

* shift-a (generated symbol is ‘A’) emits a CSI
* shift-, (generated symbol is ‘;’) emits ‘;’
* shift-alt-, (generated symbol is ‘;’) emits a CSI

Closes #1009
</content>
</entry>
<entry>
<title>refactor: add a ‘range’ struct, grouping a start and end coord together</title>
<updated>2022-04-09T13:09:02Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-04-09T13:09:02Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5b1f1602bccfb7c37e50a8509f44b24e9aa3b5d1'/>
<id>urn:sha1:5b1f1602bccfb7c37e50a8509f44b24e9aa3b5d1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>input: don’t allow non-significant modifiers when matching untranslated symbols</title>
<updated>2022-03-20T12:29:29Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-03-19T17:59:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1e63dddb89a27de702fced65d7b6ba3b39812bb9'/>
<id>urn:sha1:1e63dddb89a27de702fced65d7b6ba3b39812bb9</id>
<content type='text'>
When matching “untranslated” bindings (by matching the base symbol of
the key, e.g. ctrl+shift+2 in US layout), require that no
non-significant modifiers are active.

This fixes an issue where AltGr was “ignored”, and would cause certain
combinations to match a key binding.

Example: ctrl+altgr+0, on many European layouts matched against the
default ctrl+0 (reset the font size), instead of emitting ^]

To make this work, we now need to filter out “locked”
modifiers (e.g. NumLock and CapsLock). Otherwise having e.g. NumLock
active would prevent *all* untranslated matching to fail.

Closes #983
</content>
</entry>
<entry>
<title>input: get_current_modifiers(): don’t crash if seat has no keyboard</title>
<updated>2022-03-04T16:54:19Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-03-04T16:54:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=6e536e7ed8f1de2615fa323123ddb2b06a45a179'/>
<id>urn:sha1:6e536e7ed8f1de2615fa323123ddb2b06a45a179</id>
<content type='text'>
Closes #963
</content>
</entry>
<entry>
<title>config/input: add scrollback-home|end key bindings (unbound by default)</title>
<updated>2022-02-23T18:03:54Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-02-23T18:03:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f869ca45467ce7d326deffcff7e270cbcc893d2c'/>
<id>urn:sha1:f869ca45467ce7d326deffcff7e270cbcc893d2c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wip: map key combos to custom text strings (including escapes)</title>
<updated>2022-02-16T22:02:07Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-02-06T18:36:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=422d94fb46ad18e52f5385e416cd00cb7b4c2fc9'/>
<id>urn:sha1:422d94fb46ad18e52f5385e416cd00cb7b4c2fc9</id>
<content type='text'>
With this, it is now possible to map key combos to custom escapes. The
new bindings are defined in a new section, “text-bindings”, on the
form “string=key combo”.

The string can consist of printable characters, or \xNN style hex
digits:

  [text-bindings]
  abcd = Control+a
  \x1b[A = Control+b Control+c Control+d  # map ctrl+b/c/d to UP
</content>
</entry>
</feed>
