Difference between revisions of "Getkey"
From OpenEUO
TheGreenGod (Talk | contribs) |
|||
Line 1: | Line 1: | ||
local bpressed = getkey(str) | local bpressed = getkey(str) | ||
Returns a boolean based upon whether a key or key combination as specified by the string str is depressed or not. The key-specifier string str can contain A-Z, 0-9, F1-F12 and ESC, BACK, TAB, ENTER, PAUSE, CAPSLOCK, SPACE, PGDN, PGUP, END, HOME, LEFT, RIGHT, UP, DOWN, PRNSCR, INSERT, DELETE, NUMLOCK, SCROLLLOCK, CTRL, ALT, or SHIFT. | Returns a boolean based upon whether a key or key combination as specified by the string str is depressed or not. The key-specifier string str can contain A-Z, 0-9, F1-F12 and ESC, BACK, TAB, ENTER, PAUSE, CAPSLOCK, SPACE, PGDN, PGUP, END, HOME, LEFT, RIGHT, UP, DOWN, PRNSCR, INSERT, DELETE, NUMLOCK, SCROLLLOCK, CTRL, ALT, or SHIFT. | ||
+ | |||
+ | To use a key combination use and | ||
+ | local bpressed = getkey("str" and "str") | ||
Warning: since getkey is based on [http://msdn.microsoft.com/en-us/library/ms646293%28VS.85%29.aspx GetAsyncKeyState], this function will register a currently depressed key regardless of what application is in the foreground. | Warning: since getkey is based on [http://msdn.microsoft.com/en-us/library/ms646293%28VS.85%29.aspx GetAsyncKeyState], this function will register a currently depressed key regardless of what application is in the foreground. | ||
[[Getmouse]] | [[Getmouse]] |
Revision as of 12:25, 8 April 2012
local bpressed = getkey(str)
Returns a boolean based upon whether a key or key combination as specified by the string str is depressed or not. The key-specifier string str can contain A-Z, 0-9, F1-F12 and ESC, BACK, TAB, ENTER, PAUSE, CAPSLOCK, SPACE, PGDN, PGUP, END, HOME, LEFT, RIGHT, UP, DOWN, PRNSCR, INSERT, DELETE, NUMLOCK, SCROLLLOCK, CTRL, ALT, or SHIFT.
To use a key combination use and
local bpressed = getkey("str" and "str")
Warning: since getkey is based on GetAsyncKeyState, this function will register a currently depressed key regardless of what application is in the foreground.