git: 9front

Download patch

ref: 3fa478546b319364684904572b6c34f1f2346f9c
parent: 6dba1ef01456e76c3e3ec0d90b805c813f63c9c3
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;
 			}
 		}
--