Checking key pressed in repeatedly_execute

Started by Kinoko, Sun 10/07/2005 08:08:50

Previous topic - Next topic

Kinoko

How can I check if any key is currently pressed in repeatedly_execute? I tried keycode which doesn't work outside of on_key_press and I even tried if (on_key_press==0) but yeah, that didn't work (it was a long shot).

Rui 'Trovatore' Pires

Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Kinoko


Rui 'Trovatore' Pires

Ah. Whoops.

Try this. Start with a check to see if the processing can begin, then use a "while" loop to "scroll" through the keycodes you want to test. Can't explain better, am in hurry, but someone else can - but I think you get it.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Pumaman

There's no specific way to do this, as it's not a common request. You'd have to do as Rui says and loop through all the keycodes you're interested in, and test them with IsKeyPressed.

Kinoko


Rui 'Trovatore' Pires

BTW, are you sure it's nothing you can just place BEFORE any keycode checks in on_key_press (and BEFORE the IsGamePaused check) with some more appropriate checks? It might be easier and just as effective
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Kinoko

Actually, I did go and find another way to check :P

Rui 'Trovatore' Pires

Could you share? :) I'm curious and interested. Unless it's too specific for your game, accourse.
Reach for the moon. Even if you miss, you'll land among the stars.

Kneel. Now.

Never throw chicken at a Leprechaun.

Kinoko

Hehe, I already did in my keyboard movement thread :P I used 'is Animating' instead. I haven't run into any problems with it so far.

SMF spam blocked by CleanTalk