shithub: drawterm

Download patch

ref: 7b58000c3d019d157fa5f1cc5621b0923e5b8539
parent: c6e961742048ed15b07d7a8aa78df590852cdc7f
author: Sigrid <ftrvxmtrx@gmail.com>
date: Wed Apr 14 14:46:13 EDT 2021

x11: reset Kshift state on focus change until we find a way to reset all modifier keys state

--- a/gui-x11/x11.c	Wed Dec 23 09:58:36 2020
+++ b/gui-x11/x11.c	Wed Apr 14 14:46:13 2021
@@ -768,6 +768,7 @@
 xkeyboard(XEvent *e)
 {
 	static int altdown;
+	static int shiftdown;
 	KeySym k;
 
 	switch(e->xany.type){
@@ -782,6 +783,10 @@
 			kbdkey(Kalt, 1);
 			kbdkey(Kalt, 0);
 		}
+		if(shiftdown){
+			shiftdown = 0;
+			kbdkey(Kshift, 0);
+		}
 		/* wet floor */
 	default:
 		return;
@@ -922,6 +927,7 @@
 	if(k == NoSymbol)
 		return;
 	altdown = e->xany.type == KeyPress && k == Kalt;
+	shiftdown = e->xany.type == KeyPress && k == Kshift;
 	kbdkey(k, e->xany.type == KeyPress);
 }