ref: 9e0e429f73a9fe4373d64d4ece0394e62141f5ac
parent: 91797c0a23c0b410bb90093a0f23558fb859bd3d
author: qwx <qwx@sciops.net>
date: Thu Apr 10 02:47:29 EDT 2025
eui: fix /dev/kbd message parsing revealed by redefining default keybinds to something like hjkl. utfrune rescans the entire buffer including the message type character, when we just want to match the current rune from that same buffer against the key binds.
--- a/sys/src/games/eui.c
+++ b/sys/src/games/eui.c
@@ -151,10 +151,11 @@
warp10 = !warp10;
break;
}
- for(kp=kkn.n; kp!=nil; kp=kp->n){
- if(utfrune(buf, kp->r))
+ for(kp=kkn.n; kp!=nil; kp=kp->n)
+ if(kp->r == r){
k |= kp->k;
- }
+ break;
+ }
}
if((k & ax0) == ax0)
k &= ~ax0;
--
⑨