Background for Skyrim SE
Member of the Form script
eventOnKeyDown(intkeyCode)

Description

Wiki Description

Listens for the pressing of keys whose Input have been registered via Form.RegisterForKey(...). (This event requires SKSE)


Caveats

CK Wiki - Notes

  • If multiple keys are registered, you'll want to differentiate in the event body as demonstrated above. If only one key will be registered for the form, such differentiation is not necessary.

Parameters

  1. intkeyCode

    CK Wiki Description

    The Input of a key press to listen for.


Examples

Event OnKeyDown(Int KeyCode)
    Debug.Trace("A registered key has been pressed")
    If KeyCode == 42
        Debug.Trace("L-Shift is registered and has been pressed")
    EndIf
EndEvent

Auto-Generated Example

Scriptname MyCoolScript extends Form

event OnKeyDown(int keyCode)
    Debug.trace("Event received - OnKeyDown: keyCode = " + keyCode)
endEvent

Related Pages


Additional References

View this event’s page on the Skyrim Creation Kit Wiki

Some data provided by the Skyrim Creation Kit Wiki. Licensed under the Creative Commons Attribution-ShareAlike license.