Game Development Community

Which one's the Any Key?

by Dreamer · in Torque Game Engine · 04/26/2005 (3:20 pm) · 5 replies

Alright I'm pretty familiar with key binds at this stage, but what I need to do now is implement a "Keep Still" function that is interrupted if the player moves the mouse or any key is pressed.

The basic idea is to cloak my player when they stand still and cast a cloaking spell, the spell has no timer per se, but they will become uncloaked if they move or try to do anything else while hidden.

Does anyone have a good solution for this (just the detecting keypresses and mouse movement, I got the rest covered)?

All the ideas I can think of are looking really inelegant, and fugly.

#1
04/26/2005 (4:09 pm)
I was wondering the same thing today. how do you detect for any keypress?
#2
04/26/2005 (5:40 pm)
Bind to "anykey". Works for most of the keys, but some (like the number keys and modifiers) don't seem to be included.
#3
04/26/2005 (6:33 pm)
Yeah, he's not joking that's actually a mapping. :-)
Seems someone was thinking of you...

- Brett
#4
12/26/2007 (11:41 am)
This dose not seem to work on keys that have already been bound
#5
12/26/2007 (6:02 pm)
You could create a new keypmap with just the 'anykey' function and "pop" it when you need to. You can then push it back once a key has been pressed.