Menu

#3524 AGI: AZERTY keyboard not supported

AGI: Space Quest 1
closed
nobody
5
2009-03-18
2007-12-19
Nomax
No

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...

Discussion

  • Nomax

    Nomax - 2007-12-19
    • summary: AZERTY keyboard not supported --> AZERTY keyboard not supported in AGI games
     
  • Max Horn

    Max Horn - 2007-12-20
    • assigned_to: nobody --> kirben
    • summary: AZERTY keyboard not supported in AGI games --> AGI: AZERTY keyboard not supported
     
  • Max Horn

    Max Horn - 2007-12-20

    Logged In: YES
    user_id=12935
    Originator: NO

    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?

     
  • Nomax

    Nomax - 2007-12-20

    Logged In: YES
    user_id=1628036
    Originator: YES

    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... :-/

     
  • Max Horn

    Max Horn - 2007-12-20
    • assigned_to: kirben --> nobody
    • summary: AGI: AZERTY keyboard not supported --> AGI: AZERTY keyboard not supported
     
  • Max Horn

    Max Horn - 2007-12-20

    Logged In: YES
    user_id=12935
    Originator: NO

    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?

     
  • Nomax

    Nomax - 2007-12-20

    Logged In: YES
    user_id=1628036
    Originator: YES

    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...

     
  • Max Horn

    Max Horn - 2007-12-23

    Logged In: YES
    user_id=12935
    Originator: NO

    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.

     
  • Filippos Karapetis

    Logged In: YES
    user_id=991970
    Originator: NO

    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?

     
  • Nomax

    Nomax - 2008-01-09

    Logged In: YES
    user_id=1628036
    Originator: YES

    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... :-/

     
  • Nomax

    Nomax - 2008-01-09

    Logged In: YES
    user_id=1628036
    Originator: YES

    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>.

     
  • Max Horn

    Max Horn - 2008-01-11

    Logged In: YES
    user_id=12935
    Originator: NO

    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.

     
  • Eugene Sandulenko

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

     
  • Eugene Sandulenko

    • status: open --> pending
     
  • SourceForge Robot

    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).

     
  • SourceForge Robot

    • status: pending --> closed