Can't detect KEY_UP and KEY_DOWN
#1

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
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");
    }
I did not redefine my keyboard. It's default
Reply


Messages In This Thread
Can't detect KEY_UP and KEY_DOWN - by dusk - 25.07.2013, 07:41
Re: Can't detect KEY_UP and KEY_DOWN - by Vince - 25.07.2013, 08:01
Re: Can't detect KEY_UP and KEY_DOWN - by dusk - 25.07.2013, 08:06
Re: Can't detect KEY_UP and KEY_DOWN - by Threshold - 25.07.2013, 08:15
Re: Can't detect KEY_UP and KEY_DOWN - by dusk - 25.07.2013, 08:20

Forum Jump:


Users browsing this thread: 2 Guest(s)