<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/input.c, branch 1.20.0</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.20.0</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.20.0'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2025-01-01T07:06:52Z</updated>
<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>
<entry>
<title>csd: track pointer when rendering and handling CSD button clicks</title>
<updated>2024-08-09T06:20:59Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-08-09T06:20:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=bef613e656a36400577cde295b09267c80f3adce'/>
<id>urn:sha1:bef613e656a36400577cde295b09267c80f3adce</id>
<content type='text'>
* Render button as highlighted only when pointer is above them
* Releasing the mouse button while *not* on the button does *not*
  activate the button

When pressing, and holding, a mouse button, the compositor keeps
sending motion events for the surface where the button was pressed,
even if the mouse has moved outside it.

We also don't get any surface leave/enter events.

This meant that the button was rendered as highlighted, and a click
registered, if the user pressed the mouse button while on the button,
and then moved the cursor away from the button before releasing the
button.

This patch fixes it, by checking if the current cursor coordinates
fall within the button surface.
</content>
</entry>
<entry>
<title>input: CSD buttons are now triggered when releasing the mouse button</title>
<updated>2024-08-09T06:20:36Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-08-02T15:12:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7ec9ca2b9528126bf11dda37cfea9687b6bc66a3'/>
<id>urn:sha1:7ec9ca2b9528126bf11dda37cfea9687b6bc66a3</id>
<content type='text'>
This is how most UIs work.

Note that we (at least on River) don't get any surface enter/leave
events while a button is held. This means we can't detect if the user
pressed the mouse button while on a CSD button, but then moves the
mouse outside. Releasing the mouse button will still activate the CSD
button.

Closes #1787
</content>
</entry>
<entry>
<title>spawn: add optional reaper callback, return pid_t</title>
<updated>2024-07-23T05:17:21Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-07-23T04:57:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a42f99081876dd02e28b931f7c0e70230355bb58'/>
<id>urn:sha1:a42f99081876dd02e28b931f7c0e70230355bb58</id>
<content type='text'>
This will allow spawn() callers to do things when the spawned process
has terminated.
</content>
</entry>
<entry>
<title>input: allow mouse selections to start inside the margins</title>
<updated>2024-07-19T04:55:28Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-07-18T06:08:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=45c7cd3f7472b11d50622b10867a329b4d8e2451'/>
<id>urn:sha1:45c7cd3f7472b11d50622b10867a329b4d8e2451</id>
<content type='text'>
Before this, margins were special cased:

* The mouse cursor was always a pointer, and never an I-beam (thus
  signaling selections cannot be made).
* The internal mouse coords where set to -1 when the cursor was inside
  the margins, causing:
    - text selections from being made
    - mouse events being passed to mouse grabbing applications

In particular, even with a one-pixel margin, making selections was
unnecessarily hard in e.g. fullscreen mode, where you'd expect to be
able to throw the cursor into the corner of the screen and then start
a selection.

With this patch, the cursor is treated as if it was in the first/last
column/row, when inside the margin(s).

An unintended side-effect of this, initially, was that auto-scrolling
selections where way too easy to trigger, since part of its logic is
checking if the cursor is inside the margins.

That problem has been reduced by two things:

* auto-scrolling does not occur unless a selection has been
  started. That is, just holding down the mouse in the margins and
  moving up/down doesn't cause scrolling. You have to first select at
  least one cell in the visible viewport.
* A selection isn't fully started (i.e. a cell is actually selected)
  unless the cursor is inside the actual grid, and *not* in the
  margins.

What does the last point mean? We now allow a selection to be
_started_ when clicking in the margin. What this means internally is
we set a start coordinate for a selection, but *not* and end
coordinate. At this point, we don't have an actual selection. Nothing
is selected, and no cells are highlighted, graphically.

This happens when we set an end coordinate. Without the last bullet
point, that would happen as soon as the cursor was _moved_, even if
still inside the margins. Now, we require the cursor to leave the
margins and touch an actual cell before we set an end coordinate.

Closes #1702
</content>
</entry>
<entry>
<title>input: don't map wheel events to BTN_{BACK,FORWARD}</title>
<updated>2024-07-13T08:41:10Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-07-13T08:24:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1136108c9780eae9fae252a1bca5089f19fcd57d'/>
<id>urn:sha1:1136108c9780eae9fae252a1bca5089f19fcd57d</id>
<content type='text'>
BTN_BACK and BTN_FORWARD are separate buttons. The scroll wheel don't
have any button mappings in libinput/wayland, so make up our own
defines.

This allows us to map them in mouse bindings.

Also expose BTN_WHEEL_{LEFT,RIGHT}. These were already defined, and
used, internally, to handle wheel tilt events. With this, they can
also be used in mouse bindings.

Finally, fix encoding used for BTN_{BACK,FORWARD} when sending mouse
button events to the client application. Before this, they were mapped
to buttons 4/5. But, button 4/5 are for the scroll wheel, and as
mentioned above, BTN_{BACK,FORWARD} are not the same as scroll wheel
"buttons".

Closes #1763
</content>
</entry>
<entry>
<title>input: don't reset the XKB compose state in keymap()</title>
<updated>2024-06-22T06:00:13Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-06-22T05:58:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c45231ef89faeee0674e405e94ef6a92eb6726a0'/>
<id>urn:sha1:c45231ef89faeee0674e405e94ef6a92eb6726a0</id>
<content type='text'>
When the compositor sends a new keymap, don't reset the XKB compose
state.

This is done by initializing the XKB context, along with the compose
state, when binding the seat, instead of in keymap().

Then, in keymap(), simply stop destroying the old xkb state. Only
destroy, and re-create the keymap state.

Closes #1744
</content>
</entry>
<entry>
<title>input: implement wl_pointer::axis_value120()</title>
<updated>2024-06-18T12:09:03Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-06-15T08:17:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=aea16ba5d2896ef22bf0bea45e5e8142c0ff1c2a'/>
<id>urn:sha1:aea16ba5d2896ef22bf0bea45e5e8142c0ff1c2a</id>
<content type='text'>
This implements high resolution mouse wheel scroll events. A "normal"
scroll step corresponds to the value 120. Anything less than that is a
partial scroll step.

This event replaces axis_discrete(), when we bind wl_seat v8 (which we
now do, when available).

We calculate the number of degrees that is required to scroll a single
line, based off of the scrollback.multiplier value.

Each high-res event accumulates, until we have at least the number of
degress required to scroll one, or more lines.

The remaining degrees are kept, and added to in the next scroll event.

Closes #1738
</content>
</entry>
<entry>
<title>unicode-mode: move state from seat to term</title>
<updated>2024-05-21T06:36:56Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-05-21T05:06:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=18b702b2495d4fb9328930eed9875731cff4cbde'/>
<id>urn:sha1:18b702b2495d4fb9328930eed9875731cff4cbde</id>
<content type='text'>
This fixes an issue where entering unicode-mode in one foot client,
also enabled unicode-mode on other foot clients. Both
visually (although glitchy), and in effect.

The reason the state was originally in the seat objects, was to fully
support multi-seat. That is, one seat/keyboard entering unicode-mode
should not affect other seats/keyboards.

The issue with this is that seat objects are Wayland global. Thus, in
server mode, all seat objects are shared between the foot clients.

There is a similarity with IME, which also keeps state in the
seat. There's one big difference, however, and that is IME has Wayland
native enter/leave events, that the compositor emits when windows are
focused/unfocused. These events allow us to reset IME state. For our
own Unicode mode, there is nothing similar.

This patch moves the Unicode state from seats, to the terminal
struct. This does mean that if one seat/keyboard enters Unicode mode,
then *all* seats/keyboards will affect the unicode state. This
potential downside is outweighed by the fact that different foot
clients no longer affect each other.

Closes #1717
</content>
</entry>
<entry>
<title>config: add new key-binding 'quit', unbound by default</title>
<updated>2024-04-11T13:12:45Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-04-10T17:26:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=b400903e25de321dffd310e30d76dad121ccceb1'/>
<id>urn:sha1:b400903e25de321dffd310e30d76dad121ccceb1</id>
<content type='text'>
Closes #1475
</content>
</entry>
<entry>
<title>kitty kbd: update handling of locked modifiers</title>
<updated>2024-03-06T15:33:24Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-03-02T07:16:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=702d3ae6ca8e232ba4df9f0ee4e0141e243b49cf'/>
<id>urn:sha1:702d3ae6ca8e232ba4df9f0ee4e0141e243b49cf</id>
<content type='text'>
The kitty keyboard specification has been updated/clarified yet
again. Locked modifiers are to be ignored if the key event would
result in plain text without the locked modifier being enabled.

In short, locked modifiers are included in the set of modifiers
reported in a key event. But having a locked modifier enabled doesn't
turn all key events into CSIu sequences.

For example, with only the disambiguate mode enabled, pressing 'a', or
'shift+a' results in a/A regardless of the state of Caps- or NumLock.

But 'ctrl+a', which always results in a CSIu, will have a different
modifier list, depending on whether Caps- or NumLock are enabled.
</content>
</entry>
<entry>
<title>kitty kbd: switch from GTK to XKB mode for 'consumed' modifiers</title>
<updated>2024-03-02T09:28:25Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-02-29T08:32:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ec73e4d10d1f3aa899000c1dd4c58f371c7b926f'/>
<id>urn:sha1:ec73e4d10d1f3aa899000c1dd4c58f371c7b926f</id>
<content type='text'>
This fixes an issue where some key combinations resulted in different
output (e.g. escape code vs. plain text) depending on the state of
e.g. the NumLock key. One such example is Shift+space. Another example
is Shift+BackSpace.

This patch also removes the hardcoded CapsLock filter, when
determining whether a key combo produces text or not, and instead uses
the locked modifiers as reported by XKB.
</content>
</entry>
<entry>
<title>input: don't clear text selection on modifier keypresses</title>
<updated>2024-02-22T21:23:40Z</updated>
<author>
<name>Tim Culverhouse</name>
<email>tim@timculverhouse.com</email>
</author>
<published>2024-02-22T21:08:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=749d36d32127ba146d42d8b13aa628432bc295ea'/>
<id>urn:sha1:749d36d32127ba146d42d8b13aa628432bc295ea</id>
<content type='text'>
When kitty keyboard is enabled, pressing a modifier key will clear the
text selection. This makes it difficult to copy text because the
selection clears as soon as the user presses "ctrl".

Tested-by: Robin Jarry &lt;robin@jarry.cc&gt;
Signed-off-by: Tim Culverhouse &lt;tim@timculverhouse.com&gt;
</content>
</entry>
<entry>
<title>input: improved debug logging of key press/release</title>
<updated>2024-02-20T15:18:55Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-02-20T15:18:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=09d856f2ff1f0002457bde6f5f8a469aadb56b4e'/>
<id>urn:sha1:09d856f2ff1f0002457bde6f5f8a469aadb56b4e</id>
<content type='text'>
* Log which it is: press or release
* Include locked modifiers
* Include human-readable names of the modifiers
</content>
</entry>
<entry>
<title>input: remove debug logging</title>
<updated>2024-02-06T13:04:59Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-02-06T13:04:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ebbee61f144e5f3f662d8b2421ab7429145a6637'/>
<id>urn:sha1:ebbee61f144e5f3f662d8b2421ab7429145a6637</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Don't use fancy Unicode quotes, stick to ASCII</title>
<updated>2024-02-06T11:36:45Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-02-06T11:36:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=7999975016a57cc0a2c2e20bc55f29de32df7044'/>
<id>urn:sha1:7999975016a57cc0a2c2e20bc55f29de32df7044</id>
<content type='text'>
</content>
</entry>
<entry>
<title>config: add pipe-command-output key-binding</title>
<updated>2024-02-06T11:12:57Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-12-08T10:45:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1c70a84fde80405e0b6658722af8bc3fb54f225d'/>
<id>urn:sha1:1c70a84fde80405e0b6658722af8bc3fb54f225d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>term: move row-&gt;prompt_marker into new struct, row-&gt;shell_integration</title>
<updated>2024-02-06T11:12:56Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-12-08T09:35:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f8e875a7cddaac91818b98993d17a96d09a5b4a5'/>
<id>urn:sha1:f8e875a7cddaac91818b98993d17a96d09a5b4a5</id>
<content type='text'>
</content>
</entry>
<entry>
<title>input: remove the concept of "significant" modifiers</title>
<updated>2024-02-06T10:08:42Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2024-02-06T09:41:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=0aefc2c65de8cca39ddbf9d8c12f1a4d4206b42a'/>
<id>urn:sha1:0aefc2c65de8cca39ddbf9d8c12f1a4d4206b42a</id>
<content type='text'>
For the purpose of matching key bindings, "significant" modifiers are
no more.

We're really only interested in filtering out "locked"
modifiers. We're already doing this, so there's no need to *also*
match against a set of "significant" modifiers.

Furthermore, we *never* want to consider locked keys (e.g. when
emitting escapes to the client application), thus we can filter those
out already when retrieving the set of active modifiers.

The exception is the kitty keyboard protocol, which has support for
CapsLock and NumLock. Since we're already re-retrieving the "consumed"
modifiers (using the GTK style, rather than normal "XKB" style, to
better match the kitty terminal), we might as well re-retrieve the
effective modifiers as well.
</content>
</entry>
<entry>
<title>input/config: support *all* modifier names</title>
<updated>2024-02-06T10:05:20Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2023-05-06T09:39:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4730ff8d080e82fad0554dfcb957dfc82f6568b3'/>
<id>urn:sha1:4730ff8d080e82fad0554dfcb957dfc82f6568b3</id>
<content type='text'>
That is, allow custom modifiers (i.e. other than ctrl/shift/alt etc)
in key bindings.

This is done by no longer validating/translating modifier names to
booleans for a pre-configured set of modifiers (ctrl, shift, alt,
super).

Instead, we keep the modifier *names* in a list, in the key binding
struct.

When a keymap is loaded, and we "convert" the key binding, _then_ we
do modifier translation. For invalid modifier names, we print an
error, and then ignore it. I.e. we no longer fail to load a config due
to invalid modifier names.

We also need to update how we determine the set of significant
modifiers. Any modifier not in this list will be ignored when matching
key bindings.

Before this patch, we hardcoded this to shift/alt/ctrl/super. Now, to
handle custom modifiers as well, we simply treat *all* modifiers
defined by the current layout as significant.

Typically, the only unwanted modifiers are "locked" modifiers. We are
already filtering these out.
</content>
</entry>
</feed>
