Support for different keyboards? (QWERTY, AZERTY etc.)

1 favourites
  • 3 posts
From the Asset Store
Adjusting the game screen for different resolutions (Letterbox scale)
  • There are apparently a variety of keyboards used around the world, each with their own unique key layouts, so designing games that work on whatever input device the player is using is very important.

    The manual entry on Keyboard

    From my understanding, Key Codes are position based and thus the same across each type of keyboard. So if you want to use the keys "WASD" for movement, in that position on an AZERTY keyboard it would be "ZQSD". If C3 uses keycodes in that way, it seems important for people to design their games using keycodes instead, perhaps that might be worth mentioning in the manual?

    The StringFromKeyCode keyboard expression converts a numerical key code back in to a string representation. For example this turns the key code 65 in to the string "A". At least that's the case for QWERTY keyboards, but does anyone know if this correctly gives us "Q" if the player is using an AZERTY keyboard? I'm hoping to be able to show the correct letter to the player based on a keycode, and that it doesn't just convert to QWERTY letters.

    Thanks!

  • Good question, I don't know... But I'd assume it does. I wouldn't convert it back with StringFromKeyCode though, you can just use if keycode is down/pressed/released

    Also it's a good idea to offer the ability to customize the control scheme.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Good points!

    If anyone has an AZERTY I'm curious if you set a text object's text with this: Keyboard.StringFromKeyCode(65), does it still say "A" when it should say "Q"? Thanks!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)