<feed xmlns='http://www.w3.org/2005/Atom'>
<title>mirrors/foot.git/input.c, branch releases/1.11</title>
<subtitle>A fast, lightweight and minimalistic Wayland terminal emulator</subtitle>
<id>https://git.0x0f.dev/mirrors/foot.git/atom?h=releases%2F1.11</id>
<link rel='self' href='https://git.0x0f.dev/mirrors/foot.git/atom?h=releases%2F1.11'/>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/'/>
<updated>2022-02-05T16:00:54Z</updated>
<entry>
<title>fcft: adapt to API changes in fcft-3.x</title>
<updated>2022-02-05T16:00:54Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-08-21T12:50:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e0227266cabc015c282774ac898e3f52dce943df'/>
<id>urn:sha1:e0227266cabc015c282774ac898e3f52dce943df</id>
<content type='text'>
Fcft no longer uses wchar_t, but plain uint32_t to represent
codepoints.

Since we do a fair amount of string operations in foot, it still makes
sense to use something that actually _is_ a string (or character),
rather than an array of uint32_t.

For this reason, we switch out all wchar_t usage in foot to
char32_t. We also verify, at compile-time, that char32_t used
UTF-32 (which is what fcft expects).

Unfortunately, there are no string functions for char32_t. To avoid
having to re-implement all wcs*() functions, we add a small wrapper
layer of c32*() functions.

These wrapper functions take char32_t arguments, but then simply call
the corresponding wcs*() function.

For this to work, wcs*() must _also_ be UTF-32 compatible. We can
check for the presence of the  __STDC_ISO_10646__ macro. If set,
wchar_t is at least 4 bytes and its internal representation is UTF-32.

FreeBSD does *not* define this macro, because its internal wchar_t
representation depends on the current locale. It _does_ use UTF-32
_if_ the current locale is UTF-8.

Since foot enforces UTF-8, we simply need to check if __FreeBSD__ is
defined.

Other fcft API changes:

* fcft_glyph_rasterize() -&gt; fcft_codepoint_rasterize()
* font.space_advance has been removed
* ‘tags’ have been removed from fcft_grapheme_rasterize()
* ‘fcft_log_init()’ removed
* ‘fcft_init()’ and ‘fcft_fini()’ must be explicitly called
</content>
</entry>
<entry>
<title>replace gettimeofday with clock_gettime</title>
<updated>2022-01-15T16:05:45Z</updated>
<author>
<name>Pranjal Kole</name>
<email>pranjal.kole7@gmail.com</email>
</author>
<published>2022-01-15T09:26:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=0da19a81bc9a94f83bfcf8c5af0e3571f751cf38'/>
<id>urn:sha1:0da19a81bc9a94f83bfcf8c5af0e3571f751cf38</id>
<content type='text'>
POSIX.1-2008 has marked gettimeofday(2) as obsolete, recommending the
use of clock_gettime(2) instead.

CLOCK_MONOTONIC has been used instead of CLOCK_REALTIME because it is
unaffected by manual changes in the system clock. This makes it better
for our purposes, namely, measuring the difference between two points in
time.

tv_sec has been casted to long in most places since POSIX does not
define the actual type of time_t.
</content>
</entry>
<entry>
<title>input: reset mouse button click counter when mouse moves</title>
<updated>2022-01-13T10:22:01Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-01-12T14:38:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e853c7139e83f6ad6222abe232238f861d96e436'/>
<id>urn:sha1:e853c7139e83f6ad6222abe232238f861d96e436</id>
<content type='text'>
As described in #883, creating a block selection (with ctrl+BTN_LEFT),
then *quickly* (within 300ms from) creating a new one, will, in fact,
_not_ create a new block selection, but a ‘select-word-whitespace’
selection (ctrl+BTN_LEFT-2).

A similar effect can be seen with plain selections (BTN_LEFT). Click
and drag to make a selection, but *release*, and make a new selection
within 300ms from the initial button press, and the new selection is
suddenly a word-based selection.

This happens because triggering a binding does *not* reset the button
click counter.

So, shouldn’t we just do that?

No, because we rely on this behavior to handle single-, double- and
triple-click actions. If we were to reset the button click handler,
then we’d have to instead delay triggering the first action with
300ms, which would make things appear laggy. If we don’t do this, it
would be impossible to double- and triple-click, since the
single-click action would keep resetting the click counter.

This patch takes a slightly different approach; we reset the click
counter when the mouse has moved “too much”. For now, “too much” is
when the cursor has moved to a different cell.

This way, single-, double- and triple-clicks continue to work as
before. But, creating actual selections, and then quickly releasing
and starting a new selection produces the expected results.

Closes #883
</content>
</entry>
<entry>
<title>input: reset view when pasting from primary</title>
<updated>2022-01-11T19:26:49Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2022-01-11T19:26:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=29c31054a1a4dc2b51a486829830b47ef5e8d772'/>
<id>urn:sha1:29c31054a1a4dc2b51a486829830b47ef5e8d772</id>
<content type='text'>
We’re already doing this for keyboard input, and regular clipboard
pastes.
</content>
</entry>
<entry>
<title>SGR-Pixels mouse mode, closes #762</title>
<updated>2022-01-01T10:02:30Z</updated>
<author>
<name>Autumn Lamonte</name>
<email>AutumnWalksTheLake@gmail.com</email>
</author>
<published>2021-12-30T11:13:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=d72ba4a062b52a8efed09c0160a985345b9f722f'/>
<id>urn:sha1:d72ba4a062b52a8efed09c0160a985345b9f722f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>input: apply scrollback.multplier in alterate scroll mode</title>
<updated>2021-12-28T16:10:03Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-12-24T14:22:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c9086e6d4f6ef25196843dcc9ee80906dd7d1534'/>
<id>urn:sha1:c9086e6d4f6ef25196843dcc9ee80906dd7d1534</id>
<content type='text'>
Before this patch, foot only applied [scrollback].multiplier on the
normal screen, never the alt screen.

However, scrolling can be done in two ways on the alt screen:

If the application has enabled mouse support, we simply pass on the
mouse scroll events to the application. Here, it makes sense to not
apply the multiplier, and instead let the application choose how much
to scroll for each scroll event.

But, if the application has not enabled mouse support, we can still
scroll by simulating the arrow keys being pressed - alternate
scrolling (private mode 1007).

This is enabled by default in foot (but can be disabled in foot.ini
with the [mouse].alternate-scroll-mode setting).

In this mode, it makes more sense to apply the multiplier. And that’s
what this patch changes - the multiplier is now applied, on the alt
screen, when the application has not enabled mouse support, and
alternate scrolling has been enabled in foot.

Closes #859
</content>
</entry>
<entry>
<title>input: kitty: don’t fallback to the XKB symbol</title>
<updated>2021-12-16T11:49:41Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-12-16T11:37:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4c5f53878e6b7adcf34b2e634c60d58a75e9e238'/>
<id>urn:sha1:4c5f53878e6b7adcf34b2e634c60d58a75e9e238</id>
<content type='text'>
When handling “generic” keys (i.e. keys not in the Kitty keymap), we
use the pressed key’s Unicode codepoint as “key” in the kitty CSI.

If we failed to convert the XKB symbol to a Unicode codepoint, we used
to (before this patch), fallback to using the XKB symbol as is.

This can never be correct... and it caused us to emit a meaningless
CSI for XKB_KEY_ISO_Next_Group, which confused e.g. Kakoune.
</content>
</entry>
<entry>
<title>input: kitty: return the result of term_to_slave()</title>
<updated>2021-12-12T14:08:46Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-12-12T14:08:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=fe851a6936e330d5a5d10f718e9049a723757e55'/>
<id>urn:sha1:fe851a6936e330d5a5d10f718e9049a723757e55</id>
<content type='text'>
If term_to_slave() fails, then the key wasn’t ‘handled’...
</content>
</entry>
<entry>
<title>kitty: replace switch with a static keysym table</title>
<updated>2021-12-11T20:04:58Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-12-11T13:51:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=53fc9ca3b264353ae3d03ad823a993e4e9b6e67f'/>
<id>urn:sha1:53fc9ca3b264353ae3d03ad823a993e4e9b6e67f</id>
<content type='text'>
</content>
</entry>
<entry>
<title>config: unify key- and mouse bindings</title>
<updated>2021-12-11T19:19:11Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-12-06T20:04:38Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=f6a591b80a820ae5ab6886eb9ba43c90986f302b'/>
<id>urn:sha1:f6a591b80a820ae5ab6886eb9ba43c90986f302b</id>
<content type='text'>
With this patch, key- and mouse-bindings structs (the non-layout
specific ones) are unified into a single struct.

The logic that parses, and manages, the key- and mouse binding lists
are almost identical. The *only* difference between a key- and a mouse
binding is that key bindings have an XKB symbol, and mouse bindings a
button and click-count.

The new, unified, struct uses a union around these, and all functions
that need to know which members to use/operate on now takes a ‘type’
parameter.
</content>
</entry>
<entry>
<title>config: do mouse binding collision detection after loading the conf</title>
<updated>2021-12-11T19:19:11Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-12-05T15:30:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=4c50c44cf768238486f80fc5daa70d47688902a1'/>
<id>urn:sha1:4c50c44cf768238486f80fc5daa70d47688902a1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>kitty: simplify: always calculate alternate/base keys</title>
<updated>2021-12-08T16:54:37Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-12-07T21:22:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=34ce9f97bbe1502bdd24650a36b0e3da06cef77a'/>
<id>urn:sha1:34ce9f97bbe1502bdd24650a36b0e3da06cef77a</id>
<content type='text'>
But only _emit_ them if report alternate has been enabled.
</content>
</entry>
<entry>
<title>kitty: when emitting associated text, don’t report mods/events unless necessary</title>
<updated>2021-12-08T16:54:37Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-12-07T20:52:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=52eee4482bf823455acd61617eba3a74702763d2'/>
<id>urn:sha1:52eee4482bf823455acd61617eba3a74702763d2</id>
<content type='text'>
</content>
</entry>
<entry>
<title>kitty: report-alternate: apply base-layout key to composed characters</title>
<updated>2021-12-08T16:54:37Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-12-07T20:48:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=c0cfec89e0093c10253416e26efdcb8e38f7fd95'/>
<id>urn:sha1:c0cfec89e0093c10253416e26efdcb8e38f7fd95</id>
<content type='text'>
</content>
</entry>
<entry>
<title>kitty: implement “base layout key” in “report alternate key”</title>
<updated>2021-12-08T16:54:37Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-12-07T19:25:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=9b57ef07f14a66727223d4ab5457ebff57448b96'/>
<id>urn:sha1:9b57ef07f14a66727223d4ab5457ebff57448b96</id>
<content type='text'>
</content>
</entry>
<entry>
<title>kitty: initial support for “report alternate key”</title>
<updated>2021-12-08T16:54:37Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-12-07T18:55:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=9d5ab91b6af513efaeb08e9bf747897641f2a809'/>
<id>urn:sha1:9d5ab91b6af513efaeb08e9bf747897641f2a809</id>
<content type='text'>
In this mode, the “shifted” and “base layout” keys are added to the
CSIs, as sub-parameters to the “key” parameter.

Note that this PR only implements the “shifted” key, not the “base
layout key”.

This is done by converting the original XKB symbol to it’s
corresponding UTF-32 codepoint. If this codepoint is different from
the one we use as “key” in the CSI, we add it as a sub-parameter.

Related to #319
</content>
</entry>
<entry>
<title>kitty: only emit plain text on key press- and repeat events</title>
<updated>2021-12-08T16:53:01Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-12-07T19:26:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=21fe01099cb2ff84b1530574a228aebd614668bb'/>
<id>urn:sha1:21fe01099cb2ff84b1530574a228aebd614668bb</id>
<content type='text'>
That is, release events always generate CSIs
</content>
</entry>
<entry>
<title>kitty: add ISO_Level{3,5}_Shift keys</title>
<updated>2021-12-08T16:53:00Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-12-07T18:11:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=e9a762f8a12904a001cd936cb8337b1115a3c904'/>
<id>urn:sha1:e9a762f8a12904a001cd936cb8337b1115a3c904</id>
<content type='text'>
</content>
</entry>
<entry>
<title>kitty: composed characters with “report associated text”</title>
<updated>2021-12-08T16:53:00Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-12-07T06:31:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=69f97446faf338c792beb3a548591707f2205c32'/>
<id>urn:sha1:69f97446faf338c792beb3a548591707f2205c32</id>
<content type='text'>
The generic input handler now converts the composed character to it’s
UTF-32 equivalent. This means we now provide a valid UTF-32 codepoint
for both composed characters, and non-composed (plain-text)
characters.

Use this in the kitty protocol to simplify the logic around composed
characters, by simply treating them as plain text.
</content>
</entry>
<entry>
<title>kitty: implement “report associated text”</title>
<updated>2021-12-08T16:53:00Z</updated>
<author>
<name>Daniel Eklöf</name>
<email>daniel@ekloef.se</email>
</author>
<published>2021-12-06T22:01:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0x0f.dev/mirrors/foot.git/commit/?id=78666d248a6b5a40effd2a30cb9483cd8141bb1e'/>
<id>urn:sha1:78666d248a6b5a40effd2a30cb9483cd8141bb1e</id>
<content type='text'>
In this mode, key events that generate text now add a third CSI
parameter, indicating the actual codepoint.

Remember that we always use the *unshifted* key in the CSI
escapes. With this mode, those CSI escapes now also included the text
codepoint. I.e. what would have been emitted, had we not generated a
CSI escape.

As far as I can tell, this mode has no effect unless “report all keys
as escape sequences” is enabled (reason being, without that, there
aren’t any text events that generate CSIs - they’re always emitted
as-is).

Note that Kitty itself seems to be somewhat buggy in this mode. At
least on Wayland, with my Swedish layout. For example ‘a’ and ‘A’ does
generate the expected CSIs, but ‘å’ and ‘Å’ appears to be treated as
non-text input.

Furthermore, Kitty optimizes away the modifier parameter, if no
modifiers are pressed (e.g. CSI 97;;97u), while we always emit the
modifier (CSI 97;1;97u).

Related to #319
</content>
</entry>
</feed>
