Gamestudio Links
Zorro Links
Newest Posts
AlpacaZorroPlugin v1.3.0 Released
by kzhao. 05/22/24 13:41
Free Live Data for Zorro with Paper Trading?
by AbrahamR. 05/18/24 13:28
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (TedMar, AndrewAMD), 1,344 guests, and 7 spiders.
Key: Admin, Global Mod, Mod
Newest Members
LucasJoshua, Baklazhan, Hanky27, firatv, wandaluciaia
19053 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
NUM 1, to NUM 9, and curser keys just the same ??? #344452
10/17/10 15:28
10/17/10 15:28
Joined: Jun 2008
Posts: 402
Germany
S
sebbi91 Offline OP
Senior Member
sebbi91  Offline OP
Senior Member
S

Joined: Jun 2008
Posts: 402
Germany
Hi 3dgs Members

I am just wondering why it's even not possible to handle the NUM keys from NUM 1 to NUM 9 the curser keys ,Pg up and PG dn, the home key and Pos key discreted.

I tried it so long but I can't handle it!

If I press the NUM8 key its the same if I press the CUU key?

WHY?

That's worse because I need the Num keys and the curser keys discreted because of a small splitscreen-game.

I noticed that I can't use NUM5.


I tried to handle it with
Code:
if(key_cuu)



and
Code:
if(key_pressed(72))



but the result is the same. frown


My question is simple:

Is there a way to hande the NUM keys ,the curser and special keys(home,pgdn,pgup,pos) discreted?



I hope anyone could help me.

best regards

Sebastian


3D-Gamestudio A8 - Commercial
Re: NUM 1, to NUM 9, and curser keys just the same ??? [Re: sebbi91] #344470
10/17/10 17:59
10/17/10 17:59
Joined: Aug 2003
Posts: 7,439
Red Dwarf
Michael_Schwarz Offline
Senior Expert
Michael_Schwarz  Offline
Senior Expert

Joined: Aug 2003
Posts: 7,439
Red Dwarf
press the num-lock button?


"Sometimes JCL reminds me of Notch, but more competent" ~ Kiyaku
Re: NUM 1, to NUM 9, and curser keys just the same ??? [Re: Michael_Schwarz] #344475
10/17/10 18:07
10/17/10 18:07
Joined: Jun 2008
Posts: 402
Germany
S
sebbi91 Offline OP
Senior Member
sebbi91  Offline OP
Senior Member
S

Joined: Jun 2008
Posts: 402
Germany
Thats the problem if I press the NUM lock key its the same!
if i press key_cuu player1 is moving and if I press NUM8 Player1 is moving.
But I want that Player1 can controll his player with the arrow keys and Player2 can controll his Player with the NUM keys.

And I have no Idea to use NUM5.

Any Ideas?


3D-Gamestudio A8 - Commercial
Re: NUM 1, to NUM 9, and curser keys just the same ??? [Re: sebbi91] #344542
10/18/10 10:23
10/18/10 10:23
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl
using win api

i did some lookup it isnt that hard

GetKeyState(0x61); // 0x61 is the virtual key if not presses == 1 else isnt 1

make sure you include #include <windows.h>

here here is the page of al virtual keys

http://msdn.microsoft.com/en-us/library/dd375731(v=VS.85).aspx

Last edited by flits; 10/18/10 10:46.

"empty"
Re: NUM 1, to NUM 9, and curser keys just the same ??? [Re: flits] #344667
10/19/10 14:30
10/19/10 14:30
Joined: Jun 2008
Posts: 402
Germany
S
sebbi91 Offline OP
Senior Member
sebbi91  Offline OP
Senior Member
S

Joined: Jun 2008
Posts: 402
Germany
o.O
Thanks for the tipp.
But, ehhh ... I can't get it working.
can you give me a Testscript plaease.

I used the Search funtion and the manual but I can't find an example.

thanks in advance.

best regards


3D-Gamestudio A8 - Commercial
Re: NUM 1, to NUM 9, and curser keys just the same ??? [Re: sebbi91] #344748
10/20/10 10:48
10/20/10 10:48
Joined: Jul 2007
Posts: 959
nl
F
flits Offline
User
flits  Offline
User
F

Joined: Jul 2007
Posts: 959
nl
here you go there are even some caps and left right shift axamples


Code:
#include <acknex.h>
#include <default.c>
#include <windows.h>


void main()
{
	wait(2);
	
	while(1)
	{
		if(GetKeyState(0x60) <  0)
		{
			draw_text("num0 is pressed",5,5,vector(255,255,255));
		}
		
		if(GetKeyState(0x65) <  0){draw_text("num5 is pressed",5,25,vector(255,255,255));}
		
		if(GetKeyState(0x90) == 1)
		{
			draw_text("numlock is on",5,50,vector(255,255,255));
		}
		else
		{
			draw_text("numlock is off",5,50,vector(255,255,255));
		}
		
		if(GetKeyState(0x14) == 1)
		{
			draw_text("numlock is on",5,75,vector(255,255,255));
		}
		else
		{
			draw_text("caps is off",5,75,vector(255,255,255));
		}
		
		
		if(GetKeyState(0xA0) < 0)
		{
			draw_text("left shift is pressed",5,100,vector(255,255,255));
		}
		if(GetKeyState(0xA1) < 0)
		{
			draw_text("right shift is pressed",200,100,vector(255,255,255));
		}
		
		wait(1);
	}
	
	
	wait(1);
}




"empty"
Re: NUM 1, to NUM 9, and curser keys just the same ??? [Re: flits] #344779
10/20/10 16:45
10/20/10 16:45
Joined: Jun 2008
Posts: 402
Germany
S
sebbi91 Offline OP
Senior Member
sebbi91  Offline OP
Senior Member
S

Joined: Jun 2008
Posts: 402
Germany
ahhhh....

Thank you very much ^^
My mistake I tried it in a wrong way.

regards
Sebastian


3D-Gamestudio A8 - Commercial

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