CoSMOS
Documentation
×
Menu

whileKeyIsDown

Description:

 
Executes lua code while a key is held down. This locks up the current thread as long as the key is held down.
 

Command Parameters:

 
Parameter
Type
Description
key
byte
The key that is held down
lua code
string
The lua code that is constantly executed while key is held down
modifier
int
Optional: Modifier key, default = none
 
Modifier
Value
None
0
Alt
1
Control
2
Shift
4
Windows
8
 

Examples:

 
local luaCode = [[local message = 'Hello World'
print(message)]]
local key = 0x2D --insert
whileKeyIsDown(key, luaCode)