~eliasnaur/gio-patches

gio: app/internal/xkb: fix events sent when modifier keys are pressed v1 PROPOSED

aarzilli
aarzilli: 1
 app/internal/xkb: fix events sent when modifier keys are pressed

 1 files changed, 4 insertions(+), 1 deletions(-)
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/12111/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH gio] app/internal/xkb: fix events sent when modifier keys are pressed Export this patch

aarzilli
When modifier keys are active DispatchKey should not send a
key.EditEvent for the key that was pressed. For example when pressing
Ctrl+Alt+e DispatchEvent should not generate a key.EditEvent{Text:"e"}.

Signed-off-by: aarzilli <alessandro.arzilli@gmail.com>
---
 app/internal/xkb/xkb_unix.go | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/app/internal/xkb/xkb_unix.go b/app/internal/xkb/xkb_unix.go
index 3525692..b4a9ff7 100644
--- a/app/internal/xkb/xkb_unix.go
+++ b/app/internal/xkb/xkb_unix.go
@@ -185,7 +185,10 @@ func (x *Context) DispatchKey(keyCode uint32) (events []event.Event) {
		C.xkb_compose_state_reset(x.compState)
		str = x.utf8Buf[:size]
	case C.XKB_COMPOSE_NOTHING:
		str = x.charsForKeycode(kc)
		mod := x.Modifiers()
		if mod&(key.ModCtrl|key.ModAlt|key.ModSuper) == 0 {
			str = x.charsForKeycode(kc)
		}
	}
	// Report only printable runes.
	var n int
-- 
2.17.1
Thanks!

To git.sr.ht:~eliasnaur/gio
   9543b5f..4821472  master -> master