[Scummvm-git-logs] scummvm master -> 44c0b4644fcc66adb816afa4588fc1afaf95f4ad

sev- sev at scummvm.org
Tue May 12 12:37:14 UTC 2020


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:
44c0b4644f SDL: Return unicode keycode for Hebrew input


Commit: 44c0b4644fcc66adb816afa4588fc1afaf95f4ad
    https://github.com/scummvm/scummvm/commit/44c0b4644fcc66adb816afa4588fc1afaf95f4ad
Author: Zvika Haramaty (haramaty.zvika at gmail.com)
Date: 2020-05-12T14:37:10+02:00

Commit Message:
SDL: Return unicode keycode for Hebrew input

Before this commit, when typing in Hebrew, SDL reported the equivalent
English keycode. Thus, if user typed Hebrew letter Aleph, it was
reported as ascii of 't' (or 'T', I don't remember...).

It's still impossible to type Hebrew letters in the GUI's input dialogs,
but it's a step forward.

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 11fcc9bded..fe1a497d24 100644
--- a/backends/events/sdl/sdl-events.cpp
+++ b/backends/events/sdl/sdl-events.cpp
@@ -114,7 +114,7 @@ SdlEventSource::~SdlEventSource() {
 int SdlEventSource::mapKey(SDL_Keycode sdlKey, SDL_Keymod mod, Uint16 unicode) {
 	Common::KeyCode key = SDLToOSystemKeycode(sdlKey);
 
-	// Keep unicode in case it's regular ASCII text or in case we didn't get a valid keycode
+	// Keep unicode in case it's regular ASCII text, Hebrew or in case we didn't get a valid keycode
 	//
 	// We need to use unicode in those cases, simply because SDL1.x passes us non-layout-adjusted keycodes.
 	// So unicode is the only way to get layout-adjusted keys.
@@ -136,6 +136,10 @@ int SdlEventSource::mapKey(SDL_Keycode sdlKey, SDL_Keymod mod, Uint16 unicode) {
 				if (unicode > 0x7E)
 					unicode = 0; // do not allow any characters above 0x7E
 			} else {
+				// We allow Hebrew characters
+				if (unicode >= 0x05D0 && unicode <= 0x05EA)
+					return unicode;
+
 				// We must not restrict as much as when Ctrl/Alt-modifiers are active, otherwise
 				// we wouldn't let umlauts through for SDL1. For SDL1 umlauts may set for example KEYCODE_QUOTE, KEYCODE_MINUS, etc.
 				if (unicode > 0xFF)




More information about the Scummvm-git-logs mailing list