[Scummvm-git-logs] scummvm master -> ce8227323b3fa658cdfb2f1e3de9b2fbca783c5a

bluegr bluegr at gmail.com
Thu Apr 11 00:28:22 CEST 2019


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
ce8227323b AmigaOS4: Exclude platform from a SDL1/2 keyboard fix that breaks numpad usage (#1551)


Commit: ce8227323b3fa658cdfb2f1e3de9b2fbca783c5a
    https://github.com/scummvm/scummvm/commit/ce8227323b3fa658cdfb2f1e3de9b2fbca783c5a
Author: Hubert Maier (raziel- at users.noreply.github.com)
Date: 2019-04-11T01:28:18+03:00

Commit Message:
AmigaOS4: Exclude platform from a SDL1/2 keyboard fix that breaks numpad usage (#1551)

SDL1/2: Exclude AmigaOS4 from returning 0 for .ascii

*reset .ascii to 0, when Num-Lock is NOT enabled and keypad directional keys are pressed* (original description) is causing the numpad to play dead completely on AmigaOS4 (no matter if numlock is active or not). This is a workaround for the SCUMM engine, where keycodes are mixed with ASCII codes.

Check commit f5ed14e93d85b638c8e49468b2885c1278d56d20 for reference. 

Fixes bug #10558. Tested with both SDL1 and 2 on AmigaOS4 and with both Indiana Jones games.

Changed paths:
    backends/events/sdl/sdl-events.cpp


diff --git a/backends/events/sdl/sdl-events.cpp b/backends/events/sdl/sdl-events.cpp
index 6c47745..ff5f4b9 100644
--- a/backends/events/sdl/sdl-events.cpp
+++ b/backends/events/sdl/sdl-events.cpp
@@ -170,8 +170,14 @@ int SdlEventSource::mapKey(SDLKey sdlKey, SDLMod mod, Uint16 unicode) {
 	if (key >= Common::KEYCODE_F1 && key <= Common::KEYCODE_F9) {
 		return key - Common::KEYCODE_F1 + Common::ASCII_F1;
 	} else if (key >= Common::KEYCODE_KP0 && key <= Common::KEYCODE_KP9) {
-		if ((mod & KMOD_NUM) == 0)
-			return 0; // In case Num-Lock is NOT enabled, return 0 for ascii, so that directional keys on numpad work
+		// WORKAROUND:  Disable this change for AmigaOS4 as it is breaking numpad usage ("fighting") on that platform.
+		// This fixes bug #10558.
+		// The actual issue here is that the SCUMM engine uses ASCII codes instead of keycodes for input.
+		// See also the relevant FIXME in SCUMM's input.cpp.
+		#ifndef __amigaos4__
+			if ((mod & KMOD_NUM) == 0)
+				return 0; // In case Num-Lock is NOT enabled, return 0 for ascii, so that directional keys on numpad work
+		#endif
 		return key - Common::KEYCODE_KP0 + '0';
 	} else if (key >= Common::KEYCODE_UP && key <= Common::KEYCODE_PAGEDOWN) {
 		return key;





More information about the Scummvm-git-logs mailing list