Difference between revisions of "OnControlDown"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Haama
(Extra info on pressing both keys at the same time)
imported>Shademe
m (→‎Notes: Minor note added)
 
(4 intermediate revisions by 3 users not shown)
Line 6: Line 6:
  (controlPressed:bool) OnControlDown whichControl:short
  (controlPressed:bool) OnControlDown whichControl:short


Registers a script as a listener for input events. Returns 1 for one frame when the key and/or mouse button assigned to the Control ID is pressed. If used by multiple scripts, each script will be informed of the Control key's state. Will not return true again until the key (and/or keys) is released and then pressed again.
Registers a script as a listener for input events. Returns 1 once when the key and/or mouse button assigned to the Control ID is pressed. If used by multiple scripts, each script will be informed of the Control key's state. Will not return true again until the key (and/or keys) is released and then pressed again.
 
==Notes==
*Like [[GetGameLoaded]] and [[GetSecondsPassed]], this returns 1 the first time per script, and 0 each subsequent call (from the same script).
*Can detect keys disabled via [[DisableKey]] or [[DisableControl]] but not those tapped via [[TapKey]] or [[TapControl]].
:*This function did not detect disabled keys prior to OBSE 13


==Control IDs==
==Control IDs==
Line 41: Line 46:


==See Also==
==See Also==
*[[DisableControl]]
*[[IsKeyPressed]]
*[[EnableControl]]
*[[IsKeyPressed2]]
*[[GetAltControl]]
*[[IsKeyPressed3]]
*[[GetControl]]
*[[IsControlPressed]]
*[[IsControlPressed]]
*[[RefreshControlMap]]
*[[OnKeyDown]]
*[[TapControl]]


[[Category: Functions]]
[[Category: Functions]]

Latest revision as of 11:44, 25 December 2008


A command for Oblivion Script Extender

Syntax:

(controlPressed:bool) OnControlDown whichControl:short

Registers a script as a listener for input events. Returns 1 once when the key and/or mouse button assigned to the Control ID is pressed. If used by multiple scripts, each script will be informed of the Control key's state. Will not return true again until the key (and/or keys) is released and then pressed again.

Notes[edit | edit source]

  • This function did not detect disabled keys prior to OBSE 13

Control IDs[edit | edit source]

Forward 0
Back 1
Slide Left 2
Slide Right 3
Attack 4
Activate 5
Block 6
Cast 7
Ready Weapon 8
Crouch/Sneak 9
Run 10
Always Run 11
Auto Move 12
Jump 13
Toggle POV 14
Menu Mode 15
Rest 16
Quick Menu 17
Quick1 18
Quick2 19
Quick3 20
Quick4 21
Quick5 22
Quick6 23
Quick7 24
Quick8 25
QuickSave 26
QuickLoad 27
Grab 28

See Also[edit | edit source]