Gamestudio Links
Zorro Links
Newest Posts
Indicator RSI
by sdelatorre
Yesterday at 23:16
Transaction Cost
by tradingest
Yesterday at 21:52
Is it possible to do Trade Mode without live brokerage account?
by AndrewAMD
Yesterday at 20:36
OptimialF values in .fac file mostly zero
by SBGuy
Yesterday at 19:48
MED (or any tool) - change base frame / pose of frame 0 ?
by rayp
Yesterday at 17:55
Rigid Force Alpha - Classic side-scrolling shoot'em up
by Turrican
Yesterday at 16:09
Series within loop
by Spirit
Yesterday at 13:22
AUM Magazine
Latest Screens
Worst Case Z
AckCon'18 - Lotter vs the World 2 - Preview Release
Evonet Beta v1.0 : Online Project Development Template
Lake scene
Who's Online
9 registered (AndrewAMD, alibaba, SBGuy, Superku, Quad, sdelatorre, 3 invisible), 460 Guests and 3 Spiders online.
Key: Admin, Global Mod, Mod
Newest Members
jiffdbf, jgtrader, Chefmac, BazGen, pallab1964
18079 Registered Users
Topic Options
Rate This Topic
#466524 - 06/19/17 15:36 [paid] Programmer wanted // different keyboard layouts
preacherX Offline
Senior Member

Registered: 09/09/05
Posts: 341
Loc: Germany
In my game the players have to use their keyboards but not only normal letters but also these special characters: " {} [] () , ; . - +

Now I need a function which can detect if theses keys are pressed. At the moment I'm using if(key_8 ==1 && (key_shiftr==1||key_shiftl==1)) for detecting if the ( is pressed. But this works only for german keyboard layouts, in other parts of the world ( is not on key 8.

Now I'm looking for a function which can detect these keys no matter which layout is used.

I found something at Microsoft which could be useful:

https://msdn.microsoft.com/en-us/library/system.windows.input.key(v=vs.110).aspx

But I don't know how to use it in lite-c...

Top
#466527 - 06/19/17 16:25 Re: [paid] Programmer wanted // different keyboard layouts [Re: preacherX]
txesmi Offline
Serious User

Registered: 06/13/07
Posts: 1164
Loc: Hiporope and its pain
Hi,
the return of 'inchar' might help.

Top
#466528 - 06/19/17 17:22 Re: [paid] Programmer wanted // different keyboard layouts [Re: txesmi]
preacherX Offline
Senior Member

Registered: 09/09/05
Posts: 341
Loc: Germany
WOW, I'm working so many years now with GameStudio and learn still new things! Thank you very much!!!


Edited by preacherX (06/19/17 17:22)

Top
#466530 - 06/19/17 18:13 Re: [paid] Programmer wanted // different keyboard layouts [Re: preacherX]
Ch40zzC0d3r Offline
Serious User

Registered: 10/10/11
Posts: 1082
Loc: Germany
Code:
#include <acknex.h>
#include <windows.h>

LRESULT CALLBACK origWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
LRESULT CALLBACK hkWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
	if(message == WM_CHAR)
	{
		printf("Keypress: %c", wParam);	
	}
	
	return origWndProc(hwnd, message, wParam, lParam);
}

void main()
{
	origWndProc = on_message;
	on_message = hkWndProc;
}



Works fine too have fun with it

Top


Moderator:  adoado, checkbutton, Perro 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de