[PATCH] 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 059f6498..775734ad 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -833,7 +833,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);
@@ -914,7 +914,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


--------------6D59CF2683B8E6D297AA7665
Content-Type: text/x-patch; charset=UTF-8;
 name="0001-Fix-names-in-keymap-should-be-interpreted-as-symboli.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="0001-Fix-names-in-keymap-should-be-interpreted-as-symboli.pa";
 filename*1="tch"



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