Non-Qwerty Keyboard Layout Support?

Started by , Fri 15/02/2008 11:53:14

Previous topic - Next topic

Poobah

Does AGS support alternate, non-Qwerty keyboard layouts? I don't use Qwerty, which isn't usually a problem since AGS games are generally entirely mouse-based, but with Trilby's Notes, the entire thing is keyboard based using the text processor thing! It was made with AGS 2.62, and only works with Qwerty.

Is there anything that I can do to allow me to use a different keyboard layout with it or other AGS games? Have any of the more recent versions added support for alternate keyboard layouts?

It's really easy to implement in Windows, so I can post a bit of C code to get the keymap of the current keyboard layout if it's needed. If it's not implemented in AGS and there's anything I can do to help, let me know, 'cause keyboard layout support is essential.

Pumaman

What are you saying, that you type a 'Z' on the keyboard and a 'Y' appears in the game?

Can anyone else with a non-qwerty keyboard confirm whether this happens to you, and what version of AGS you're using?

subspark

I very much doubt whether the designer of a non qwerty keyboard has failed to wire the keys; contrary to the symbol that is printed on the key itself.
Cheers,
Paul.

Poobah

#3
Quote from: Pumaman on Fri 15/02/2008 20:56:41
What are you saying, that you type a 'Z' on the keyboard and a 'Y' appears in the game?

Can anyone else with a non-qwerty keyboard confirm whether this happens to you, and what version of AGS you're using?


No, I'm saying that AGS always interprets keyboard input as Qwerty regardless of the keyboard layout currently selected in Windows.

In my case, I have selected the US-Dvorak keyboard layout, but the keys aren't remapped in AGS, most likely due to usage of an API that bypasses Windows' keyboard handling support, like DirectInput. I've fixed up this sort of problem before in programs, and it doesn't take much work.

Quote from: subspark on Fri 15/02/2008 22:42:31
I very much doubt whether the designer of a non qwerty keyboard has failed to wire the keys; contrary to the symbol that is printed on the key itself.
Cheers,
Paul.

I'm talking about the software keyboard layout -- not the hardware one. But the situation you have described is also common with non-Qwerty keyboards; a lot of manufacturers just print different characters on the keys, because all you have to do is select the keyboard layout in your OS. This would work fine, but thanks to DirectInput, many non-Qwerty users have to go without using certain applications because DirectInput leaves the responsibility to re-map the keys according to the currently selected keyboard layout in Windows in the hands of the developer, who often isn't aware of the issue at all. Hard-wired Qwerty alternatives are hard to get.

subspark

#4
Interesting. I didn't realize there was underlying software that determines what character to display on the press of a key. I thought all that was up the the hardware to determine.
I can of course understand software control for foreign keyboard layouts such as those who's language contains more than 26 letters in their alphabet which in turn requires more keys but as for western keyboards, a physical key no matter where it is on the keyboard should always display, on-screen, the character that is printed on it.

Bloody lazy hardware developers!  ;)

Paul.

EDIT: At least there is some sense in the mapping software when it comes to holographic or light projection keyboards. You can change any key and it's symbol with those.  :)

Poobah

#5
Quote from: subspark on Sat 16/02/2008 00:45:19
Interesting. I didn't realize there was underlying software that determines what character to display on the press of a key. I thought all that was up the the hardware to determine.
I can of course understand software control for foreign keyboard layouts such as those who's language contains more than 26 letters in their alphabet which in turn requires more keys but as for western keyboards, a physical key no matter where it is on the keyboard should always display, on-screen, the character that is printed on it.

My question is, why would anybody want to disassociate the meaning of the keys using software? Has this always been the case with windows and other popular OS's?

Paul.

Well it generally makes things easier, because rather than fiddling with hardware or making new purchases, people can use any keyboard they want and have the OS re-map it as is necessary. It's also easier for manufacturers, because they can all just make Qwerty keyboards and consumers can use them however they want. It's a standard OS feature.

EDIT: It's also a highly important feature in my case (switched from Qwerty to Dvorak -- one of the best decisions I've ever made) because Qwerty is already standardised and almost completely dominant. You'd expect a Qwerty keyboard to be sitting at just about any english computer terminal. If we had to rely on alternate hardware, it'd be a huge hassle! But instead, if we go to work or something, we can just install the layout and switch between layouts using Windows' language bar.

subspark

Whoops. I think you replied to my post before I could update it. Darn i hate it when that happens.

My question is irrelevant. So it should be ignored. I don't want to confuse people.  ;)

Paul.

Snarky

For those of us who sometimes write in different languages, the ability to change the keyboard mapping is also essential. It's much simpler to use the same keyboard, and just change the mapping to get a different character set. (Although sometimes it's hard to remember where some of the less-used keys, such as ? and &, are on the keyboard when it differs between mappings.)

Poobah

Is there a way to decompile an AGS game back into its project form? Or is the a way to import an already compiled project into AGS 3?

In AGS 3's sample games, the keyboard shortcuts (such as L for 'look at') seemed to be mapped correctly according to the currently selected keyboard layout, but I don't know if it uses a different system for inputting text like in Trilby's Notes, and I'm not familiar with AGS, so I can't test it.

Khris

I'm on a German Quertz keyboard. Y and Z are swapped.

on_key_press / GUI text box -> Y=Y, Z=Z
If I switch to the American English keyboard layout using XP's Language bar, as expected, pushing Y produces a Z and the other way 'round.

However, when playing The Art of Theft or Trilby's Notes I had to switch to AE in order to get the key I pushed...

And: checking for the key strokes using IsKeyPressed, the keys are always swapped, regardless of the Language Bar setting....

Poobah

Quote from: KhrisMUC on Sat 16/02/2008 04:08:46
I'm on a German Quertz keyboard. Y and Z are swapped.

on_key_press / GUI text box -> Y=Y, Z=Z
If I switch to the American English keyboard layout using XP's Language bar, as expected, pushing Y produces a Z and the other way 'round.

However, when playing The Art of Theft or Trilby's Notes I had to switch to AE in order to get the key I pushed...

And: checking for the key strokes using IsKeyPressed, the keys are always swapped, regardless of the Language Bar setting....

Is this the case with even the most recent versions of AGS?

Khris

I tested it using 3.0 but this hasn't been an issue until now so I think it's like that for all newer versions.

Pumaman

After some investigation, it seems that the situation is this:

on_key_press / GUI Textboxes -- there was a bug here which meant that only qwerty keyboards would work in previous versions of AGS, until 2.71 (I think), when I upgraded the version of allegro that AGS was using, which fixed the issue.
Because Yahtzee is still using 2.62 to make his games, this bug affects Trilby's Notes.

IsKeyPressed -- calling IsKeyPressed with the A-Z keys will currently only work properly on qwerty keyboards (thanks for reporting this). It seems to be due to an issue in allegro, but I'll put a workaround in for the next version of AGS which should fix this.

Pumaman

Quote from: KhrisMUC on Sat 16/02/2008 04:08:46
I'm on a German Quertz keyboard. Y and Z are swapped.

And: checking for the key strokes using IsKeyPressed, the keys are always swapped, regardless of the Language Bar setting....

Would you be able to check whether this is now fixed in 3.0.1 beta 2?

Poobah

Does AGS use the Allegro DLL library, or is it statically linked?

Pumaman

It's statically linked. However, if you want to try and run a game like Trilby's Notes you could try using a newer version of the AGS Engine by renaming the game EXE to "AC2GAME.DAT", placing a newer copy of the ACWIN.EXE engine in the game folder and double clicking it.

Poobah

Quote from: Pumaman on Mon 18/02/2008 19:19:44
It's statically linked. However, if you want to try and run a game like Trilby's Notes you could try using a newer version of the AGS Engine by renaming the game EXE to "AC2GAME.DAT", placing a newer copy of the ACWIN.EXE engine in the game folder and double clicking it.


Thanks! That worked perfectly!

Poobah

Ok, in Trilby's Notes, I got up to the scene with the Harpsichord, and upon its completion, it crashes saying,

"An internal error has occurred. Please note down the following information.
If the problem persists, contact Chris Jones.
(ACI version 3.00.1000)

Error: Unable to display speech because the character TRB has an invalid view frame (View 28, loop 8, frame 3)"

Is there anything I can do to proceed past this point in the game? The saves aren't backwards compatible, so I can't load them using the old version to get past the scene.

Pumaman

Hmm, actually I think this is a bug in AGS 3.0 -- it does extra validation compared to previous versions but I think in this case it shouldn't cause an error.

Can you try this new engine:
http://www.adventuregamestudio.co.uk/acwin.zip?sfix

and see if it works for you?

Poobah

Thanks, again! That one worked fine.

SMF spam blocked by CleanTalk