Gamestudio Links
Zorro Links
Newest Posts
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
LPDIRECT3DCUBETEXTUR
E9

by Ayumi. 04/12/24 11:00
Sam Foster Sound | Experienced Game Composer for Hire
by titanicpiano14. 04/11/24 14:56
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (firecrest, AndrewAMD), 387 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
11honza11, ccorrea, sakolin, rajesh7827, juergen_wue
19045 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
[paid] Programmer wanted // different keyboard layouts #466524
06/19/17 13:36
06/19/17 13:36
Joined: Sep 2005
Posts: 352
Germany
preacherX Offline OP
Senior Member
preacherX  Offline OP
Senior Member

Joined: Sep 2005
Posts: 352
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...

Re: [paid] Programmer wanted // different keyboard layouts [Re: preacherX] #466527
06/19/17 14:25
06/19/17 14:25
Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
txesmi Offline
Serious User
txesmi  Offline
Serious User

Joined: Jun 2007
Posts: 1,337
Hiporope and its pain
Hi,
the return of 'inchar' might help.

Re: [paid] Programmer wanted // different keyboard layouts [Re: txesmi] #466528
06/19/17 15:22
06/19/17 15:22
Joined: Sep 2005
Posts: 352
Germany
preacherX Offline OP
Senior Member
preacherX  Offline OP
Senior Member

Joined: Sep 2005
Posts: 352
Germany
WOW, I'm working so many years now with GameStudio and learn still new things! Thank you very much!!!

Last edited by preacherX; 06/19/17 15:22.
Re: [paid] Programmer wanted // different keyboard layouts [Re: preacherX] #466530
06/19/17 16:13
06/19/17 16:13
Joined: Oct 2011
Posts: 1,082
Germany
C
Ch40zzC0d3r Offline
Serious User
Ch40zzC0d3r  Offline
Serious User
C

Joined: Oct 2011
Posts: 1,082
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


Moderated by  adoado, checkbutton, mk_1, 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

Powered by UBB.threads™ PHP Forum Software 7.7.1