shithub: npe

Download patch

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

sdl2: use alt+f4 to send SDL_QUIT event

--- a/README.md
+++ b/README.md
@@ -25,4 +25,6 @@
 `threadmain`.  If that behaviour isn't desired, add
 `-D__plan9_keep_main__` to `CFLAGS`.
 
+With SDL applications Alt+F4 is used to send `SDL_QUIT` event.
+
 [General porting guide](http://docs.9front.org/porting).
--- a/libnpe_sdl2/sdl2.c
+++ b/libnpe_sdl2/sdl2.c
@@ -777,6 +777,9 @@
 				break;
 			e->type = SDL_TEXTINPUT;
 			e->text.text[runetochar(e->text.text, &rune)] = 0;
+		}else if((kmod & KMOD_LALT) != 0 && rune == (KF|4)){
+			e->type = SDL_QUIT;
+			return 1;
 		}else if(textinput && t == Rdown){
 			break;
 		}else{