shithub: patch

Download patch

ref: 15da5161aa7a11eaf0a0e6ea21297019bf807e2a
parent: e8db11ffda62be8c165341ffd91e94b68b1ac051
author: qwx <qwx@sciops.net>
date: Sun Sep 17 09:03:25 EDT 2023

npe-modhacks: slight update (still wip)

--- a/npe-modhacks
+++ b/npe-modhacks
@@ -1,4 +1,4 @@
-diff 7a8cd4cb0b312e13a88d4d3175a839a2536ee4e3 uncommitted
+diff b699be1156cb41be910dadb3c8a6df0bea12bf67 uncommitted
 --- a/include/npe/SDL2/SDL_keycode.h
 +++ b/include/npe/SDL2/SDL_keycode.h
 @@ -88,15 +88,18 @@
@@ -50,7 +50,7 @@
  	KMOD_CTRL = KMOD_LCTRL|KMOD_RCTRL,
 --- a/include/npe/SDL2/SDL_scancode.h
 +++ b/include/npe/SDL2/SDL_scancode.h
-@@ -110,6 +110,7 @@
+@@ -114,6 +114,7 @@
  	SDL_SCANCODE_MUTE = 0x7f,
  	SDL_SCANCODE_VOLUMEUP,
  	SDL_SCANCODE_VOLUMEDOWN,
@@ -60,7 +60,7 @@
  	SDL_SCANCODE_LSHIFT,
 --- a/libnpe_sdl2/events.c
 +++ b/libnpe_sdl2/events.c
-@@ -246,6 +246,12 @@
+@@ -268,6 +268,12 @@
  	if(r == Kalt) return SDL_SCANCODE_LALT;
  	if(r == Kmod4) return SDL_SCANCODE_LGUI;
  	if(r == Kaltgr) return SDL_SCANCODE_RALT;
@@ -73,16 +73,24 @@
  
  	if(r >= (KF|1) && r <= (KF|12)) return SDL_SCANCODE_F1 + r - (KF|1);
  
-@@ -284,7 +290,7 @@
+@@ -323,7 +329,7 @@
  kbdproc(void *)
  {
  	char buf[128], buf2[128], *s;
 -	int kfd, n, kbin, t;
 +	int kfd, n, kbin, t, ign;
- 	Rune r, o;
+ 	Rune r, scan, o;
  
  	threadsetname("kbdproc");
-@@ -312,8 +318,12 @@
+@@ -335,6 +341,7 @@
+ 	buf2[1] = 0;
+ 	buf[0] = 0;
+ 	kmod = 0;
++	ign = 0;
+ 	for(;;){
+ 		if(buf[0] != 0){
+ 			n = strlen(buf)+1;
+@@ -351,8 +358,12 @@
  		switch(buf[0]){
  		case 'c':
  			if(chartorune(&r, buf+1) > 0 && r != Runeerror){
@@ -97,7 +105,7 @@
  				send(salt[Ckey].c, &o);
  				send(salt[Ckeytype].c, &t);
  				t = Rrepeat;
-@@ -332,8 +342,10 @@
+@@ -375,8 +386,10 @@
  						/* FIXME: does this work in both native AND drawterm? */
  						write(kbin, "\x46", 1);
  						kmod |= KMOD_LALT;
@@ -109,7 +117,7 @@
  					else if(r == Kctl)
  						kmod |= KMOD_LCTRL;
  					else if(r == Kaltgr)
-@@ -340,14 +352,21 @@
+@@ -383,14 +396,21 @@
  						kmod |= KMOD_RALT;
  					else if(r == Kmod4)
  						kmod |= KMOD_LGUI;
@@ -131,7 +139,7 @@
  				}
  			}
  			break;
-@@ -361,12 +380,23 @@
+@@ -408,12 +428,23 @@
  						kmod &= ~KMOD_LALT;
  					else if(r == Kshift)
  						kmod &= ~KMOD_LSHIFT;