shithub: front

Download patch

ref: b061a21bfae3da3fbca2eb85542d6ebca1719c67
parent: 09d69e04b92870e09de5df73fafb7c1d5bf99369
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Wed Aug 28 14:30:28 EDT 2024

kbdfs: consult also escaped scancode table when decoding runes (thanks aap)

When at the task of decomposing a rune into its
"button" and "rune", also consider the keyboard
map table with the escaped scancodes.

This fixes Shift + left/right combinations in
drawterm.

--- a/sys/src/cmd/aux/kbdfs/kbdfs.c
+++ b/sys/src/cmd/aux/kbdfs/kbdfs.c
@@ -552,9 +552,14 @@
 			if(kbtabs[Lnone][i] == k.r || kbtabs[Lshift][i] == k.r || (i >= 16 && kbtabs[Lctl][i] == k.r)){
 				/* assign button from kbtab */
 				k.b = kbtabs[Lnone][i];
+
 				/* handle ^X forms */
 				if(k.r == kbtabs[Lnone][i] && kbtabs[Lctl][i] && !a->shift && !a->altgr && a->ctl)
 					k.r = kbtabs[Lctl][i];
+				break;
+			} else if(kbtabs[Lesc1][i] == k.r || kbtabs[Lshiftesc1][i] == k.r){
+				/* check escaped scancodes too */
+				k.b = kbtabs[Lesc1][i];
 				break;
 			}
 		}
--