Jump to content


Photo

Make your controls QWERTZ-friendly


  • Please log in to reply
24 replies to this topic

#1 9_6

9_6

    Guest

  • GMC Member
  • 3627 posts

Posted 11 November 2010 - 01:02 PM

This is for everyone using the popular ZXC-keys in their games.
Please execute this code 1 time at the start of your game:

keyboard_set_map(ord("Y"),ord("Z"));
keyboard_set_map(ord("W"),ord("Z"));

You do not need to worry or care about anything else from there.

What it does is letting your game pretend the "Y" key is also the "Z" key.
That's good for people with QWERTZ-keyboards because the bottom left key is in fact the "Y"-key on those keyboards which makes the controls awkward unless you change your keyboard layout.
The same goes for "W" and AZERTY-keyboards.

It's a simple fix that can easily be put into games after they're done and I wish more people would do it.
Spread the word.

If you know any other exotic (aka non-qwerty) keyboard layout that messes the popular zxc-keys up, please let me know and I'll expand the script.

Edited by 9_6, 11 November 2010 - 01:03 PM.

  • 18

#2 ADHDguitar

ADHDguitar

    GMC Member

  • New Member
  • 79 posts

Posted 11 November 2010 - 01:39 PM

Sounds very useful. Tbh, I wasn't even aware that such keyboards existed, but I'll definitely save this code somewhere.
  • 0

#3 MasterMind007

MasterMind007

    MasterMind Prod.

  • GMC Member
  • 543 posts

Posted 11 November 2010 - 02:33 PM

This is very useful! I have a QWERTZ keyboard. If I make a game using ZXC buttons I will definitely put that in it.
  • 0
Projects:
The Dragon's Reign - A MMORPG - DELAYED
Posted Image

#4 kburkhart84

kburkhart84

    Firehammer Games

  • GMC Member
  • 2026 posts
  • Version:GM:Studio

Posted 11 November 2010 - 05:16 PM

Not to say the script isn't useful, but my opinion in general is that it is better to let the user customize the controls. Any game I make, included a tetris clone I'm doing currently, has this feature. Ever since Earthsiege2, I have hated not being able to customize my controls.
  • 1

My KBInput system is now on the marketplace here.  It wraps up nice and tight GMStudio's input system into a few function calls making a user configurable input system that works the same regardless of what inputs the player has chosen including keyboard, mouse buttons, and gamepad/joysticks using DInput/XInput.  The support forum topic for it is here.


#5 9_6

9_6

    Guest

  • GMC Member
  • 3627 posts

Posted 11 November 2010 - 06:14 PM

Not to say the script isn't useful, but my opinion in general is that it is better to let the user customize the controls. Any game I make, included a tetris clone I'm doing currently, has this feature. Ever since Earthsiege2, I have hated not being able to customize my controls.

True but not everyone seems to want to to (or can't) come up with a customizable controls system and this is better than nothing.

Edited by 9_6, 11 November 2010 - 06:15 PM.

  • 1

#6 kburkhart84

kburkhart84

    Firehammer Games

  • GMC Member
  • 2026 posts
  • Version:GM:Studio

Posted 12 November 2010 - 02:45 AM

Not to say the script isn't useful, but my opinion in general is that it is better to let the user customize the controls. Any game I make, included a tetris clone I'm doing currently, has this feature. Ever since Earthsiege2, I have hated not being able to customize my controls.

True but not everyone seems to want to to (or can't) come up with a customizable controls system and this is better than nothing.


I have, in fact, I made it into a simple to use extension. If you search for kbinput, you can find it. It makes it really easy.
  • 0

My KBInput system is now on the marketplace here.  It wraps up nice and tight GMStudio's input system into a few function calls making a user configurable input system that works the same regardless of what inputs the player has chosen including keyboard, mouse buttons, and gamepad/joysticks using DInput/XInput.  The support forum topic for it is here.


#7 JAk HAk

JAk HAk

    sepius fidelis

  • New Member
  • 713 posts
  • Version:GM:HTML5

Posted 13 November 2010 - 08:13 AM

As far as I know, greater than ninety-nine percent of keyboards in use have XCV in a consecutive line. If, for whatever reason, you don't feel like mapping Y and W, you can consider using those instead.
  • 0

Posted Image


#8 9_6

9_6

    Guest

  • GMC Member
  • 3627 posts

Posted 13 November 2010 - 10:00 AM

As far as I know, greater than ninety-nine percent of keyboards in use have XCV in a consecutive line. If, for whatever reason, you don't feel like mapping Y and W, you can consider using those instead.

Yes, they could.
They could also use asd but z and x are popular now for some reason.
  • 0

#9 thatshelby

thatshelby

    GMC Member

  • GMC Member
  • 3823 posts
  • Version:GM8

Posted 13 November 2010 - 09:37 PM

What about W? If I need W movement, then it'd be a little weird for you non-qwerty's. I'm semi-beingdifficult but would just like to know a work around. Personally, after remembering this, I am going to implement a custom control system. I think there is also an AZERTY keyboard.


EDIT: http://en.wikipedia....Keyboard_layout There's also a potentially helpful article for you on keyboard layouts.

Edited by Theophilus, 13 November 2010 - 09:39 PM.

  • 0

#10 makerofthegames

makerofthegames

    My last custom title

  • GMC Member
  • 7629 posts
  • Version:GM:Studio

Posted 14 November 2010 - 12:04 AM

Meh. I always prefer using arrow controls than WASD anyway, and those are consistant with pretty much all keyboards.
  • 0

#11 9_6

9_6

    Guest

  • GMC Member
  • 3627 posts

Posted 14 November 2010 - 11:08 AM

What about W? If I need W movement, then it'd be a little weird for you non-qwerty's. I'm semi-beingdifficult but would just like to know a work around. Personally, after remembering this, I am going to implement a custom control system. I think there is also an AZERTY keyboard.

That's cool but it has nothing to do with the z, x or c keys.

EDIT: http://en.wikipedia....Keyboard_layout There's also a potentially helpful article for you on keyboard layouts.

Alright thanks.
Seems like qwerty, qwertz and azerty are the big ones and then there's completely out of whack stuff that I have no idea how to fix.
Or if it even needs to be fixed.

Meh. I always prefer using arrow controls than WASD anyway, and those are consistant with pretty much all keyboards.

Please read the first sentence of the first post again.

Edited by 9_6, 14 November 2010 - 01:09 PM.

  • 0

#12 thatshelby

thatshelby

    GMC Member

  • GMC Member
  • 3823 posts
  • Version:GM8

Posted 14 November 2010 - 03:42 PM

What about W? If I need W movement, then it'd be a little weird for you non-qwerty's. I'm semi-beingdifficult but would just like to know a work around. Personally, after remembering this, I am going to implement a custom control system. I think there is also an AZERTY keyboard.

That's cool but it has nothing to do with the z, x or c keys.



On AZERTY keyboards, Z is where W is on QWERTY.
  • 0

#13 9_6

9_6

    Guest

  • GMC Member
  • 3627 posts

Posted 14 November 2010 - 03:48 PM

Yes I know and yes, if you're playing some shooter with wasd controls on an azerty keyboard, you're probably screwed because wasd is zqsd on there.
So you'd need to map the z- to the w key and the q- to the a key to make it work.
Which means you can't use the q or the z key for anything else. Which probably means trouble since those are close to wasd and thus often used in games.
It also conflicts with the zxc- mapping even though you'll probably never use wasd and zxc together anyway.

But that's not what this topic is about. One problem at a time.
I also can't really confirm if this is a problem at all. All I know from first hand experience is that z-issue.
Someone from france or belgium with an azerty keyboard should spill the beans on that matter.

Edited by 9_6, 14 November 2010 - 03:55 PM.

  • 0

#14 kburkhart84

kburkhart84

    Firehammer Games

  • GMC Member
  • 2026 posts
  • Version:GM:Studio

Posted 15 November 2010 - 02:24 AM

I still say you are better off in the long run to have configurable controls. Not only do you get around the different keyboard style issue, but if you do it right you make it easier for people to use joysticks, and configure them. And, assuming you make it external of the game code(as in an extension or scripts), you can easily reuse it in other games. You only need to code it once. In fact, I'm surprised I didn't see many extensions for this considering it is useful to have and easy to do. Time-consuming somewhat, but relatively easy, and worth in the end.

EDIT** You know how you are mapping one letter to another to make it work with other keyboards. You end up removing those keys, which you already mention. Configurable controls gets around that too.

Edited by kburkhart84, 15 November 2010 - 02:27 AM.

  • 0

My KBInput system is now on the marketplace here.  It wraps up nice and tight GMStudio's input system into a few function calls making a user configurable input system that works the same regardless of what inputs the player has chosen including keyboard, mouse buttons, and gamepad/joysticks using DInput/XInput.  The support forum topic for it is here.


#15 slayer 64

slayer 64

    Slayer of gingers

  • GMC Member
  • 4301 posts
  • Version:GM:Studio

Posted 13 February 2011 - 06:46 PM

no. anything that isn't QWERTY is awkward
  • 0

5y5rs3d.pngfg0UQNL.png


#16 varuks

varuks

    GMC Member

  • New Member
  • 982 posts
  • Version:Unknown

Posted 21 March 2012 - 11:31 AM

Yeah, I never thought that other leopards could have such game breaking problems.
  • 0
All human life is equal, true. But not all humans are equal. Some through their stupidity become less superior than others through their wisdom...

#17 Glen

Glen

    GMC Member

  • GMC Member
  • 841 posts
  • Version:GM:Studio

Posted 26 March 2012 - 10:43 PM

Very useful. I never knew about the keyboard_map codes.
  • 0
Avic Pro (Work in Progress):
Portable media manager. Just pop in your usb drive and use Avic Pro to organize and present all of your media content in categories. On top of that, it makes handling portable games, software, and other utilities a breeze. It allows you to launch just about any of your media content quickly and efficiently from your system tray. No more long paths to finding content.
Savage Defence| Text FX | Ragdoll Axe Engine | Professionalism | Online Games | Game Progression | 3D Game Development | Online Anti-Hack Strategies

#18 KygonsCube

KygonsCube

    GMC Member

  • New Member
  • 155 posts
  • Version:Unknown

Posted 23 April 2012 - 06:41 AM

There are various foreign/'exotic' keyboards that have different setups, it's best just to have it customizable.
  • 0

#19 CGPM

CGPM

    GMC Member

  • GMC Member
  • 52 posts
  • Version:GM8

Posted 18 June 2012 - 10:50 PM

If you're still accepting keyboard layouts, try this.
  • 0

#20 Andy

Andy

    GMC Veteran

  • GMC Member
  • 1988 posts
  • Version:GM:Studio

Posted 02 July 2012 - 08:48 PM

This is very useful, thank you. :thumbsup:
  • 0

Please visit my website, Andygames.com today!

 


#21 Lukasmah

Lukasmah

    A fan of staplers

  • GMC Member
  • 840 posts
  • Version:GM8

Posted 26 July 2012 - 08:57 AM

This is for everyone using the popular ZXC-keys in their games.
Please execute this code 1 time at the start of your game:

keyboard_set_map(ord("Y"),ord("Z"));
keyboard_set_map(ord("W"),ord("Z"));

You do not need to worry or care about anything else from there.

What it does is letting your game pretend the "Y" key is also the "Z" key.
That's good for people with QWERTZ-keyboards because the bottom left key is in fact the "Y"-key on those keyboards which makes the controls awkward unless you change your keyboard layout.
The same goes for "W" and AZERTY-keyboards.

It's a simple fix that can easily be put into games after they're done and I wish more people would do it.
Spread the word.

If you know any other exotic (aka non-qwerty) keyboard layout that messes the popular zxc-keys up, please let me know and I'll expand the script.

Or just enable alt-shift. I use it all the time with my qwertz keyboard.

Another question: How do I modify my wasd controls so the work for azerty?

EDIT: I know it's a necro, but necroes are allowed if the topic can still discussed.

Edited by Lukasmah, 26 July 2012 - 08:59 AM.

  • 0

This is my signature. Isn't it nice?


#22 seejayjames

seejayjames

    GMC Member

  • New Member
  • 28 posts
  • Version:GM:Studio

Posted 02 September 2012 - 11:04 PM

If you're still accepting keyboard layouts, try this.



+1 for Dvorak! Took a couple months to get fast with it, but man is it better.... good to see some other folks using it :thumbsup:
  • 1

#23 Lukasmah

Lukasmah

    A fan of staplers

  • GMC Member
  • 840 posts
  • Version:GM8

Posted 04 September 2012 - 09:16 AM

I always made asd keys because of that.

Now I can make a yxc key game.

Yeah, yeah, necrobumps.

I don't care, dis is too awesome.

Edited by Lukasmah, 04 September 2012 - 09:16 AM.

  • 0

This is my signature. Isn't it nice?


#24 CGPM

CGPM

    GMC Member

  • GMC Member
  • 52 posts
  • Version:GM8

Posted 14 September 2012 - 10:45 PM

If you're still accepting keyboard layouts, try this.



+1 for Dvorak! Took a couple months to get fast with it, but man is it better.... good to see some other folks using it :thumbsup:


I don't actually use it, though I "plan" on it.
  • 0

#25 max_r_61270

max_r_61270

    GMC Member

  • New Member
  • 411 posts

Posted 02 November 2012 - 04:33 PM

Nice! I never thought about doing this, but I'm glad you posted it.
  • 0