US vs UK Keyboard

 

Does anyone know if there is a way to detect the keyboard or current language settings without using DLL calls ?

 
James Cater:

Does anyone know if there is a way to detect the keyboard or current language settings without using DLL calls ?

TerminalInfoString(TERMINAL_LANGUAGE);
 
honest_knave:
TerminalInfoString(TERMINAL_LANGUAGE);
Kind of useful, except it just says English and not "English US" or "English International" or "English UK"
 
James Cater:

Does anyone know if there is a way to detect the keyboard or current language settings without using DLL calls ?

You are doing weird things if you need this information
 
James Cater:
Kind of useful, except it just says English and not "English US" or "English International" or "English UK"
That's all I have without using DLL or making the user complete some form of keyboard test or selection! 
 
Alain Verleyen:
You are doing weird things if you need this information

Not really that weird... I have keyboard shortcuts defined and if you are using a US keyboard the single quoted key ' and forward slash keys ` are in the opposite locations to the UK keyboard

In an ideal world I would like to detect this automatically so the top left key on the keyboard has the same functionality for everyone.

 
James Cater:

Not really that weird... I have keyboard shortcuts defined and if you are using a US keyboard the single quoted key ' and forward slash keys ` are in the opposite locations to the UK keyboard

In an ideal world I would like to detect this automatically so the top left key on the keyboard has the same functionality for everyone.

If you can't choose universal keys and don't want to go down the dll route, I suspect your only option is to let the user select their keyboard layout in the input settings.
 
honest_knave:
If you can't choose universal keys and don't want to go down the dll route, I suspect your only option is to let the user select their keyboard layout in the input settings.
I might try using the GMT offset on the local computer to guess that it is a machine based in the UK
 
James Cater:
I might try using the GMT offset on the local computer to guess that it is a machine based in the UK

It is an option, but there are a few other countries using GMT too.

James Cater:

In an ideal world I would like to detect this automatically so the top left key on the keyboard has the same functionality for everyone.

You could code multiple keys to get the desired effect?

 
James Cater: Not really that weird... I have keyboard shortcuts defined and if you are using a US keyboard the single quoted key ' and forward slash keys ` are in the opposite locations to the UK keyboard
Yes it is weird. Why do you care where the button is? If the human presses the key it should do what it's programmed to do, its location is irrelevant.
Pressing a key and having two different things possibly happen is a nightmare.
 
whroeder1:
Yes it is weird. Why do you care where the button is? If the human presses the key it should do what it's programmed to do, its location is irrelevant.

It's just a consistent "user interface".

There is a reason why the escape key is top left on all keyboards, it's because if you want to escape form an operation the reflex is to swipe away from the operation and not go hunting for the next "action". Hence if a dialog pops up you can dismiss it with the same muscle memory on every keyboard.

The same applies to the "WASD" keys that games use to control movement. They were chosen because they map well to the left hand whist the right hand controls the mouse to "look around"  the scene. If your WASD keys were on the right hand side of the keyboard then this would not be as convenient (anyone remember holding your left arm across your chest to reach the arrow keys?)

So having a significant action in the same place on the keyboard does have a "precedent" in many areas of product design.

There are also dozens of "conflicting" interfaces from different products that have been made consistent over the years. So it's not "weird" to want a consistent interface for all your users.

http://www.pcgamer.com/how-wasd-became-the-standard-pc-control-scheme/
Reason: