25.07.2013, 07:41
Hello, I'm trying to detect these two(and more) keys, everything is alright with KEY_LEFT and KEY_RIGHt, but with UP and DOWN it's just weird.
I added some prints, and it prints when I press RMB, it prints when I press space, but not when i press arrows up/down...
My code
I did not redefine my keyboard. It's default
I added some prints, and it prints when I press RMB, it prints when I press space, but not when i press arrows up/down...
My code
pawn Код:
if((newkeys & KEY_UP) && !(oldkeys & KEY_UP))
{
GetPlayerObjectPos(pid,Object,coo[0],coo[1],coo[2]);
SetPlayerObjectPos(pid,Object,coo[0]+10.0,coo[1],coo[2]);
printf("KEY UP");
}
else if((newkeys & KEY_DOWN) && !(oldkeys & KEY_DOWN))
{
GetPlayerObjectPos(pid,Object,coo[0],coo[1],coo[2]);
SetPlayerObjectPos(pid,Object,coo[0]-10.0,coo[1],coo[2]);
printf("KEY_DOWN");
}