[dismiss]
This wiki is a copy of the original Oblivion CS wiki created and maintained by the UESP.net. See CSwiki:Copy Notice for more info.
Difference between revisions of "IsControlPressed"
Jump to navigation
Jump to search
Added notes
imported>Haama (→See Also: New links) |
imported>Haama (Added notes) |
||
Line 7: | Line 7: | ||
Returns 1 if either the key or mouse button assigned to the specified control code is currently pressed. Detects disabled keys. | Returns 1 if either the key or mouse button assigned to the specified control code is currently pressed. Detects disabled keys. | ||
==Notes== | |||
* This function won't detect script [[TapKey]]s or [[TapControl]]s, but will detect keys disabled with [[DisableKey]] or [[DisableControl]]. | |||
* Bear in mind that this function returns 1 for as long as the key is held down, so it's generally a good idea to trap the key and then wait until it is released, i.e.: | |||
<pre>if ( curKey && isControlPressed curkey ) ; key still being held down | |||
return ; wait until it's released | |||
else | |||
set curkey to 0 | |||
endif | |||
if ( isControlPressed <keyCode> ) | |||
; do stuff | |||
set curKey to <keyCode> | |||
endif</pre> | |||
==Control IDs== | ==Control IDs== |