Type Boolean Event key Revision 2017.3060 Keywords key, isCtrlDown See also event.isAltDown event.isShiftDown event.isCommandDown
Indicates if the Control key was held down at the time the key event occurred. Note that this property is guaranteed to return true
if the key that was just pressed down was leftCtrl
or rightCtrl
.
-- Called when a key event has been received local function onKeyEvent( event ) if event.isCtrlDown then -- The Control key was held down for the given key else -- The Control key was not held down for the given key end return false end -- Add the key event listener Runtime:addEventListener( "key", onKeyEvent )