Difference between revisions of "IsKeyPressed2"
→Notes: Tapped keys
imported>Haama (→See Also: New links) |
imported>Haama (→Notes: Tapped keys) |
||
Line 12: | Line 12: | ||
* As well as the normal DX scancodes, you can use the numbers 256 to 263 to check for mouse button presses, and also 264 and 265 to check for mouse wheel movement. | * As well as the normal DX scancodes, you can use the numbers 256 to 263 to check for mouse button presses, and also 264 and 265 to check for mouse wheel movement. | ||
* This function will return false if a key which was previously disabled using [[disableKey]] is pressed, but will return true if a mouse button is pressed while that button is disabled. | * This function will return false if a key which was previously disabled using [[disableKey]] is pressed, but will return true if a mouse button is pressed while that button is disabled. | ||
* This function will return true if the key is "pressed" via [[TapKey]] or [[TapControl]], even if the key has been disabled with [[DisableKey]] or [[DisableControl]]. This is the ''only'' function that can detect tapped keys. | |||
* 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.: | * 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 && isKeyPressed2 curkey ) ; key still being held down | <pre>if ( curKey && isKeyPressed2 curkey ) ; key still being held down |