Gamestudio Links
Zorro Links
Newest Posts
hold key code returns very high value instead of 0 or 1
by 3run
Today at 16:08
oldschool fps project
by 3run
Today at 15:46
Sam Foster Sound | Experienced Indie Game Composer for Hire
by titanicpiano14
Today at 15:02
Project Aum - Winter Contest 2017 - Update
by Ayumi
Yesterday at 22:34
[ALL STYLES] 2D Videogame Artist (pixel, vector, painted)
by DesixStudios
Yesterday at 14:45
Easy question
by jcl
Yesterday at 13:47
Cheap bouncing shells/gibs
by 3run
Yesterday at 00:36
AUM Magazine
Latest Screens
RPG PARTY
Triton Wing now available on Steam
AckCon'17: Lotter vs The World
Triton Wing
Who's Online
17 registered (Ch40zzC0d3r, Ezzett, Lobo, Hredot, AndrewAMD, 3run, alibaba, ChrstphFr, firecrest, 2 invisible), 454 Guests and 5 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
Amocfx, cme, pataba, byano, Tuguldur717
17834 Registered Users
Topic Options
Rate This Topic
#466476 - 06/16/17 12:37 Different keyboard layouts
preacherX Offline
Senior Member

Registered: 09/09/05
Posts: 334
Loc: Germany
In the manual I can find the key mapping for german and english keyboard layouts. Is there also a function to detect which keyboard layout the player is using? In the german layout for example the open bracket is over the eight but in the english layout it is over the nine. How can I adress the open bracket for both versions correctly?

Top
#466477 - 06/16/17 12:57 Re: Different keyboard layouts [Re: preacherX]
Ch40zzC0d3r Online
Serious User

Registered: 10/10/11
Posts: 1082
Loc: Germany
Theres something called virtual keycodes to abstract this problem and pass it over to the OS instead. You dont have to tinker arround with the layouts when coded right.
Anyways, there are windows APIs to do what you want: GetKeyboardLayout


Edited by Ch40zzC0d3r (06/16/17 12:59)

Top
#466478 - 06/16/17 13:34 Re: Different keyboard layouts [Re: Ch40zzC0d3r]
preacherX Offline
Senior Member

Registered: 09/09/05
Posts: 334
Loc: Germany
How does GetKeyboardLayout work and how can I use it in lite-c?

Top
#466479 - 06/16/17 14:20 Re: Different keyboard layouts [Re: preacherX]
Ch40zzC0d3r Online
Serious User

Registered: 10/10/11
Posts: 1082
Loc: Germany
https://msdn.microsoft.com/de-de/library/windows/desktop/ms646296(v=vs.85).aspx

You just call it with parameter 0 and check the set bits of the return value.

Top
#466498 - 06/18/17 13:25 Re: Different keyboard layouts [Re: Ch40zzC0d3r]
preacherX Offline
Senior Member

Registered: 09/09/05
Posts: 334
Loc: Germany
Thanks for the info!

Top


Moderator:  aztec, Inestical, Matt_Coles, Tobias 

Gamestudio download | chip programmers | Zorro platform | shop | resources | magazine | manual | support faq | bugs

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) 3dgamestudio.net