Difference between revisions of "Legacy:Functions/Map/Input"

From Spherical
Jump to: navigation, search
(created, needs reformatting)
 
(Binding scripts to input devices: fix function name)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==== Player input ====
 
==== Player input ====
  
* [[API:AttachInput]](''person''): Give input control of ''person'' to the player.
+
* [[API:GetInputPerson|GetInputPerson]](): Get the name of the person who holds player input.
* [[API:DetachInput]](): Remove input control given by [[AttachInput]]() or [[AttachPlayerInput]]().
+
* [[API:IsInputAttached|IsInputAttached]](): Check if input is attached to a person or not.
 +
* [[API:AttachInput|AttachInput]](''person''): Give input control of ''person'' to the player.
 +
* [[API:DetachInput|DetachInput]](): Remove input control given by [[API:AttachInput|AttachInput]]() or [[API:AttachPlayerInput|AttachPlayerInput]]().
 +
* [[API:AttachPlayerInput|AttachPlayerInput]](''person'', ''player''): Give input control of ''person'' to ''player''.
 +
* [[API:DetachPlayerInput|DetachPlayerInput]](''person''): Remove input control from ''person'' given to a player.
  
* [[API:AttachPlayerInput]](''person'', ''player''): Give input control of ''person'' to ''player''.
+
==== Binding scripts to input devices ====
* [[API:DetachPlayerInput]](''person''): Remove input control from ''person'' given to a player.
+
'''Note''': Binding a key or joystick button overrides whatever input has already been associated with it via [[API:AttachInput|AttachInput]] or [[API:AttachPlayerInput|AttachPlayerInput]]!
  
* [[API:IsInputAttached]](): Check if input is attached to a person or not.
+
* [[API:BindKey|BindKey]](''key'', ''on_key_down'', ''on_key_up''): Bind scripts to key events.
* [[API:GetInputPerson]](): Get the name of the person who holds player input.
+
* [[API:UnbindKey|UnbindKey]](''key''): Remove script binding from the given ''key''.
  
==== Binding scripts to keys ====
+
* [[API:BindJoystickButton|BindJoystickButton]](''joystick'', ''button'', ''on_button_down'', ''on_button_up''): Bind scripts to joystick button events.
 
+
* [[API:UnbindJoystickButton|UnbindJoystickButton]](joystick, button): Unbind joystick buttons from scripts.
* [[API:BindKey]](''key'', ''on_key_down'', ''on_key_up''): Bind scripts to key events.
 
* [[API:UnbindKey]](''key''): Remove script binding from the given ''key''.
 
 
 
==== Binding scripts to joystick buttons ====
 
 
 
* [[API:BindJoystickButton]](''joystick'', ''button'', ''on_button_down'', ''on_button_up''): Bind scripts to joystick button events.
 
* [[API:UnbindJoystickButton]](joystick, button): Unbind joystick buttons from scripts.
 

Latest revision as of 23:54, 1 June 2013

Player input

Binding scripts to input devices

Note: Binding a key or joystick button overrides whatever input has already been associated with it via AttachInput or AttachPlayerInput!

  • BindKey(key, on_key_down, on_key_up): Bind scripts to key events.
  • UnbindKey(key): Remove script binding from the given key.