- This wiki is out of date, use the continuation of this wiki instead
Key
From FenixWiki
(Difference between revisions)
Revision as of 00:11, 26 June 2007 (edit) Sandman (Talk | contribs) m (→Notes) ← Previous diff |
Revision as of 00:20, 26 June 2007 (edit) (undo) Sandman (Talk | contribs) m Next diff → |
||
Line 2: | Line 2: | ||
==Definition== | ==Definition== | ||
- | '''INT''' Key( <'''INT''' | + | '''INT''' Key( <'''INT''' scancode> ) |
Checks if a certain key is being pressed. | Checks if a certain key is being pressed. | ||
Line 8: | Line 8: | ||
== Parameters == | == Parameters == | ||
{| | {| | ||
- | | '''INT''' | + | | '''INT''' scancode || - The [[scancode]] of the key to be checked. |
|} | |} | ||
Revision as of 00:20, 26 June 2007
Contents |
Definition
INT Key( <INT scancode> )
Checks if a certain key is being pressed.
Parameters
INT scancode | - The scancode of the key to be checked. |
Returns
INT : true/false: Whether the key is being pressed.
Notes
Take a look at the scancodes for a complete list.
Example
Program input_test; Begin While( !key(_esc) ) delete_text(); if( key(_left) && !key(_right) ) write(0,160,120,4, "LEFT"); end; if( key(_right) && !key(_left) ) write(0,160,120,4, "RIGHT"); end; frame; End; exit(); End
Used in example: delete_text(), write(), exit()
This will output the words LEFT or RIGHT according to the keys you press, or it will quit the program once ESCAPE is pressed.