Difference between revisions of "IsKeyPressed"

386 bytes added ,  21:13, 28 July 2006
returns true over multiple frames
imported>DragoonWraith
(→‎Notes: formatting and Wiki link)
imported>Scruggs
(returns true over multiple frames)
Line 62: Line 62:


* This function doesn't return a value while a [[MessageBox]] is being displayed, presumably because input is switched over to the MessageBox.
* This function doesn't return a value while a [[MessageBox]] is being displayed, presumably because input is switched over to the MessageBox.
* 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 && isKeyPressed curkey ) ; key still being held down
  return ; wait until it's released
else
  set curkey to 0
endif
if ( isKeyPressed <keyCode> )
  ; do stuff
  set curKey to <keyCode>
endif</pre>


[[Category: Oblivion Script Extender]]
[[Category: Oblivion Script Extender]]
Anonymous user