shithub: alienpatch

Download patch

ref: d97ca4d3ccc82d2193dd70bc715c03b6703e0ff1
parent: 479e7f58195320ba9695279fa7e9e57028b60759
author: qwx <qwx@sciops.net>
date: Sat Oct 8 05:46:25 EDT 2022

npe: oops, adding modifiers this way breaks ft2; enough to just have the keys

--- a/npe-modhacks
+++ b/npe-modhacks
@@ -1,7 +1,7 @@
 diff c653369e862d2b2235133cfcb0391bc4809ce4b1 uncommitted
 --- a/include/npe/SDL2/SDL_keycode.h
 +++ b/include/npe/SDL2/SDL_keycode.h
-@@ -81,21 +81,21 @@
+@@ -81,13 +81,13 @@
  	SDLK_RALT = Kaltgr, /* FIXME what about keyboards without it? */
  	/* FIXME no distinction */
  	SDLK_LSHIFT = Kshift,
@@ -18,16 +18,6 @@
  	SDLK_KP_ENTER,
  	SDLK_AC_BACK,
  
- 	/* FIXME no distinction */
- 	KMOD_LSHIFT = 1<<0,
--	KMOD_RSHIFT = KMOD_LSHIFT,
-+	KMOD_RSHIFT = 1<<7,
- 	KMOD_LCTRL = 1<<1,
--	KMOD_RCTRL = KMOD_LCTRL,
-+	KMOD_RCTRL = 1<<6,
- 	KMOD_LALT = 1<<2,
- 	KMOD_RALT = 1<<3,
- 	KMOD_LGUI = 1<<4,
 --- a/libnpe_sdl2/events.c
 +++ b/libnpe_sdl2/events.c
 @@ -206,6 +206,9 @@
@@ -49,27 +39,12 @@
  					else if(r == Kctl)
  						kmod |= KMOD_LCTRL;
  					else if(r == Kaltgr)
-@@ -300,6 +305,10 @@
- 						kmod |= KMOD_RALT;
- 					else if(r == Kmod4)
- 						kmod |= KMOD_LGUI;
-+					else if(r == Spec|0x6a)
-+						kmod |= KMOD_RCTRL;
-+					else if (r == Spec|0x69)
-+						kmod |= KMOD_RSHIFT;
- 					else{
- 						o = npe_sdl.textinput ? r : tolowerrune(r);
- 						continue;
-@@ -323,6 +332,12 @@
+@@ -323,6 +328,8 @@
  						kmod &= ~KMOD_LSHIFT;
  					else if(r == Kctl)
  						kmod &= ~KMOD_LCTRL;
 +					else if (r == Kcaps)
 +						kmod &= ~KMOD_CAPS;
-+					else if(r == Spec|0x6a)
-+						kmod &= ~KMOD_RCTRL;
-+					else if (r == Spec|0x69)
-+						kmod &= ~KMOD_RSHIFT;
  					else{
  						t = Rup;
  						send(salt[Ckey].c, &r);