Luanti 5.19.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 v2s32 getMouseMovement ()=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, Settings::registerChangedCallback(), 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.

Referenced by Game::connectToServer(), Game::createServer(), Game::getServerContent(), and Game::processKeyInput().

Here is the caller graph for this function:

◆ clear()

virtual void InputHandler::clear ( )
inlinevirtual

Reimplemented in RealInputHandler.

Referenced by Game::connectToServer(), Game::createServer(), Game::getServerContent(), and Game::processUserInput().

Here is the caller graph for this function:

◆ clearWasKeyPressed()

virtual void InputHandler::clearWasKeyPressed ( )
inlinevirtual

Reimplemented in RealInputHandler.

Referenced by Game::processPlayerInteraction().

Here is the caller graph for this function:

◆ clearWasKeyReleased()

virtual void InputHandler::clearWasKeyReleased ( )
inlinevirtual

Reimplemented in RealInputHandler.

Referenced by Game::processPlayerInteraction().

Here is the caller graph for this function:

◆ getAxisValue()

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

Implemented in RandomInputHandler, and RealInputHandler.

Referenced by Game::getAxisValue(), isKeyDown(), and Game::updateCameraOrientation().

Here is the caller graph for this function:

◆ getMouseMovement()

virtual v2s32 InputHandler::getMouseMovement ( )
pure virtual

Implemented in RandomInputHandler, and RealInputHandler.

Referenced by Game::updateCameraDirection(), and Game::updateCameraOrientation().

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.

Referenced by Game::processItemSelection().

Here is the caller graph for this function:

◆ 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().

Referenced by Game::isKeyDown(), and Game::updateCameraOrientation().

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

◆ isRandom()

virtual bool InputHandler::isRandom ( ) const
inlinevirtual

Reimplemented in RandomInputHandler.

Referenced by Game::nodePlacement(), and Game::updateCameraDirection().

Here is the caller graph for this function:

◆ releaseAllKeys()

virtual void InputHandler::releaseAllKeys ( )
inlinevirtual

Reimplemented in RealInputHandler.

Referenced by Game::processUserInput().

Here is the caller graph for this function:

◆ reloadKeybindings()

virtual void InputHandler::reloadKeybindings ( )
inlinevirtual

Reimplemented in RealInputHandler.

Referenced by settingChangedCallback(), and Game::startup().

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.

Referenced by Game::updateCameraDirection(), and Game::updateCameraOrientation().

Here is the caller graph for this function:

◆ 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.

Referenced by Game::processUserInput().

Here is the caller graph for this function:

◆ wasKeyDown()

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

Implemented in RandomInputHandler, and RealInputHandler.

Referenced by Game::wasKeyDown().

Here is the caller graph for this function:

◆ wasKeyPressed()

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

Implemented in RandomInputHandler, and RealInputHandler.

Referenced by Game::wasKeyPressed().

Here is the caller graph for this function:

◆ wasKeyReleased()

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

Implemented in RandomInputHandler, and RealInputHandler.

Referenced by Game::wasKeyReleased().

Here is the caller graph for this function:

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