shithub: npe

Download patch

ref: 4434d2e57338d75f6eff1a66df77dd021691f854
parent: 989775c21c262c29a9a717f628f2cf8ea701806a
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Mon Jul 10 13:31:01 EDT 2023

sdl2: SDLK_RETURN has to be \r not \n, fix that

--- a/include/npe/SDL2/SDL_keycode.h
+++ b/include/npe/SDL2/SDL_keycode.h
@@ -44,7 +44,7 @@
 	SDLK_8,
 	SDLK_9,
 	SDLK_DELETE = Kdel,
-	SDLK_RETURN = '\n',
+	SDLK_RETURN = '\r',
 	SDLK_ESCAPE = Kesc,
 	SDLK_LESS = '<',
 	SDLK_SPACE = ' ',
--- a/libnpe_sdl2/events.c
+++ b/libnpe_sdl2/events.c
@@ -125,6 +125,8 @@
 			e->type = (t == Rup) ? SDL_KEYUP : SDL_KEYDOWN;
 			e->key.repeat = t == Rrepeat;
 			e->key.keysym.scancode = rune2scancode(rune);
+			if(rune == '\n')
+				rune = SDLK_RETURN;
 			e->key.keysym.sym = rune;
 			e->key.state = e->type;
 			return 1;