ManaPlus
Public Member Functions | Protected Attributes
KeyInput Class Reference

#include <keyinput.h>

Public Member Functions

 KeyInput ()
 
 KeyInput (const KeyInput &k)
 
KeyInputoperator= (const KeyInput &k)
 
 ~KeyInput ()
 
void setType (KeyEventTypeT type)
 
KeyEventTypeT getType () const
 
void setKey (const Key &key)
 
const KeygetKey () const
 
void setActionId (const InputActionT n)
 
InputActionT getActionId () const
 

Protected Attributes

Key mKey
 
KeyEventTypeT mType
 
InputActionT mActionId
 

Detailed Description

Definition at line 80 of file keyinput.h.

Constructor & Destructor Documentation

◆ KeyInput() [1/2]

KeyInput::KeyInput ( )
inline

Definition at line 83 of file keyinput.h.

83  :
84  mKey(0),
86 #ifdef USE_SDL2
87  mText(),
88 #endif // USE_SDL2
90  { }
InputActionT mActionId
Definition: keyinput.h:175
KeyEventTypeT mType
Definition: keyinput.h:169
Key mKey
Definition: keyinput.h:164

◆ KeyInput() [2/2]

KeyInput::KeyInput ( const KeyInput k)
inline

Definition at line 92 of file keyinput.h.

92  :
93  mKey(k.mKey),
94  mType(k.mType),
95 #ifdef USE_SDL2
96  mText(k.mText),
97 #endif // USE_SDL2
99  {
100  }

◆ ~KeyInput()

KeyInput::~KeyInput ( )
inline

Definition at line 115 of file keyinput.h.

116  { }

Member Function Documentation

◆ getActionId()

InputActionT KeyInput::getActionId ( ) const
inline

Definition at line 143 of file keyinput.h.

144  {
145  return mActionId;
146  }

References mActionId.

Referenced by Gui::handleKeyInput().

◆ getKey()

const Key& KeyInput::getKey ( ) const
inline

Definition at line 133 of file keyinput.h.

134  {
135  return mKey;
136  }

References mKey.

Referenced by Gui::handleKeyInput().

◆ getType()

KeyEventTypeT KeyInput::getType ( ) const
inline

Definition at line 123 of file keyinput.h.

124  {
125  return mType;
126  }

References mType.

Referenced by Gui::handleKeyInput().

◆ operator=()

KeyInput& KeyInput::operator= ( const KeyInput k)
inline

Definition at line 104 of file keyinput.h.

105  {
106  mKey = k.mKey;
107  mType = k.mType;
108 #ifdef USE_SDL2
109  mText = k.mText;
110 #endif // USE_SDL2
111  mActionId = k.mActionId;
112  return *this;
113  }

References mActionId, mKey, and mType.

◆ setActionId()

void KeyInput::setActionId ( const InputActionT  n)
inline

Definition at line 138 of file keyinput.h.

139  {
140  mActionId = n;
141  }

References mActionId.

Referenced by SDLInput::convertKeyEventToKey(), and SDLInput::simulateKey().

◆ setKey()

void KeyInput::setKey ( const Key key)
inline

Definition at line 128 of file keyinput.h.

129  {
130  mKey = key;
131  }

References mKey.

Referenced by SDLInput::convertKeyEventToKey(), SDLInput::pushInput(), and SDLInput::simulateKey().

◆ setType()

void KeyInput::setType ( KeyEventTypeT  type)
inline

Definition at line 118 of file keyinput.h.

119  {
120  mType = type;
121  }

References mType.

Referenced by SDLInput::pushInput(), and SDLInput::simulateKey().

Field Documentation

◆ mActionId

InputActionT KeyInput::mActionId
protected

Definition at line 175 of file keyinput.h.

Referenced by getActionId(), operator=(), and setActionId().

◆ mKey

Key KeyInput::mKey
protected

Holds the key of the key input.

Definition at line 164 of file keyinput.h.

Referenced by getKey(), operator=(), and setKey().

◆ mType

KeyEventTypeT KeyInput::mType
protected

Holds the type of the key input.

Definition at line 169 of file keyinput.h.

Referenced by getType(), operator=(), and setType().


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