Luanti 5.17.0-dev
Loading...
Searching...
No Matches
InputHandler Class Referenceabstract

#include <inputhandler.h>

Inheritance diagram for InputHandler:

Public Member Functions

 InputHandler ()
virtual ~InputHandler ()=default
virtual bool isRandom () const
virtual float getAxisValue (GameKeyType k)=0
virtual bool isKeyDown (GameKeyType k)
virtual bool wasKeyDown (GameKeyType k)=0
virtual bool wasKeyPressed (GameKeyType k)=0
virtual bool wasKeyReleased (GameKeyType k)=0
virtual bool cancelPressed ()=0
virtual void clearWasKeyPressed ()
virtual void clearWasKeyReleased ()
virtual void reloadKeybindings ()
virtual v2s32 getMousePos ()=0
virtual void setMousePos (s32 x, s32 y)=0
virtual s32 getMouseWheel ()=0
virtual void step (float dtime)
virtual void clear ()
virtual void releaseAllKeys ()

Static Public Member Functions

static s16 analogToInt (float value)
static float intToAnalog (s16 value)
static void settingChangedCallback (const std::string &name, void *data)

Constructor & Destructor Documentation

◆ InputHandler()

InputHandler::InputHandler ( )

References g_settings, Settings::getLayer(), input_settings, settingChangedCallback(), SL_DEFAULTS, and str_starts_with().

Referenced by settingChangedCallback().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~InputHandler()

virtual InputHandler::~InputHandler ( )
virtualdefault

Member Function Documentation

◆ analogToInt()

s16 InputHandler::analogToInt ( float value)
inlinestatic

Referenced by TouchControls::emitGameKeyEvent().

Here is the caller graph for this function:

◆ cancelPressed()

virtual bool InputHandler::cancelPressed ( )
pure virtual

Implemented in RandomInputHandler, and RealInputHandler.

◆ clear()

virtual void InputHandler::clear ( )
inlinevirtual

Reimplemented in RealInputHandler.

◆ clearWasKeyPressed()

virtual void InputHandler::clearWasKeyPressed ( )
inlinevirtual

Reimplemented in RealInputHandler.

◆ clearWasKeyReleased()

virtual void InputHandler::clearWasKeyReleased ( )
inlinevirtual

Reimplemented in RealInputHandler.

◆ getAxisValue()

virtual float InputHandler::getAxisValue ( GameKeyType k)
pure virtual

Implemented in RandomInputHandler, and RealInputHandler.

Referenced by isKeyDown().

Here is the caller graph for this function:

◆ getMousePos()

virtual v2s32 InputHandler::getMousePos ( )
pure virtual

Implemented in RandomInputHandler, and RealInputHandler.

◆ getMouseWheel()

virtual s32 InputHandler::getMouseWheel ( )
pure virtual

Implemented in RandomInputHandler, and RealInputHandler.

◆ intToAnalog()

float InputHandler::intToAnalog ( s16 value)
inlinestatic

Referenced by MyEventReceiver::OnEvent().

Here is the caller graph for this function:

◆ isKeyDown()

virtual bool InputHandler::isKeyDown ( GameKeyType k)
inlinevirtual

References getAxisValue().

Here is the call graph for this function:

◆ isRandom()

virtual bool InputHandler::isRandom ( ) const
inlinevirtual

Reimplemented in RandomInputHandler.

◆ releaseAllKeys()

virtual void InputHandler::releaseAllKeys ( )
inlinevirtual

Reimplemented in RealInputHandler.

◆ reloadKeybindings()

virtual void InputHandler::reloadKeybindings ( )
inlinevirtual

Reimplemented in RealInputHandler.

Referenced by settingChangedCallback().

Here is the caller graph for this function:

◆ setMousePos()

virtual void InputHandler::setMousePos ( s32 x,
s32 y )
pure virtual

Implemented in RandomInputHandler, and RealInputHandler.

References x, and y.

◆ settingChangedCallback()

void InputHandler::settingChangedCallback ( const std::string & name,
void * data )
inlinestatic

References InputHandler(), and reloadKeybindings().

Referenced by InputHandler().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ step()

virtual void InputHandler::step ( float dtime)
inlinevirtual

Reimplemented in RandomInputHandler.

◆ wasKeyDown()

virtual bool InputHandler::wasKeyDown ( GameKeyType k)
pure virtual

Implemented in RandomInputHandler, and RealInputHandler.

◆ wasKeyPressed()

virtual bool InputHandler::wasKeyPressed ( GameKeyType k)
pure virtual

Implemented in RandomInputHandler, and RealInputHandler.

◆ wasKeyReleased()

virtual bool InputHandler::wasKeyReleased ( GameKeyType k)
pure virtual

Implemented in RandomInputHandler, and RealInputHandler.


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