- Found in:
- SKSE
Caveats
CK Wiki - Notes
- Use of the input events is much less resource consumptive than polling for Input.IsKeyPressed(...) in an OnUpdate event. Whenever possible, use the events preferentially.
- Avoid using keys already claimed by Skyrim. Invariably, mod added hotkeys will conflict, so it's best to offer a way to rebind your hotkey(s) via Input.GetNthKeyPressed(...) from an Options Menu or other readily accessible means such as a scripted inventory item. This will afford your mod elasticity and allow it to work in tandem with other hotkey bearing mods.
- Using a property to store the Input of the key you are listening for will allow the same script to be easily reused to listen for different keys simultaneously, as this allows the property to be set (or the default value overridden) in the Creation Kit without editing the script's source
Parameters
Examples
RegisterForKey(42) ; L-ShiftAuto-Generated Example
int myInt__keyCode
myForm__toCallFunctionOn.RegisterForKey(myInt__keyCode)