Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
1.2.0:inputpolling [2024/01/24 08:39] admin1.2.0:inputpolling [2024/01/24 08:49] (current) – [Feedback Event Methods] admin
Line 124: Line 124:
 ===== Input-Codes for HotKeys ===== ===== Input-Codes for HotKeys =====
  
-All available InputCodes for HotKeys are defined in the Gorilla.Controller.Input.Consts unit.+All available InputCodes (**TGorillaInputCode**) for HotKeys are defined in the Gorilla.Controller.Input.Consts unit.
  
 ==== Keyboard ==== ==== Keyboard ====
Line 327: Line 327:
 |OnGamePadButtonDown |TGorillaInputGamePadButtonEvent|Raw gamepad button down callback thrown by gamepad handler. This event will be synchronized with main thread context.| |OnGamePadButtonDown |TGorillaInputGamePadButtonEvent|Raw gamepad button down callback thrown by gamepad handler. This event will be synchronized with main thread context.|
 |OnGamePadButtonUp |TGorillaInputGamePadButtonEvent|Raw gamepad button up callback thrown by gamepad handler. This event will be synchronized with main thread context.| |OnGamePadButtonUp |TGorillaInputGamePadButtonEvent|Raw gamepad button up callback thrown by gamepad handler. This event will be synchronized with main thread context.|
-|OnGamePadTrigger |TGorillaInputGamePadTriggerEvent|Raw gamepad trigger callback thrown by gamepad handler. This event will be synchronized with main thread context.| +|OnGamePadTrigger |TGorillaInputGamePadTriggerEvent|Raw gamepad trigger callback thrown by gamepad handler. This event will be synchronized with main thread context. AState = (GORILLA_INPUT_GAMEPAD_TRIGGER_LEFT, GORILLA_INPUT_GAMEPAD_TRIGGER_RIGHT)
-|OnGamePadFeedback |TGorillaInputGamePadFeedbackEvent|Raw gamepad feeback callback for receiving thumbstick position, thrown by gamepad handler. This event will be synchronized with main thread context.|+|OnGamePadFeedback |TGorillaInputGamePadFeedbackEvent|Raw gamepad feeback callback for receiving thumbstick position, thrown by gamepad handler. This event will be synchronized with main thread context. AState = (GORILLA_INPUT_GAMEPAD_THUMBSTICK_POS_LEFT, GORILLA_INPUT_GAMEPAD_THUMBSTICK_POS_RIGHT)|
  
 ==== Feedback Event Methods ==== ==== Feedback Event Methods ====
  
-Declaring a feedback event method needs further unit integration in most cases for the used types an constants:+Declaring a feedback event method needs further unit integration in most cases for the used types and constants:
   * Gorilla.Controller   * Gorilla.Controller
   * Gorilla.Controller.Input.Consts   * Gorilla.Controller.Input.Consts
   * Gorilla.Controller.Input.Types   * Gorilla.Controller.Input.Types
  
-^Type^Declaration^ +^Type^Declaration^Notice
-|TGorillaInputMouseEvent |procedure(ASender : TObject; AStates : TGorillaMouseStates; APos : TPointF) of object;| +|TGorillaInputMouseEvent |procedure(ASender : TObject; AStates : TGorillaMouseStates; APos : TPointF) of object;|For available mouse states, read more [[#Types|here]]
-|GorillaInputMouseMoveEvent|procedure(ASender : TObject; AStates : TGorillaMouseStates; APos : TPointF) of object;| +|GorillaInputMouseMoveEvent|procedure(ASender : TObject; AStates : TGorillaMouseStates; APos : TPointF) of object;|For available mouse states, read more [[#Types|here]]
-|TGorillaInputMouseWheelEvent|procedure(ASender : TObject; APos : TPointF; const AWheelDelta : Integer) of object;| +|TGorillaInputMouseWheelEvent|procedure(ASender : TObject; APos : TPointF; const AWheelDelta : Integer) of object;
-|TGorillaInputKeyEvent |procedure(ASender : TObject; AKeyCode : Integer) of object;| +|TGorillaInputKeyEvent |procedure(ASender : TObject; AKeyCode : Integer) of object;
-|TGorillaInputGamePadEvent|procedure(ASender : TObject; AState : TGorillaInputCode; AUser : Integer) of object;| +|TGorillaInputGamePadEvent|procedure(ASender : TObject; AState : TGorillaInputCode; AUser : Integer) of object;
-|TGorillaInputGamePadButtonEvent|procedure(ASender : TObject; AState : TGorillaInputCode; AButtons : TGorillaGamePadButtons) of object;| +|TGorillaInputGamePadButtonEvent|procedure(ASender : TObject; AState : TGorillaInputCode; AButtons : TGorillaGamePadButtons) of object;|For available gamepad buttons, read more [[#Types|here]] 
-|TGorillaInputGamePadTriggerEvent|procedure(ASender : TObject; AState : TGorillaInputCode; const AButtons : TGorillaGamePadButtons; AValue : Byte; AFlags : UInt64) of object;| +|TGorillaInputGamePadTriggerEvent|procedure(ASender : TObject; AState : TGorillaInputCode; const AButtons : TGorillaGamePadButtons; AValue : Byte; AFlags : UInt64) of object;|AState = (GORILLA_INPUT_GAMEPAD_TRIGGER_LEFT, GORILLA_INPUT_GAMEPAD_TRIGGER_RIGHT)
-|TGorillaInputGamePadFeedbackEvent|procedure(ASender : TObject; AState : TGorillaInputCode; const AButtons : TGorillaGamePadButtons; APos : TPointF; AFlags : UInt64) of object;|+|TGorillaInputGamePadFeedbackEvent|procedure(ASender : TObject; AState : TGorillaInputCode; const AButtons : TGorillaGamePadButtons; APos : TPointF; AFlags : UInt64) of object;|AState = (GORILLA_INPUT_GAMEPAD_THUMBSTICK_POS_LEFT, GORILLA_INPUT_GAMEPAD_THUMBSTICK_POS_RIGHT)|
  
 +
 +==== Types ====
 +
 +<file Pascal>
 +TGorillaInputMode = (Activated, Deactivated);
 +
 +  TGorillaMouseState = (LButtonDown, LButtonUp, RButtonDown, RButtonUp,
 +    MButtonDown, MButtonUp, X1ButtonDown, X1ButtonUp, X2ButtonDown, X2ButtonUp,
 +    LButtonDblClick, RButtonDblClick, MButtonDblClick, X1ButtonDblClick,
 +    X2ButtonDblClick, MouseMove, MouseWheel);
 +
 +TGorillaMouseStates = set of TGorillaMouseState;
 +  
 +TGorillaGamePadButton = (
 +    None,
 +    // directional pad up
 +    DPadUp,
 +    // directional pad down
 +    DPadDown,
 +    // directional pad left
 +    DPadLeft,
 +    // directional pad right
 +    DPadRight,
 +    // start button
 +    StartButton,
 +    // mode button
 +    ModeButton,
 +    // back button
 +    BackButton,
 +    // left thumbstick pressed
 +    LeftThumbStick,
 +    // right thumbstick pressed
 +    RightThumbStick,
 +    // left shoulder button
 +    LeftShoulder,
 +    // right shoulder button
 +    RightShoulder,
 +    // button A
 +    ButtonA,
 +    // button B
 +    ButtonB,
 +    // button X
 +    ButtonX,
 +    // button Y
 +    ButtonY
 +    );
 +    
 +TGorillaGamePadButtons = set of TGorillaGamePadButton;
 +</file>
 ===== Debugging-Issue ===== ===== Debugging-Issue =====