File: 20_enter_keys.diff

package info (click to toggle)
freedroidrpg 0.16.1-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 260,872 kB
  • sloc: ansic: 63,910; sh: 4,588; makefile: 503; python: 178; xml: 54; sed: 16
file content (26 lines) | stat: -rw-r--r-- 631 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Author: Bart Martens
Description: Fixes enter key on some keyboards
Forwarded: no

--- a/src/input.c
+++ b/src/input.c
@@ -189,7 +189,7 @@
 
 int EnterPressed()
 {
-	return key_is_pressed(SDLK_RETURN);
+	return key_is_pressed(SDLK_RETURN) || key_is_pressed(SDLK_KP_ENTER);
 }
 
 int EscapePressed()
--- a/src/text.c
+++ b/src/text.c
@@ -597,7 +597,7 @@
 
 		key = getchar_raw(NULL);
 
-		if (key == SDLK_RETURN) {
+		if (key == SDLK_RETURN || key == SDLK_KP_ENTER) {
 			// Display the image again so both buffers are in sync
 			// useful for GL drivers that do true pageflipping (win32, nvidia 173.x, ...)
 			if (use_open_gl) {