Minetest  5.4.0
MyEventReceiver Class Reference

#include <inputhandler.h>

+ Inheritance diagram for MyEventReceiver:
+ Collaboration diagram for MyEventReceiver:

Public Member Functions

virtual bool OnEvent (const SEvent &event)
 
bool IsKeyDown (const KeyPress &keyCode) const
 
bool WasKeyDown (const KeyPress &keyCode)
 
bool WasKeyPressed (const KeyPress &keycode) const
 
bool WasKeyReleased (const KeyPress &keycode) const
 
void listenForKey (const KeyPress &keyCode)
 
void dontListenForKeys ()
 
s32 getMouseWheel ()
 
void clearInput ()
 
void clearWasKeyPressed ()
 
void clearWasKeyReleased ()
 
 MyEventReceiver ()
 

Public Attributes

s32 mouse_wheel = 0
 
JoystickControllerjoystick = nullptr
 

Private Attributes

KeyList keyIsDown
 
KeyList keyWasDown
 
KeyList keyWasPressed
 
KeyList keyWasReleased
 
KeyList keysListenedFor
 

Constructor & Destructor Documentation

◆ MyEventReceiver()

MyEventReceiver::MyEventReceiver ( )
inline

Member Function Documentation

◆ clearInput()

void MyEventReceiver::clearInput ( )
inline

References KeyList::clear(), keyIsDown, keyWasDown, keyWasPressed, keyWasReleased, and mouse_wheel.

Referenced by RealInputHandler::clear().

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

◆ clearWasKeyPressed()

void MyEventReceiver::clearWasKeyPressed ( )
inline

References KeyList::clear(), and keyWasPressed.

Referenced by RealInputHandler::clearWasKeyPressed().

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

◆ clearWasKeyReleased()

void MyEventReceiver::clearWasKeyReleased ( )
inline

References KeyList::clear(), and keyWasReleased.

Referenced by RealInputHandler::clearWasKeyReleased().

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

◆ dontListenForKeys()

void MyEventReceiver::dontListenForKeys ( )
inline

References KeyList::clear(), and keysListenedFor.

Referenced by RealInputHandler::dontListenForKeys().

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

◆ getMouseWheel()

s32 MyEventReceiver::getMouseWheel ( )
inline

References mouse_wheel.

Referenced by RealInputHandler::getMouseWheel().

+ Here is the caller graph for this function:

◆ IsKeyDown()

bool MyEventReceiver::IsKeyDown ( const KeyPress keyCode) const
inline

References keyIsDown.

Referenced by RealInputHandler::isKeyDown(), and OnEvent().

+ Here is the caller graph for this function:

◆ listenForKey()

void MyEventReceiver::listenForKey ( const KeyPress keyCode)
inline

References keysListenedFor, and KeyList::set().

Referenced by RealInputHandler::listenForKey().

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

◆ OnEvent()

bool MyEventReceiver::OnEvent ( const SEvent &  event)
virtual

References ARRLEN, g_logger, g_menumgr, JoystickController::handleEvent(), IsKeyDown(), isMenuActive(), joystick, keyIsDown, keysListenedFor, keyWasDown, keyWasPressed, keyWasReleased, LL_ERROR, LL_INFO, LL_NONE, LL_VERBOSE, LL_WARNING, Logger::log(), mouse_wheel, MainMenuManager::preprocessEvent(), KeyList::set(), and KeyList::unset().

+ Here is the call graph for this function:

◆ WasKeyDown()

bool MyEventReceiver::WasKeyDown ( const KeyPress keyCode)
inline

References keyWasDown, and KeyList::unset().

Referenced by RealInputHandler::cancelPressed(), and RealInputHandler::wasKeyDown().

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

◆ WasKeyPressed()

bool MyEventReceiver::WasKeyPressed ( const KeyPress keycode) const
inline

References keyWasPressed.

Referenced by RealInputHandler::wasKeyPressed().

+ Here is the caller graph for this function:

◆ WasKeyReleased()

bool MyEventReceiver::WasKeyReleased ( const KeyPress keycode) const
inline

References keyWasReleased.

Referenced by RealInputHandler::wasKeyReleased().

+ Here is the caller graph for this function:

Member Data Documentation

◆ joystick

JoystickController* MyEventReceiver::joystick = nullptr

◆ keyIsDown

KeyList MyEventReceiver::keyIsDown
private

Referenced by clearInput(), IsKeyDown(), and OnEvent().

◆ keysListenedFor

KeyList MyEventReceiver::keysListenedFor
private

◆ keyWasDown

KeyList MyEventReceiver::keyWasDown
private

Referenced by clearInput(), OnEvent(), and WasKeyDown().

◆ keyWasPressed

KeyList MyEventReceiver::keyWasPressed
private

◆ keyWasReleased

KeyList MyEventReceiver::keyWasReleased
private

◆ mouse_wheel

s32 MyEventReceiver::mouse_wheel = 0

Referenced by clearInput(), getMouseWheel(), and OnEvent().


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