Opened 16 years ago

Closed 15 years ago

#3524 closed defect

AGI: AZERTY keyboard not supported

Reported by: SF/nomax Owned by:
Priority: normal Component: Engine: AGI
Version: Keywords:
Cc: Game: Space Quest 1

Description

ScummVM version: ScummVM 0.11.0svn (Dec 19 2007 09:11:48) Features compiled in: Vorbis FLAC MP3 zLib (also occurs in ScummVM 0.10.0).

Games are in english, tested on Windows 2000.

This affects all Sierra AGI games.

Bug: --- When launching these games through ScummVM using an AZERTY keyboard, the numeric keypad is disabled and pressing A, Z, Q, W keys return Q, W, A, Z respectively.

While when running these games using their original executables, everything works great. Keypad numbers work and A key writes character A on screen.

So ScummVM doesn't behave as the original games in this case.

This is especially annoying in these games since you have to type all the time...

Ticket imported from: #1854331. Ticket imported from: bugs/3524.

Change History (16)

comment:1 by SF/nomax, 16 years ago

Summary: AZERTY keyboard not supportedAZERTY keyboard not supported in AGI games

comment:2 by fingolfin, 16 years ago

Owner: set to Kirben
Summary: AZERTY keyboard not supported in AGI gamesAGI: AZERTY keyboard not supported

comment:3 by fingolfin, 16 years ago

AZERTY keyboards are notoriously difficult to support, I am afraid. :/ They are very weird compared to virtually all other "western" keyboard layouts. In the Mac OS X port, I used a special hacked up version of SDL to work around issues with these -- maybe something similar is needed for the Windows port.

Kirben, any idea?

comment:4 by SF/nomax, 16 years ago

Same happens on Linux (ScummVM 0.11.0svn (Dec 20 2007 12:32:55).

Yes, the problem comes from SDL. To get AZERTY (and all other kb layouts) keys right in SDL, you have to use UNICODE:

SDL_EnableUNICODE();

switch (event.key.keysym.unicode) {

See http://www.libsdl.org/cgi/docwiki.cgi/SDL_5fkeysym for more info.

Here's an example here too: http://lists.libsdl.org/pipermail/sdl-libsdl.org/2004-June/043967.html

There are surely other/better ways to do so though... :-/

comment:5 by fingolfin, 16 years ago

Owner: Kirben removed

comment:6 by fingolfin, 16 years ago

We *do* use SDL_EnableUNICODE(). The problem is more complex than just that. There are situations where you are interested in the keysym.unicode value, but also others where you need the keysym.sym value. That is: sometimes you are interested in what is printed on the keys, and sometimes the position is the important part...

Think for example of this: On an AZERTY keyboard, to get numbers you always have to hold SHIFT. Now, assume a game has the hotkeys 1 and Shift-1 -- how do distinguish those two on a AZERTY keyboard?

comment:7 by SF/nomax, 16 years ago

Yes to write a number on an azerty keyboard, you have 3 ways: - Press Shift and key simultaneously. - Enable Caps Lock then press key. - Use righthand numeric keypad (with Num Lock on).

But the original games work fine and there were only one version of these games used worldwide (the US version). Could we skip SDL and use keyboard system drivers directly instead (at least on PC platforms)?

At worse, this part can be kept as it is now since numbers above letters work as intended (using shift or caps lock). Only problems are the alpha keys (A, Z, Q, W, M,...) which don't return the right character and the numeric keypad which is disabled.

This really should be adresses since AZERTY keyboards are used by more than tenths of millions computer users...

comment:8 by fingolfin, 16 years ago

No, we can't skip SDL. And it's not necessary, either. The problem can be solved, but it's not as trivial as inserting a line of code or "bypassing" some driver. Rather, the problem is which values we feed to the AGI engine internally. Unless you make yourself familiar with that part of the code (agi.cpp, line 222 following), I am afraid guessing solutions won't work nor help :-).

BTW, we fix bugs as we have time and ability. The "tenth of millions users" argument is really pointless here: Neither are any of these "paying" us (nor do we ask for many), nor are most of them even aware of the existence of ScummVM, so that is really a useless straw man argument. And won't help us fix this solution. So let's keep politics out of this, please.

comment:9 by bluegr, 16 years ago

I've made a slight change to the AGI keyboard input code today. Can you please test today's SVN version to check if your keyboard is working correctly now?

comment:10 by SF/nomax, 16 years ago

Please test whether you can reproduce this bug with the latest daily SVN build which you can find at the bottom of our downloads page: <http://www.scummvm.org/downloads.php>.

comment:11 by SF/nomax, 16 years ago

Tested with SVN 0.11.0pre - (Jan 9 2008 22:42:56) - Windows 2000 French

It's worse than before: the numeric keys above alphas now always behave as Caps Lock was active (uppercase) but alphas are always lowercase. Shift and Caps Lock keys seem to be disabled. It's now impossible to obtain uppercase letters.

a, z, q, w still print q, w, a, z respectively. But I saw something strange, the "M" key (located right to "L") is now returning ";" (as on a QWERTY layout) while it would return letter "m" in previous builds.

Very strange... :-/

comment:12 by fingolfin, 16 years ago

That's very strange, as the code now directly uses the ASCII value SDL gives us. What you report sounds as if for some reasons the keyboard layout is set to US not french. Very odd.

comment:13 by sev-, 15 years ago

It seems like another SDL issue. Does it still occur for you?

comment:14 by sev-, 15 years ago

Status: newpending

comment:15 by SF/sf-robot, 15 years ago

Status: pendingclosed

comment:16 by SF/sf-robot, 15 years ago

This Tracker item was closed automatically by the system. It was previously set to a Pending status, and the original submitter did not respond within 14 days (the time period specified by the administrator of this Tracker).

Note: See TracTickets for help on using tickets.