The Zandalar project

From CEGUI Wiki - Crazy Eddie's GUI System (Open Source)
Revision as of 22:24, 25 June 2013 by Timotei (Talk | contribs) (Input Aggregator & events)

Jump to: navigation, search

The Zandalar Project is a codename for the new Input archtecture and GUI navigation features.

Input Aggregator & events

Use Cases

The use cases are described by steps. For each step there might be some actions done at different levels:

  • Raw input = the data that comes directly from the input system the application is using (OIS, glfw, etc.).
  • Input Injection = the `InjectedInputReceiver`-ish function called with the right parameters
    • For backwards compatibility-ish, we can persist the same interface(InjectedInputReceiver), but provide in it a default implementation that generates the input events for the current interface's functions.
  • InputEvent = the `InputEvent` type generated from the injected input. This is the final step, and this is fed to the CEGUI library.

Clicking a button using a mouse

Step description Raw input Input Injection InputEvent fed to CEGUI
Move the mouse over the button Mouse movement injectMouseMove/injectMousePosition MovementInputEvent
Press the LMB Mouse button press injectMouseButtonDown(LMB) PressedButtonInputEvent(Mouse_LMB)
Release the LMB Mouse button release injectMouseButtonUp(LMB) ReleasedButtonInputEvent(Mouse_LMB)
The button is clicked (Click event is triggered) N/A N/A N/A

Clicking/activating a button using the keyboard

Step description Raw input Input Injection InputEvent fed to CEGUI
Focus the button Uses the use case "Focus a button using the keyboard/gamepad"
Press the LMB Mouse button press injectMouseButtonDown(LMB) PressedButtonInputEvent(Mouse_LMB)
Release the LMB Mouse button release injectMouseButtonUp(LMB) ReleasedButtonInputEvent(Mouse_LMB)
The button is clicked (Click event is triggered) N/A N/A N/A

Clicking/activating a button using a gamepad

TODO

Type text into a textbox

TODO

Focus a button using the keyboard/gamepad

TODO


Proposed design

Events

For start, the following events will cover all existing functions in the 'InjectedInputReceiver' interface:

MovementInputEvent

  • Data:
    • Position : Vector2
    • Delta : Vector2
  • Functions:
    • injectMouseMove
    • injectMousePosition

PressedButtonInputEvent

  • Data:
    • Button : Buttons Enum/integer or long for maximum flexibility
  • Functions:
    • injectMouseButtonDown
    • injectKeyDown

ReleasedButtonInputEvent

  • Data:
    • Button : Buttons Enum/integer or long for maximum flexibility
  • Functions:
    • injectMouseButtonUp
    • injectKeyUp

ActivatedInputEvent

  • Data:
    • Count (1+) : int
  • Functions:
    • injectMouseButtonClick
    • injectMouseButtonDoubleClick
    • injectMouseButtonTripleClick

TextInputEvent

  • Data:
    • Text : string/char
  • Functions:
    • injectChar

Unmapped (yet) functions:

  • injectMouseLeaves
  • injectMouseWheelChange

Original proposition

Some examples of input events are:

  • MovementInputEvent
    • Generated from mouse x/y
    • Generated from joystick/thumbstick x/y
  • PressedInputEvent
    • Generated from mouse button
    • Generated from keyboard button
    • Generated from a gamepad button


One can see that this solution leads us to allow a variety of input to be mapped to certain input events. Of course, each different input event will have some specific payload (the button pressed, the x/y coordinates of the movement, etc.).




At the end of the day, the samples that exist now should work (from the functionality point of view) the same way after the input system is replaced.