[ scummvm-Bugs-600258 ] key translation

noreply at sourceforge.net noreply at sourceforge.net
Mon Aug 26 17:07:34 CEST 2002


Bugs item #600258, was opened at 2002-08-26 15:07
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=418820&aid=600258&group_id=37116

Category: Unknown Crash/Other
Group: All Games
Status: Open
Resolution: None
Priority: 5
Submitted By: Mathias Rauen (madshi)
Assigned to: Nobody/Anonymous (nobody)
Summary: key translation

Initial Comment:
ScummVM doesn't translate keys correctly. When 
pressing e.g. a german umlaut key, I get whatever is on 
the english keyboard instead.

First I thought this would be a bug in SDL, so I wrote to 
SDL about it. I got a little demo source back from Sam 
Lantinga showing how to do things right. Here is the 
patch for ScummVM, could someone please check it 
in? Thank you!

In the initialization somewhere call:

/* Enable UNICODE translation for keyboard input */
SDL_EnableUNICODE(1);

Then in SDL.cpp in "OSystem_SDL::poll_event" please 
check whether "ev.key.keysym.unicode" is filled. If it is, 
please use that instead of "ev.key.keysym.sym". That 
was it. Here's a part of the sources I got from Sam:

if ( sym->unicode ) {
	/* Is it a control-character? */
	if ( sym->unicode < ' ' ) {
		printf(" (^%c)", sym-
>unicode+'@');
	} else {
#ifdef UNICODE
		printf(" (%c)", sym->unicode);
#else
		/* This is a Latin-1 program, so 
only show 8-bits */
		if ( !(sym->unicode & 0xFF00) )
			printf(" (%c)", sym-
>unicode);
#endif
	}
}

This code correctly gives me all german special 
characters.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=418820&aid=600258&group_id=37116




More information about the Scummvm-tracker mailing list