Nebula
Loading...
Searching...
No Matches
Input::InputEvent Class Reference

#include <inputevent.h>

Detailed Description

The input events of the Input subsystems.

Input events are generated by the InputServer and travel through the input handler chain where they are processed.

Public Types

enum  Type {
  InvalidType = 0 , AppObtainFocus , AppLoseFocus , Reset ,
  KeyDown , KeyUp , Character , MouseMove ,
  RawMouseMove , MouseButtonDown , MouseButtonUp , MouseButtonDoubleClick ,
  MouseWheelForward , MouseWheelBackward , BeginMouseCapture , EndMouseCapture ,
  BeginKeyboardCapture , EndKeyboardCapture , GamePadButtonDown , GamePadButtonUp
}
 input event types More...
 

Public Member Functions

 InputEvent ()
 default constructor
 
void SetType (Type t)
 set event type
 
Type GetType () const
 get event type
 
void SetKey (Key::Code key)
 set key code
 
Key::Code GetKey () const
 get key code
 
void SetChar (Char chr)
 set character code
 
Char GetChar () const
 get character code
 
void SetMouseButton (MouseButton::Code button)
 set button code
 
MouseButton::Code GetMouseButton () const
 get button code
 
void SetDeviceIndex (IndexT i)
 set optional device index (e.g. player index for game pads)
 
IndexT GetDeviceIndex () const
 get device index
 
void SetAbsMousePos (const Math::vec2 &p)
 set absolute pixel mouse position
 
const Math::vec2GetAbsMousePos () const
 get absolute pixel mouse position
 
void SetNormMousePos (const Math::vec2 &p)
 set normalized mouse position
 
const Math::vec2GetNormMousePos () const
 get normalized mouse position
 

Static Public Member Functions

static const char * TypeToString (Type t)
 convert type to string
 

Private Attributes

Type type
 
Key::Code keyCode
 
Char character
 
IndexT deviceIndex
 
MouseButton::Code mouseButton
 
Math::vec2 absMousePos
 
Math::vec2 normMousePos
 

Member Enumeration Documentation

◆ Type

input event types

Enumerator
InvalidType 
AppObtainFocus 
AppLoseFocus 
Reset 
KeyDown 
KeyUp 
Character 
MouseMove 
RawMouseMove 
MouseButtonDown 
MouseButtonUp 
MouseButtonDoubleClick 
MouseWheelForward 
MouseWheelBackward 
BeginMouseCapture 
EndMouseCapture 
BeginKeyboardCapture 
EndKeyboardCapture 
GamePadButtonDown 
GamePadButtonUp 

Constructor & Destructor Documentation

◆ InputEvent()

Input::InputEvent::InputEvent ( )
inline

default constructor

Member Function Documentation

◆ GetAbsMousePos()

const Math::vec2 & Input::InputEvent::GetAbsMousePos ( ) const
inline

get absolute pixel mouse position

◆ GetChar()

Char Input::InputEvent::GetChar ( ) const
inline

get character code

◆ GetDeviceIndex()

IndexT Input::InputEvent::GetDeviceIndex ( ) const
inline

get device index

◆ GetKey()

Key::Code Input::InputEvent::GetKey ( ) const
inline

get key code

◆ GetMouseButton()

MouseButton::Code Input::InputEvent::GetMouseButton ( ) const
inline

get button code

◆ GetNormMousePos()

const Math::vec2 & Input::InputEvent::GetNormMousePos ( ) const
inline

get normalized mouse position

◆ GetType()

InputEvent::Type Input::InputEvent::GetType ( ) const
inline

get event type

◆ SetAbsMousePos()

void Input::InputEvent::SetAbsMousePos ( const Math::vec2 & p)
inline

set absolute pixel mouse position

◆ SetChar()

void Input::InputEvent::SetChar ( Char chr)
inline

set character code

◆ SetDeviceIndex()

void Input::InputEvent::SetDeviceIndex ( IndexT i)
inline

set optional device index (e.g. player index for game pads)

◆ SetKey()

void Input::InputEvent::SetKey ( Key::Code key)
inline

set key code

◆ SetMouseButton()

void Input::InputEvent::SetMouseButton ( MouseButton::Code button)
inline

set button code

◆ SetNormMousePos()

void Input::InputEvent::SetNormMousePos ( const Math::vec2 & p)
inline

set normalized mouse position

◆ SetType()

void Input::InputEvent::SetType ( Type t)
inline

set event type

◆ TypeToString()

const char * Input::InputEvent::TypeToString ( Type t)
inlinestatic

convert type to string

Member Data Documentation

◆ absMousePos

Math::vec2 Input::InputEvent::absMousePos
private

◆ character

Char Input::InputEvent::character
private

◆ deviceIndex

IndexT Input::InputEvent::deviceIndex
private

◆ keyCode

Key::Code Input::InputEvent::keyCode
private

◆ mouseButton

MouseButton::Code Input::InputEvent::mouseButton
private

◆ normMousePos

Math::vec2 Input::InputEvent::normMousePos
private

◆ type

Type Input::InputEvent::type
private

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