ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


input_functions

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
input_functions [2017/04/15 18:18]
korshun
input_functions [2017/07/09 15:47] (current)
korshun
Line 1: Line 1:
 ====== Input functions ====== ====== Input functions ======
-===== Introduction =====+
 ACSUtils provides a simplified interface to [[zdoom>GetPlayerInput]]. ACSUtils provides a simplified interface to [[zdoom>GetPlayerInput]].
 +
 +===== Function list =====
 +
 +A full list of new input functions:
 +
 +^ ^ Key ^ KeyAny ^ PlayerKey ^ PlayerKeyAny ^
 +^ up|[[functions:KeyUp]]|[[functions:KeyUpAny]]|[[functions:PlayerKeyUp]]|[[functions:PlayerKeyUpAny]]|
 +^ down|[[functions:KeyDown]]|[[functions:KeyDownAny]]|[[functions:PlayerKeyDown]]|[[functions:PlayerKeyDownAny]]|
 +^ pressed|[[functions:KeyPressed]]|[[functions:KeyPressedAny]]|[[functions:PlayerKeyPressed]]|[[functions:PlayerKeyPressedAny]]|
 +^ released|[[functions:KeyReleased]]|[[functions:KeyReleasedAny]]|[[functions:PlayerKeyReleased]]|[[functions:PlayerKeyReleasedAny]]|
 +^ toggled|[[functions:KeyToggled]]|[[functions:KeyToggledAny]]|[[functions:PlayerKeyToggled]]|[[functions:PlayerKeyToggledAny]]|
 +
 +===== Introduction =====
  
 Each key can be Each key can be
   * **Up** or **down** at any moment.   * **Up** or **down** at any moment.
-  * **Pressed**, if it was up during the previous tick but is now down. +  * **Pressed**, if it was **up** during the previous tick but is now **down**
-  * **Released**, if it was down during the previous tick but is now up.+  * **Released**, if it was **down** during the previous tick but is now **up**. 
 +  * **Toggled**, if it is **pressed** or **released**.
  
 Pressed and released states are especially useful for menus as they allow the user to perform the action as many times as the key was pressed. Pressed and released states are especially useful for menus as they allow the user to perform the action as many times as the key was pressed.
Line 34: Line 48:
 will move the menu cursor down as many times as the key was hit. will move the menu cursor down as many times as the key was hit.
  
-===== Functions =====+===== Conventions =====
  
 ACSUtils provides a set of functions using the following convention: ACSUtils provides a set of functions using the following convention:
Line 47: Line 61:
   - If multiple keys are passed in (e.g. ''BT_ATTACK | BT_ALTATTACK''), then functions with the **Any** suffix return true if any of them are in the needed state, while functions without the suffix return true only if all of them are.   - If multiple keys are passed in (e.g. ''BT_ATTACK | BT_ALTATTACK''), then functions with the **Any** suffix return true if any of them are in the needed state, while functions without the suffix return true only if all of them are.
   - If the **Player** prefix is present, the function checks the keys of the specified player. Functions without the prefix check the activator's keys (equivalent to passing -1 to [[zdoom>GetPlayerInput]].   - If the **Player** prefix is present, the function checks the keys of the specified player. Functions without the prefix check the activator's keys (equivalent to passing -1 to [[zdoom>GetPlayerInput]].
- 
-===== Function list ===== 
- 
-A full list of new input functions: 
- 
-^ ^ KeyState ^ KeyStateAny ^ PlayerKeyState^ PlayerKeyStateAny ^ 
-^ up|[[functions:KeyUp]]|[[functions:KeyUpAny]]|[[functions:PlayerKeyUp]]|[[functions:PlayerKeyUpAny]]| 
-^ down|[[functions:KeyDown]]|[[functions:KeyDownAny]]|[[functions:PlayerKeyDown]]|[[functions:PlayerKeyDownAny]]| 
-^ pressed|[[functions:KeyPressed]]|[[functions:KeyPressedAny]]|[[functions:PlayerKeyPressed]]|[[functions:PlayerKeyPressedAny]]| 
-^ released|[[functions:KeyReleased]]|[[functions:KeyReleasedAny]]|[[functions:PlayerKeyReleased]]|[[functions:PlayerKeyReleasedAny]]| 
  
  
input_functions.1492269486.txt.gz · Last modified: 2017/04/15 18:18 by korshun