~eliasnaur/gio-patches

app/internal/window: (X11) report key.Event with ctrl + non-alphanum v1 PROPOSED

aarzilli
aarzilli: 1
 app/internal/window: (X11) report key.Event with ctrl + non-alphanum

 1 files changed, 3 insertions(+), 0 deletions(-)
aarzilli
Indeed, this is no longer necessary.

On Sun, Nov 24, 2019 at 08:01:19PM +0100, Elias Naur wrote:
> Thanks. Prompted by Larry'c macOS change I changed the X11 backend to use the
> common xkb package that the Wayland backend uses. Your patch is therefore at
> minimum not relevant, hopefully unnecessary. I cheched that ctrl+non-alphanum
> keystrokes work as expected.
> 
> -- elias
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~eliasnaur/gio-patches/patches/9106/mbox | git am -3
Learn more about email & git

[PATCH] app/internal/window: (X11) report key.Event with ctrl + non-alphanum Export this patch

aarzilli
Send key.Event events when the CTRL modifier is pressed together with a
non-alphanumeric key.
---
 app/internal/window/os_x11.go | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/app/internal/window/os_x11.go b/app/internal/window/os_x11.go
index d4d6987..afba9e0 100644
--- a/app/internal/window/os_x11.go
+++ b/app/internal/window/os_x11.go
@@ -273,6 +273,9 @@ func (h *x11EventHandler) handleEvents() bool {
 				}
 				// Do not send EditEvent for CTRL key combinations.
 				if mods.Contain(key.ModCtrl) {
+					if r, _ := utf8.DecodeRune(h.text[:l]); r != utf8.RuneError {
+						w.w.Event(key.Event{Name: string(r), Modifiers: mods})
+					}
 					break
 				}
 				// Report only printable runes.
-- 
2.17.1
Thanks. Prompted by Larry'c macOS change I changed the X11 backend to use the
common xkb package that the Wayland backend uses. Your patch is therefore at
minimum not relevant, hopefully unnecessary. I cheched that ctrl+non-alphanum
keystrokes work as expected.

-- elias
View this thread in the archives