IsKeyPressed - Input: Difference between revisions

Jump to navigation Jump to search
m
→‎Notes: Redirected link to input events as they're members of Form
imported>JustinOther
m (→‎Syntax: Oops. This one's a Boolean and not an Int)
imported>JustinOther
m (→‎Notes: Redirected link to input events as they're members of Form)
Line 51: Line 51:
*To avoid multithreading mishaps, it's generally best to use [[RegisterForSingleUpdate - Form|RegisterForSingleUpdate]] rather than [[RegisterForUpdate - Form|RegisterForUpdate]].
*To avoid multithreading mishaps, it's generally best to use [[RegisterForSingleUpdate - Form|RegisterForSingleUpdate]] rather than [[RegisterForUpdate - Form|RegisterForUpdate]].
*If updating at tight intervals, optimization is key as it will make your polling script more responsive. It shouldn't be necessary to update at intervals < 0.25 and doing so just makes a script unnecessarily 'expensive'.
*If updating at tight intervals, optimization is key as it will make your polling script more responsive. It shouldn't be necessary to update at intervals < 0.25 and doing so just makes a script unnecessarily 'expensive'.
*When the [[Input_Script#Events|Input Events]] arrive, they'll be preferable to the above polling methods as their 'cost' will be less.
*Given the [[Form Script#SKSE Events|Input Events]] are available, they'll be preferable to the above polling methods for many applications as their 'cost' will is less.
*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 [[GetNthKeyPressed - 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.
*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 [[GetNthKeyPressed - 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 dxKeycode of the key you are polling will allow the same script to be easily reused to poll for different keys simultaneously, as this allows the dxKeycode to be set (or the default value overridden) in the Creation Kit without editing the script's source
*Using a property to store the dxKeycode of the key you are polling will allow the same script to be easily reused to poll for different keys simultaneously, as this allows the dxKeycode to be set (or the default value overridden) in the Creation Kit without editing the script's source
== See Also ==
== See Also ==
*[[Input Script]]
*[[Input Script]]
*[[GetNumKeysPressed - Input]]
*[[GetNumKeysPressed - Input]]
*[[GetNthKeyPressed - Input]]
*[[GetNthKeyPressed - Input]]
Anonymous user

Navigation menu