Mod:Creation Kit/OnKeyDown - ScriptObject

F4SE Member of: Mod:Creation Kit/ScriptObject Script

Listens for the pressing of keys whose Scan Codes have been registered via RegisterForKey.

Syntax
Event OnKeyDown(int keyCode)

Parameters

 * keyCode: The Scan Code of a key press to listen for.

Examples
Event OnKeyDown(int keyCode) If (keyCode == 160) Debug.Trace("The left shift key has been pressed.") ElseIf (keyCode == 161) Debug.Trace("The right shift key has been pressed.") Else Debug.Trace("The keycode '"+keyCode+"' has been pressed.") EndIf EndEvent