6 registered members (AndrewAMD, Ayumi, degenerate_762, 7th_zorro, VoroneTZ, HoopyDerFrood),
1,268
guests, and 6
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
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
sebbi91
OP
Senior Member
|
OP
Senior Member
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 and but the result is the same. 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
Senior Expert
|
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
sebbi91
OP
Senior Member
|
OP
Senior Member
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
flits
User
|
User
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
sebbi91
OP
Senior Member
|
OP
Senior Member
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
flits
User
|
User
Joined: Jul 2007
Posts: 959
nl
|
here you go there are even some caps and left right shift axamples
#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
sebbi91
OP
Senior Member
|
OP
Senior Member
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
|
|
|
Moderated by mk_1, Perro, rayp, Realspawn, Rei_Ayanami, rvL_eXile, Spirit, Superku, Tobias, TSG_Torsten, VeT
|