[PATCH 09/13] Keymap: accept also (0x prefixed) hex values for scancodes

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


---
 src/keymap.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/keymap.c b/src/keymap.c
index e5200739..0e29a34f 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -631,7 +631,7 @@ static bool HostSpecToKeymap(const char *spec, KeyMapping* mapping)
 			Log_Printf(LOG_WARN, "extra '%s', PC/SDL scancode already set\n", token);
 			return false;
 		}
-		scancode = strtol(token, &endptr, 10);
+		scancode = strtol(token, &endptr, 0);
 		if (!scancode)
 		{
 			Log_Printf(LOG_ERROR, "invalid PC/SDL scancode '%s'\n", token);
@@ -712,7 +712,7 @@ static bool GuestSpecToKeymap(const char *spec, KeyMapping* mapping)
 			Log_Printf(LOG_WARN, "extra '%s', ST scancode already set\n", token);
 			return false;
 		}
-		scancode = strtol(token, &endptr, 10);
+		scancode = strtol(token, &endptr, 0);
 		if (!scancode)
 		{
 			Log_Printf(LOG_ERROR, "invalid ST scancode '%s'\n", token);
-- 
2.30.2


--------------6125158E9D8E923B9ED57408
Content-Type: text/x-patch; charset=UTF-8;
 name="0008-Support-for-specifying-PC-SDL-key-modifiers-in-the-m.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="0008-Support-for-specifying-PC-SDL-key-modifiers-in-the-m.pa";
 filename*1="tch"



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/