<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/input.c, branch 1.9.0</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.9.0</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.9.0'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2021-08-07T10:27:44Z</updated>
<entry>
<title>input: implement support for mouse wheel left/right</title>
<updated>2021-08-07T10:27:44Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-08-05T16:34:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c2cc964116f9fc6c6432c5c00b113c92bdfcdcd6'/>
<id>urn:sha1:c2cc964116f9fc6c6432c5c00b113c92bdfcdcd6</id>
<content type='text'>
We now emit button 6/7 events (when the client application grabs the
mouse). This buttons map to mouse wheel horizontal scroll events. Or, left/right
tilting, if you like.

Wayland report these as ‘axis’ events (just like regular scroll wheel events),
and thus we need to translate those scroll events to button events.

libinput does not define any mouse buttons for wheel tilts, so we add our own
defitions. These are added last in the BTN_* range, just before the BTN_JOYSTICK
events.
</content>
</entry>
<entry>
<title>input: codespell: follwing -&gt; following</title>
<updated>2021-08-06T21:08:09Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-08-06T21:08:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=460e3b5c579fa06d695f62c081cbb4c0491c5423'/>
<id>urn:sha1:460e3b5c579fa06d695f62c081cbb4c0491c5423</id>
<content type='text'>
</content>
</entry>
<entry>
<title>input: workaround GNOME messing up pointer leave/enter after moving window</title>
<updated>2021-08-06T20:35:29Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-08-04T15:27:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a21bf1b4d98c97fd8f408241fcbc35079e812c82'/>
<id>urn:sha1:a21bf1b4d98c97fd8f408241fcbc35079e812c82</id>
<content type='text'>
GNOME doesn’t send pointer enter after finishing a window move.

In subsequent move operations, it is also possible to make it skip sending
pointer leave when starting the move operations.

This caused foot to assert in debug builds, and add the same button multiple
times to the list of buttons currently being pressed.
</content>
</entry>
<entry>
<title>term: consolidate shutdown related state into an anonymous struct</title>
<updated>2021-07-31T17:08:51Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-07-31T17:08:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=03f952cf4dcf45d909ce209838a3beb4304358e5'/>
<id>urn:sha1:03f952cf4dcf45d909ce209838a3beb4304358e5</id>
<content type='text'>
</content>
</entry>
<entry>
<title>config: remove replaced/removed key bindings, instead of marking as ‘unused’</title>
<updated>2021-06-30T16:05:07Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-06-29T16:08:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=149c52bd4496eb4dd13eaa53bec690c60499502a'/>
<id>urn:sha1:149c52bd4496eb4dd13eaa53bec690c60499502a</id>
<content type='text'>
Instead of keeping removed/replaced key bindings in the key binding
array (marked as ‘unused’), remove them, by compacting the array.

The invariant is thus that there should be *no* entries in the key
binding list with the `BIND_ACTION_NONE` for action.

Add code to debug builds that verifies this, plus a unit test.

Closes #614
</content>
</entry>
<entry>
<title>input: ignore ‘unused’ URL key bindings when mapping bindings to current keymap</title>
<updated>2021-06-28T20:34:52Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-06-28T20:34:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a09f92817541c5935fda51f11004b7baae06f2ca'/>
<id>urn:sha1:a09f92817541c5935fda51f11004b7baae06f2ca</id>
<content type='text'>
This is a temporary fix for #614. Long term fix is to remove the
‘replaced’ bindings from the array at config time.
</content>
</entry>
<entry>
<title>config: add new function config_clone()</title>
<updated>2021-06-23T08:39:14Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-06-18T14:18:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f7860aec7610be897155046bd730ad0b406bd56c'/>
<id>urn:sha1:f7860aec7610be897155046bd730ad0b406bd56c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>config: don’t use tllist where it isn’t necessary</title>
<updated>2021-06-18T13:35:57Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-06-17T16:15:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=495c7304878bdd010dc5d25620dc68f41ac4cd36'/>
<id>urn:sha1:495c7304878bdd010dc5d25620dc68f41ac4cd36</id>
<content type='text'>
tllists are great when dealing with dynamically changing lists. They
are also very easy to use when building lists/arrays where the final
size is unknown.

However, this ease of use comes at a price: code size. tll-macros
expand to a lot of code.

Since things in the config are static, once the config has been
loaded, using tllists for configuration data structures doesn’t make
much sense.

This patch replaces nearly all tllists used by the configuration, with
dynamically allocated arrays.
</content>
</entry>
<entry>
<title>input: pass through scrollback-* key bindings when alt screen is activw</title>
<updated>2021-06-04T21:25:45Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-06-04T21:25:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a7e2e4bfa92ab26fab129f0945ef71875c2a1213'/>
<id>urn:sha1:a7e2e4bfa92ab26fab129f0945ef71875c2a1213</id>
<content type='text'>
Since the alt screen have no scrollback, all scrollback-* actions are
effectively no-ops when the alt screen is active.

Make them available to the client application instead.

Closes #573
</content>
</entry>
<entry>
<title>macros: add UNITTEST macro and use to replace test_keymap_lookup()</title>
<updated>2021-05-26T07:13:58Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2021-05-25T17:38:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=3d9302b6f95e3bb0f00695faf8c575440c685840'/>
<id>urn:sha1:3d9302b6f95e3bb0f00695faf8c575440c685840</id>
<content type='text'>
</content>
</entry>
<entry>
<title>input: regression test for escape sequence generated for ctrl+shift+tab</title>
<updated>2021-05-26T07:13:58Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-05-25T15:57:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=360946917cec381860cdc459e1aa4587bd4a4fb8'/>
<id>urn:sha1:360946917cec381860cdc459e1aa4587bd4a4fb8</id>
<content type='text'>
</content>
</entry>
<entry>
<title>input: keymap_lookup: remove unused argument ‘seat’</title>
<updated>2021-05-26T07:13:58Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-05-25T15:57:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=51f7599e9127069750bd540f05f160ea1bf50f1c'/>
<id>urn:sha1:51f7599e9127069750bd540f05f160ea1bf50f1c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>revert: input: do not include consumed modifiers in the set sent to the client</title>
<updated>2021-03-29T18:11:32Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-03-29T18:11:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=058eba33ec1008cc301b1979b6dd59c7a81c2e7d'/>
<id>urn:sha1:058eba33ec1008cc301b1979b6dd59c7a81c2e7d</id>
<content type='text'>
There were two issues with it:

* Not all applications decode the sequence into a set of modifiers +
  key, but use a fixed sequence -&gt; combo mapping, that we broke.

* There were unforeseen issues with e.g. F1-12, where the modifier
  were removed from combos like Ctrl+F12, or Alt+F12. The reason is
  simple; XKB tells us that Ctrl, or Alt, is a consumed modifier. Now,
  _why_ it thinks that is a different story.

This reverts 6cd72bdee6c2b11f7cab15df9afb0ed92a7f8ba0

Closes #425
</content>
</entry>
<entry>
<title>input: must have all required modifiers to un-shift a symbol</title>
<updated>2021-03-21T15:22:08Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-03-21T10:55:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=0c85905972fdc739fb140e32c3389c08e769bfff'/>
<id>urn:sha1:0c85905972fdc739fb140e32c3389c08e769bfff</id>
<content type='text'>
When detecting, and repairing, “broken” key bindings (where the key
binding itself explicitly lists a modifier that is consumed by the
final symbol - e.g “Shift+W”), don’t just look for an intersection
between the set of modifiers needed to produce the final symbol, and
the modifiers listed in the key combo. Instead, check if the key combo
has *all* the required modifiers.

Example: Shift+AltGr+w produces Page_Down. I.e. Page_Down is the
_shifted_ symbol, ‘w’ is the un-shifted symbol, and Shift+AltGr are
the modifiers required to shift ‘w’ to Page_Down.

If we have the key combo Shift+Page_Down, foot would, correctly,
determine that Page_Down is a shifted symbol. It would find the
Shift+AltGr modifier set, and since the intersection of “Shift+AltGr”
and “Shift” (from our key combo) is non-empty, foot
would (incorrectly) determine that we can, and should, replace
Page_Down with its un-shifted symbol ‘w’.

This is completely wrong, since Shift+w does _not_ produce Page_Down.

Closes #407
</content>
</entry>
<entry>
<title>keymap: handle shift+tab combos correctly, after consuming modifiers</title>
<updated>2021-03-08T19:30:25Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-02-28T10:50:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e4f164d9585d4e84de15061de6430d5c1c1a12ed'/>
<id>urn:sha1:e4f164d9585d4e84de15061de6430d5c1c1a12ed</id>
<content type='text'>
Shift+Tab is an odd bird in XKB; it produces a shifted variant of tab,
ISO_Left_Tab, with Shift being a consumed modifier.

From a terminal perspective, Tab and ISO_Left_Tab are the same key,
with Shift+Tab generating ‘CSI Z’, and all other combos generating a
‘CSI 27;mods;9~’ escape.

Before, when we didn’t filter out consumed modifiers, we could simply
re-use the keymap for Tab when translating ISO_Left_Tab.

This is no longer possible, since shift has been filtered out. As a
result, Shift+Tab no longer generated ‘CSI Z’, but ‘\t’. I.e as if
shift wasn’t being pressed.

This patch adds a separate keymap table for ISO_Left_Tab. It’s MOD_ANY
entry corresponds to Shift+Tab, and emits ‘CSI Z’. All its other
entries *exclude* shift (since it has been consumed), *but*, the
encoded modifier (in the escape sequences) *include* shift.
</content>
</entry>
<entry>
<title>input: do not include consumed modifiers in the set sent to the client</title>
<updated>2021-03-08T19:30:23Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-02-26T19:54:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=6cd72bdee6c2b11f7cab15df9afb0ed92a7f8ba0'/>
<id>urn:sha1:6cd72bdee6c2b11f7cab15df9afb0ed92a7f8ba0</id>
<content type='text'>
When sending a key escape sequence to the client application, do not
include consumed modifiers.

Fixes part of #376
</content>
</entry>
<entry>
<title>input: repair key combos containing both explicit modifier and shifted symbol</title>
<updated>2021-03-04T08:43:44Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-03-02T16:50:06Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a5b554761a8b376657be2a7e613b37fd5803920c'/>
<id>urn:sha1:a5b554761a8b376657be2a7e613b37fd5803920c</id>
<content type='text'>
If a user-provided key combo contains both an explicit modifier, and
the shifted symbol it produces, replace the symbol with its un-shifted
version.

Example: Control+Shift+U contains both ‘Shift’, and ‘U’, where ‘Shift’
is the modifier that shifts ‘u’ to ‘U’.

Such modifiers are “consumed”, i.e. filtered out, when matching key
combos. As such, Control+Shift+U will never trigger since we’ll never
be able to match the consumed modifier ‘Shift’.

The above combo can be written in two ways:

- Control+U
- Control+Shift+u

To be able to detect that Control+Shift+U is an invalid combination,
we need to check all *shifted* symbols for all key *codes*.

Once we’ve detected a shifted symbol (and where it differs from the
un-shifted symbol), we loop all modifier sets that produce the shift
level where our shifted symbol is. For each such set, check if it
intersects with the user-provided key combo’s modifier set.

If there is an intersection, it means the user provided a key combo
containing a modifier and symbol, such that the modifier is consumed
when the symbol is produced.

In this case, we replace the symbol with its un-shifted version.
</content>
</entry>
<entry>
<title>input: rewrite of how we match foot’s own key bindings</title>
<updated>2021-03-04T08:43:43Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-02-27T19:42:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=5e64e06a550c2499a23f03749986791136cbbcb9'/>
<id>urn:sha1:5e64e06a550c2499a23f03749986791136cbbcb9</id>
<content type='text'>
Bindings are matched in one out of three ways:

* By translated (by XKB) symbols
* By untranslated symbols
* By raw key codes

A translated symbol is affected by pressed modifiers, some of which
can be “consumed”. Consumed modifiers to not partake in the comparison
with the binding’s modifiers. In this mode, ctrl+shift+2 maps to
ctrl+@ on a US layout.

Untranslated symbols, or un-shifted symbols refer to the “base” symbol
of the pressed key, i.e. it’s unaffected by modifiers. In this mode,
consumed modifiers *do* partake in the comparison with the binding’s
modifiers, and ctrl+shift+2 maps to ctrl+shift+2 on a US layout.

More examples: ctrl+shift+u maps to ctrl+U in the translated lookup,
while ctrl+shift+u maps to ctrl+shift+u in the untranslated lookup.

Finally, we also match raw key codes. This allows our bindings to work
using the same physical keys when the user switches between latin and
non-latin layouts.

This means key bindings in foot.ini *must* not include both +shift+
and a *shifted* key. I.e. ctrl+shift+U is not a valid combo as it
cannot be triggered. Unfortunately, this was how you were supposed to
write bindings up until now... so, we try to detect such bindings, log
a deprecation warning and then “fix” the binding for the user.

When specifying bindings in foot.ini, both ctrl+U and ctrl+shift+u are
valid, and will work. The latter is preferred though, since we cannot
detect the raw key code for the former variant. Personally, I also
prefer the latter one because it is more explicit; it’s more obvious
which keys are involved.

However, in some cases it makes more sense to use the other
variant. Typically for non-letter combos.
</content>
</entry>
<entry>
<title>input: ask XKB for consumed modifiers, but don’t actually use them just yet</title>
<updated>2021-03-04T08:42:36Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-03-04T08:42:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=decc655d48fec56c09c3b0b904d821a4ff765de8'/>
<id>urn:sha1:decc655d48fec56c09c3b0b904d821a4ff765de8</id>
<content type='text'>
</content>
</entry>
<entry>
<title>input: mutter has been seen sending NULL surfaces in pointer enter</title>
<updated>2021-03-04T07:57:31Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-03-04T07:57:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e9d8ade5cc1b00f8790096138413694cad13c11e'/>
<id>urn:sha1:e9d8ade5cc1b00f8790096138413694cad13c11e</id>
<content type='text'>
</content>
</entry>
</feed>
