You.i Engine
Input

Detailed Description

Provides an interface to various input methods.

The input classes of You.i Engine provide an interface to gamepads as well as other platform input methods. They provide access to various properties related to input devices. These classes only provide an interface to input devices and do not perform any input handling see Events for details on handling input.

Back Button Handling

In You.i Engine back button handling is separate from the event system. This separation is in place to gracefully handle the case where the back button press should be handled by the platform. The CYIBackButtonHandler is responsible for handling back button presses. Listeners can be added to the handler and respond with whether or not they handled the back button press. If no listener responds that they have handled the back button press the press will be passed on to the platform to handle. For example, on the Android platform if no listener claims to have handled the back button press the application will be sent to the background following the standard application lifecycle of the Android platform. The following snippet displays an example implementation of a class which handles back button presses:

    class Transition : public CYIBackButtonHandler::Listener
    {
    public:
        Transition()
        {
            // Add this class as a listener for back button presses.
            CYIBackButtonHandler::AddListener(this);
        };

        ~Transition()
        {
            // Clean-up by removing this class as a listener for back button presses.
            CYIBackButtonHandler::RemoveListener(this);
        };

    protected:
        // The callback method which will receive back button events from the platform. 
        bool OnBackButtonPressed()
        {
            // Log that the press has been received and return that this object has 
            // handled the back button press.
            YI_LOG("Transition", "Received a back button event.")
            return true;
        };
    };

Software Keyboard

You.i Engine interacts with the platform's sofware keyboard through the CYIKeyboardInputBridge. This class is responsible for displaying the platform's software keyboard and accepts characters which are entered. Characters entered are provided to the CYIKeyboardInputBridge::Receiver. The CYITextEditView is currently the only view which makes use of the platform's software keyboard.

Gamepads

On some platforms, specifically game consoles, input is provided by a gamepad. The CYIGamePad class represents a gamepad and can be queried to determine the gamepad's current state. The CYIGamePad provides this information in the form of CYIGamePadButton objects. The CYIGamePadButton represents an individual button of the gamepad and its current state. The platforms which currently have a CYIGamePad implementation are as follows:

Cursor Input

Some platforms provide the option of using a cursor to navigate through an application. To provide a seamless navigation experience there are various user interface elements that should be updated when a user switches to a cursor input method. One example of this is enabling a soft back button when the user has started using a cursor input method. The CYICursorInput class provides information about the current cursor state. Currently the only supported platform which allows for a change between cursor input and key input at run-time is LG WebOS.

Classes

class  CYIBackButtonHandler
 Intercepts the system back button notification. More...
 
class  CYIGamePad
 
class  CYIGamePadButton
 
class  CYIGamePadExtendedButtons
 
class  CYICursorInputBridge
 Utility to subscribe to or get the current state of the cursor for the platform, if available. More...
 
class  CYIKeyboardInputBridge
 Provides access to the system software keyboard. More...
 

Macros

#define DEFAULT_DEADZONE_VALUE   0.25f
 

Macro Definition Documentation

#define DEFAULT_DEADZONE_VALUE   0.25f