I'm writing a script which i want executed at the press of a button, so i included it in the _tool_list with the 'button' mark.
Here's my question: I want the script to act differently if alt, shift or ctrl are held. How can i accomplish that?
So for example, i have the script included in the _tool_list like this:
button lm_scriptname k
Now i want it to do different things when you press [ctrl] + [k], [alt] + [k] and [shift] + [k].
Ive tried:
Code: Select all
function lm_scriptname:OnKeyDown(moho, keyEvent)
if (keyEvent.altKey) then
print('Alt down')
return
end
end
More importantly, if i press [k] the script runs, but if i press [ctrl] + [k], [alt] + [k] or [shift] + [k] it doesn't.
Any advice anyone? Thanks!