![]() |
Divide Framework 0.1
A free and open-source 3D Framework under heavy development
|
#include <SceneInput.h>
Classes | |
struct | KeyLogState |
struct | MouseLogState |
Public Types | |
using | KeyMapCache = hashMap< Input::KeyCode, PressReleaseActionCbks > |
using | MouseMapCache = hashMap< Input::MouseButton, PressReleaseActionCbks > |
using | JoystickMapCacheEntry = ska::bytell_hash_map< JoystickMapKey, PressReleaseActionCbks, JoystickMapKeyHash > |
using | JoystickMapCache = ska::bytell_hash_map< BaseType< Input::Joystick >, JoystickMapCacheEntry > |
using | KeyMap = hashMap< Input::KeyCode, PressReleaseActions > |
using | MouseMap = hashMap< Input::MouseButton, PressReleaseActions > |
using | JoystickMapEntry = ska::bytell_hash_map< JoystickMapKey, PressReleaseActions, JoystickMapKeyHash > |
using | JoystickMap = ska::bytell_hash_map< BaseType< Input::Joystick >, JoystickMapEntry > |
using | KeyLog = vector< KeyLogState > |
using | MouseBtnLog = vector< MouseLogState > |
Public Member Functions | |
SceneInput (Scene &parentScene) | |
bool | onKeyDown (const Input::KeyEvent &arg) override |
Keyboard: return true if input was consumed. | |
bool | onKeyUp (const Input::KeyEvent &arg) override |
bool | joystickButtonPressed (const Input::JoystickEvent &arg) override |
Joystick or Gamepad: return true if input was consumed. | |
bool | joystickButtonReleased (const Input::JoystickEvent &arg) override |
bool | joystickAxisMoved (const Input::JoystickEvent &arg) override |
bool | joystickPovMoved (const Input::JoystickEvent &arg) override |
bool | joystickBallMoved (const Input::JoystickEvent &arg) override |
bool | joystickAddRemove (const Input::JoystickEvent &arg) override |
bool | joystickRemap (const Input::JoystickEvent &arg) override |
bool | mouseMoved (const Input::MouseMoveEvent &arg) override |
Mouse: return true if input was consumed. | |
bool | mouseButtonPressed (const Input::MouseButtonEvent &arg) override |
bool | mouseButtonReleased (const Input::MouseButtonEvent &arg) override |
bool | onTextEvent (const Input::TextEvent &arg) override |
bool | addKeyMapping (Input::KeyCode key, const PressReleaseActions::Entry &keyCbks) |
bool | removeKeyMapping (Input::KeyCode key) |
Returns false if the key wasn't previously assigned. | |
bool | getKeyMapping (Input::KeyCode key, PressReleaseActionCbks &keyCbksOut) |
bool | addMouseMapping (Input::MouseButton button, const PressReleaseActions::Entry &btnCbks) |
bool | removeMouseMapping (Input::MouseButton button) |
Returns false if the button wasn't previously assigned. | |
bool | getMouseMapping (Input::MouseButton button, PressReleaseActionCbks &btnCbksOut) |
bool | addJoystickMapping (Input::Joystick device, Input::JoystickElementType elementType, U32 id, const PressReleaseActions::Entry &btnCbks) |
bool | removeJoystickMapping (Input::Joystick device, Input::JoystickElementType elementType, U32 id) |
Returns false if the button wasn't previously assigned. | |
bool | getJoystickMapping (Input::Joystick device, Input::JoystickElementType elementType, U32 id, PressReleaseActionCbks &btnCbksOut) |
InputActionList & | actionList () noexcept |
U8 | getPlayerIndexForDevice (U8 deviceIndex) const |
void | flushCache () |
void | onPlayerAdd (U8 index) |
void | onPlayerRemove (U8 index) |
void | onSetActive () |
void | onRemoveActive () |
![]() | |
virtual | ~InputAggregatorInterface ()=default |
virtual bool | onKeyDown (const KeyEvent &arg)=0 |
Keyboard: return true if input was consumed. | |
virtual bool | onKeyUp (const KeyEvent &arg)=0 |
virtual bool | mouseMoved (const MouseMoveEvent &arg)=0 |
Mouse: return true if input was consumed. | |
virtual bool | mouseButtonPressed (const MouseButtonEvent &arg)=0 |
virtual bool | mouseButtonReleased (const MouseButtonEvent &arg)=0 |
virtual bool | joystickButtonPressed (const JoystickEvent &arg)=0 |
Joystick or Gamepad: return true if input was consumed. | |
virtual bool | joystickButtonReleased (const JoystickEvent &arg)=0 |
virtual bool | joystickAxisMoved (const JoystickEvent &arg)=0 |
virtual bool | joystickPovMoved (const JoystickEvent &arg)=0 |
virtual bool | joystickBallMoved (const JoystickEvent &arg)=0 |
virtual bool | joystickAddRemove (const JoystickEvent &arg)=0 |
virtual bool | joystickRemap (const JoystickEvent &arg)=0 |
virtual bool | onTextEvent (const TextEvent &arg)=0 |
Protected Member Functions | |
bool | handleCallbacks (const PressReleaseActionCbks &cbks, const InputParams ¶ms, bool onPress) |
Definition at line 74 of file SceneInput.h.
using Divide::SceneInput::JoystickMap = ska::bytell_hash_map<BaseType<Input::Joystick>, JoystickMapEntry> |
Definition at line 85 of file SceneInput.h.
using Divide::SceneInput::JoystickMapCache = ska::bytell_hash_map<BaseType<Input::Joystick>, JoystickMapCacheEntry> |
Definition at line 80 of file SceneInput.h.
using Divide::SceneInput::JoystickMapCacheEntry = ska::bytell_hash_map<JoystickMapKey, PressReleaseActionCbks, JoystickMapKeyHash> |
Definition at line 79 of file SceneInput.h.
using Divide::SceneInput::JoystickMapEntry = ska::bytell_hash_map<JoystickMapKey, PressReleaseActions, JoystickMapKeyHash> |
Definition at line 84 of file SceneInput.h.
using Divide::SceneInput::KeyLog = vector<KeyLogState> |
Definition at line 100 of file SceneInput.h.
Definition at line 82 of file SceneInput.h.
Definition at line 77 of file SceneInput.h.
Definition at line 101 of file SceneInput.h.
Definition at line 83 of file SceneInput.h.
Definition at line 78 of file SceneInput.h.
|
explicit |
Definition at line 38 of file SceneInput.cpp.
|
noexcept |
Definition at line 539 of file SceneInput.cpp.
bool Divide::SceneInput::addJoystickMapping | ( | Input::Joystick | device, |
Input::JoystickElementType | elementType, | ||
U32 | id, | ||
const PressReleaseActions::Entry & | btnCbks | ||
) |
Returns false if the button is already assigned. Call removeJoystickMapping for the specified key first
Definition at line 478 of file SceneInput.cpp.
bool Divide::SceneInput::addKeyMapping | ( | Input::KeyCode | key, |
const PressReleaseActions::Entry & | keyCbks | ||
) |
Returns false if the key is already assigned and couldn't be merged Call removeKeyMapping for the specified key first
Definition at line 400 of file SceneInput.cpp.
bool Divide::SceneInput::addMouseMapping | ( | Input::MouseButton | button, |
const PressReleaseActions::Entry & | btnCbks | ||
) |
Returns false if the button is already assigned. Call removeButtonMapping for the specified key first
Definition at line 439 of file SceneInput.cpp.
void Divide::SceneInput::flushCache | ( | ) |
Definition at line 544 of file SceneInput.cpp.
bool Divide::SceneInput::getJoystickMapping | ( | Input::Joystick | device, |
Input::JoystickElementType | elementType, | ||
U32 | id, | ||
PressReleaseActionCbks & | btnCbksOut | ||
) |
Returns true if the button has a valid mapping and sets the callback output to the mapping's function
Definition at line 507 of file SceneInput.cpp.
bool Divide::SceneInput::getKeyMapping | ( | Input::KeyCode | key, |
PressReleaseActionCbks & | keyCbksOut | ||
) |
Returns true if the key has a valid mapping and sets the callback output to the mapping's function
Definition at line 417 of file SceneInput.cpp.
bool Divide::SceneInput::getMouseMapping | ( | Input::MouseButton | button, |
PressReleaseActionCbks & | btnCbksOut | ||
) |
Returns true if the button has a valid mapping and sets the callback output to the mapping's function
Definition at line 456 of file SceneInput.cpp.
Definition at line 66 of file SceneInput.cpp.
|
protected |
Definition at line 71 of file SceneInput.cpp.
|
overridevirtual |
Implements Divide::Input::InputAggregatorInterface.
Definition at line 268 of file SceneInput.cpp.
|
overridevirtual |
Implements Divide::Input::InputAggregatorInterface.
Definition at line 199 of file SceneInput.cpp.
|
overridevirtual |
Implements Divide::Input::InputAggregatorInterface.
Definition at line 245 of file SceneInput.cpp.
|
overridevirtual |
Joystick or Gamepad: return true if input was consumed.
Implements Divide::Input::InputAggregatorInterface.
Definition at line 172 of file SceneInput.cpp.
|
overridevirtual |
Implements Divide::Input::InputAggregatorInterface.
Definition at line 186 of file SceneInput.cpp.
|
overridevirtual |
Implements Divide::Input::InputAggregatorInterface.
Definition at line 222 of file SceneInput.cpp.
|
overridevirtual |
Implements Divide::Input::InputAggregatorInterface.
Definition at line 273 of file SceneInput.cpp.
|
overridevirtual |
Implements Divide::Input::InputAggregatorInterface.
Definition at line 325 of file SceneInput.cpp.
|
overridevirtual |
Implements Divide::Input::InputAggregatorInterface.
Definition at line 358 of file SceneInput.cpp.
|
overridevirtual |
Mouse: return true if input was consumed.
Implements Divide::Input::InputAggregatorInterface.
Definition at line 278 of file SceneInput.cpp.
|
overridevirtual |
Keyboard: return true if input was consumed.
Implements Divide::Input::InputAggregatorInterface.
Definition at line 108 of file SceneInput.cpp.
|
overridevirtual |
Implements Divide::Input::InputAggregatorInterface.
Definition at line 140 of file SceneInput.cpp.
void Divide::SceneInput::onPlayerAdd | ( | U8 | index | ) |
Definition at line 54 of file SceneInput.cpp.
void Divide::SceneInput::onPlayerRemove | ( | U8 | index | ) |
Definition at line 60 of file SceneInput.cpp.
void Divide::SceneInput::onRemoveActive | ( | ) |
Definition at line 49 of file SceneInput.cpp.
void Divide::SceneInput::onSetActive | ( | ) |
Definition at line 44 of file SceneInput.cpp.
|
overridevirtual |
Implements Divide::Input::InputAggregatorInterface.
Definition at line 390 of file SceneInput.cpp.
bool Divide::SceneInput::removeJoystickMapping | ( | Input::Joystick | device, |
Input::JoystickElementType | elementType, | ||
U32 | id | ||
) |
Returns false if the button wasn't previously assigned.
Definition at line 488 of file SceneInput.cpp.
bool Divide::SceneInput::removeKeyMapping | ( | Input::KeyCode | key | ) |
Returns false if the key wasn't previously assigned.
Definition at line 405 of file SceneInput.cpp.
bool Divide::SceneInput::removeMouseMapping | ( | Input::MouseButton | button | ) |
Returns false if the button wasn't previously assigned.
Definition at line 444 of file SceneInput.cpp.
|
private |
Definition at line 176 of file SceneInput.h.
|
private |
Definition at line 170 of file SceneInput.h.
|
private |
Definition at line 174 of file SceneInput.h.
Definition at line 178 of file SceneInput.h.
|
private |
Definition at line 168 of file SceneInput.h.
|
private |
Definition at line 172 of file SceneInput.h.
|
private |
Definition at line 179 of file SceneInput.h.
|
private |
Definition at line 169 of file SceneInput.h.
|
private |
Definition at line 173 of file SceneInput.h.
|
private |
Definition at line 166 of file SceneInput.h.