<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/input.c, branch 1.7.1</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=1.7.1</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=1.7.1'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2021-03-21T15:22:08Z</updated>
<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>
<entry>
<title>input: exit URLs mode on mouse button events</title>
<updated>2021-03-04T07:57:03Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-03-04T07:57:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=81b5d476a96e83464971f6f17cc8770079550de1'/>
<id>urn:sha1:81b5d476a96e83464971f6f17cc8770079550de1</id>
<content type='text'>
This makes URLs mode behave like scrollback search mode.
</content>
</entry>
<entry>
<title>url-mode: use ‘jump-label-letters’ as the alphabet for key sequences</title>
<updated>2021-02-13T10:43:28Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-02-13T10:43:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c7006661f5edc55cf235a647da67e0e26e7fe594'/>
<id>urn:sha1:c7006661f5edc55cf235a647da67e0e26e7fe594</id>
<content type='text'>
Instead of hard coding the alphabet to “sadfjklewcmpgh”, use the
letters from ‘jump-label-letters’.

Closes #355
</content>
</entry>
<entry>
<title>Convert all but 2 remaining uses of xassert(false) to BUG("...")</title>
<updated>2021-02-10T09:01:51Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2021-02-10T09:01:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=3c86af52c2a3e9352a88e969392575e55c3b6f74'/>
<id>urn:sha1:3c86af52c2a3e9352a88e969392575e55c3b6f74</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Convert some more uses of xassert(false) to BUG("...")</title>
<updated>2021-02-09T15:16:19Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2021-02-09T15:16:19Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=2f81a1d07c3828391bf1b5656a9143aaf3822089'/>
<id>urn:sha1:2f81a1d07c3828391bf1b5656a9143aaf3822089</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Convert some uses of xassert(false) to BUG("some error message")</title>
<updated>2021-02-09T13:52:33Z</updated>
<author>
<name>Craig Barnes</name>
<email>craigbarnes@protonmail.com</email>
</author>
<published>2021-02-09T13:52:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=1ec56844387ed910b7e87bae186b58cc22cc317a'/>
<id>urn:sha1:1ec56844387ed910b7e87bae186b58cc22cc317a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>key-bindings: refactor: use a single type for all key bindings</title>
<updated>2021-02-08T09:09:14Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-02-07T13:46:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=03bac9dada76690971943f824637407100f7a3ee'/>
<id>urn:sha1:03bac9dada76690971943f824637407100f7a3ee</id>
<content type='text'>
Up until now, the various key binding modes (“normal”, “search” and
“url”) have used their own struct definitions for their key bindings.

The only reason for this was to have a properly typed “action” (using
the appropriate “action” enum).

This caused lots of duplicated code. This patch refactors this to use
a single struct definition for the “unparsed” key bindings handled by
the configuration, and another single definition for “parsed” bindings
used while handling input.

This allows us to implement configuration parsing, keymap translation
and so on using one set of functions, regardless of key binding mode.
</content>
</entry>
<entry>
<title>url-mode: urls_collect(): URL list pointer as an argument</title>
<updated>2021-02-07T15:33:34Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-02-06T19:01:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=a988138492ba39d507f644bbb0b6d452a864ca79'/>
<id>urn:sha1:a988138492ba39d507f644bbb0b6d452a864ca79</id>
<content type='text'>
</content>
</entry>
<entry>
<title>url-mode: underline URLs using the color from colors.urls</title>
<updated>2021-02-07T15:33:34Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-02-06T10:51:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=2c10a147ea0e471f12facfa11913272d42163f76'/>
<id>urn:sha1:2c10a147ea0e471f12facfa11913272d42163f76</id>
<content type='text'>
This is implemented by allocating one of the (few!) remaining bits in
the cells’ attribute struct to indicate the cell should be “URL
highlighted”.

render_cell() looks at this bit and draws an underline using the color
from colors.urls (defaults to regular3 - i.e. yellow).

A new function, url_tag_cells(), iterates the currently detected URLs
and sets the new ‘url’ attribute flag on the affected cells.

Note: this is done in a separate function to keep urls_collect() free
from as many dependencies as possible.

urls_reset() is updated to *clear* the ‘url’ flag (and thus implicitly
also results in a grid refresh, _if_ there were any URLs).

We now exit URL mode on *any* client application input. This needs to
be so since we can’t know if the URLs we previously detected are still
valid.
</content>
</entry>
<entry>
<title>input: mouse events on jump label surfaces do nothing</title>
<updated>2021-02-07T15:33:33Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-02-06T10:31:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d6ea2a4bdc30f033a72c1fc05172f414a0998248'/>
<id>urn:sha1:d6ea2a4bdc30f033a72c1fc05172f414a0998248</id>
<content type='text'>
</content>
</entry>
<entry>
<title>config: add show-urls-copy action</title>
<updated>2021-02-07T15:33:32Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-02-04T19:55:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=93181649b32249f572bc4c6892c99155186fc714'/>
<id>urn:sha1:93181649b32249f572bc4c6892c99155186fc714</id>
<content type='text'>
This works just like show-urls-launch, except that instead of opening
the URL (typically using xdg-open), it is placed in the clipboard when
activated.
</content>
</entry>
<entry>
<title>config: rename ‘show-urls’ to ‘show-urls-launch’</title>
<updated>2021-02-07T15:33:32Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-02-04T19:39:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=0a1c5e44c4459390e927440a59acafafc8372da5'/>
<id>urn:sha1:0a1c5e44c4459390e927440a59acafafc8372da5</id>
<content type='text'>
</content>
</entry>
<entry>
<title>urls: initial support for detecting URLs and rendering jump-labels</title>
<updated>2021-02-07T15:33:31Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-01-31T10:12:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=2cc84db97978388475504592c88911046bcd2eb6'/>
<id>urn:sha1:2cc84db97978388475504592c88911046bcd2eb6</id>
<content type='text'>
The jump labels work, but is currently hardcoded to use xdg-open
</content>
</entry>
<entry>
<title>config: add infrastructure to handle URL mode specific key bindings</title>
<updated>2021-02-07T15:33:31Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-01-30T11:43:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=ee39966dedf9e8fbee5528c324c807b92b9a6c23'/>
<id>urn:sha1:ee39966dedf9e8fbee5528c324c807b92b9a6c23</id>
<content type='text'>
* Add “show-urls” action to regular key bindings
* Add url-bindings section to foot.ini
* Add “cancel” action to URL mode key bindings
</content>
</entry>
</feed>
