NvInputHandler Class Reference

Maps touch, mouse and gamepad into useful state that can be used to drive various application state, including camera or object interaction. More...

#include <NvInputHandler.h>

Inheritance diagram for NvInputHandler:

NvInputHandler_CameraFly

List of all members.

Public Member Functions

virtual void reset ()=0
 Reset.
virtual void setScreenSize (int32_t width, int32_t height)
 Set screen size.
virtual void update (float deltaTime)=0
 Update the state based on the current inputs, velocities, and delta time.
virtual bool processPointer (NvInputDeviceType::Enum device, NvPointerActionType::Enum action, uint32_t modifiers, int32_t count, NvPointerEvent *points)=0
 Pointer event input.
virtual bool processGamepad (uint32_t changedPadFlags, NvGamepad &pad)=0
 Gamepad event input.
virtual bool processKey (uint32_t code, NvKeyActionType::Enum action)=0
 Key event input.

Protected Attributes

int32_t m_width
int32_t m_height


Detailed Description

Maps touch, mouse and gamepad into useful state that can be used to drive various application state, including camera or object interaction.

Member Function Documentation

virtual bool NvInputHandler::processGamepad ( uint32_t  changedPadFlags,
NvGamepad pad 
) [pure virtual]

Gamepad event input.

Used to pass gamepad state to the transformer. The signature explicitly matches that of the input callbacks used to provide input to an app or app framework for ease of calling

Parameters:
[in] changedPadFlags the changes pad flags
[in] pad the gamepad device
Returns:
true if the event was used and "eaten" by the input transformer and should not be processed by any other input system.

Implemented in NvInputHandler_CameraFly.

virtual bool NvInputHandler::processKey ( uint32_t  code,
NvKeyActionType::Enum  action 
) [pure virtual]

Key event input.

Used to pass key input events to the transformer. The signature explicitly matches that of the input callbacks used to provide input to an app or app framework for ease of calling

Parameters:
[in] code the input keycode
[in] action the input action
Returns:
true if the event was used and "eaten" by the input transformer and should not be processed by any other input system.

Implemented in NvInputHandler_CameraFly.

virtual bool NvInputHandler::processPointer ( NvInputDeviceType::Enum  device,
NvPointerActionType::Enum  action,
uint32_t  modifiers,
int32_t  count,
NvPointerEvent points 
) [pure virtual]

Pointer event input.

Used to pass pointer input events to the handler. The signature explicitly matches that of the input callbacks used to provide input to an app or app framework for ease of calling

Parameters:
[in] device the input device
[in] action the input action
[in] modifiers the input modifiers
[in] count the number of elements in the points array
[in] points the input event points
Returns:
true if the event was used and "eaten" by the input transformer and should not be processed by any other input system.

Implemented in NvInputHandler_CameraFly.

virtual void NvInputHandler::reset (  )  [pure virtual]

Reset.

Reset all input values to default/starting points, restoring initial view.

Implemented in NvInputHandler_CameraFly.

virtual void NvInputHandler::setScreenSize ( int32_t  width,
int32_t  height 
) [inline, virtual]

Set screen size.

Set the current screen size, so that the touch/mouse mapping methods scale correctly. Failure to keep this up to date with the screen size can lead to wildly incorrect mouse/touch mappings

Parameters:
[in] width the new window/screen width
[in] height the new window/screen height

virtual void NvInputHandler::update ( float  deltaTime  )  [pure virtual]

Update the state based on the current inputs, velocities, and delta time.

Parameters:
[in] deltaTime the time since the last call to update, in seconds

Implemented in NvInputHandler_CameraFly.


The documentation for this class was generated from the following file: