shithub: npe

Download patch

ref: bad6c95d9981311615a5ebf8609fd28268ca9114
parent: ac5e2726dfed47e8aec9ca165323c26bdbc9d926
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Tue Mar 16 10:20:55 EDT 2021

sdl2: allow Unicode (besides 9 priv space) as text input event, fix priv space keys when text input is enabled

--- a/libnpe_sdl2/sdl2.c
+++ b/libnpe_sdl2/sdl2.c
@@ -772,12 +772,12 @@
 	switch(alt(salt)){
 	case Ckey:
 		recv(salt[Ckeytype].c, &t);
-		if(textinput && rune >= 0x20 && rune <= 0x7f){
+		if(textinput && rune >= 0x20 && (rune < KF || rune >= KF+0x1000)){
 			if(t != Rrepeat)
 				break;
 			e->type = SDL_TEXTINPUT;
 			e->text.text[runetochar(e->text.text, &rune)] = 0;
-		}else if(textinput && t != Rrepeat){
+		}else if(textinput && t == Rdown){
 			break;
 		}else{
 			e->type = (t == Rup) ? SDL_KEYUP : SDL_KEYDOWN;