|
FifeGUI 0.3.0
A C++ GUI library designed for games.
|
#include <mouseinput.hpp>
Public Types | |
| enum class | Button : std::uint8_t { Empty = 0 , Left , Right , Middle , X1 , X2 } |
| enum class | Type : std::uint8_t { Moved = 0 , Pressed , Released , WheelMovedDown , WheelMovedUp , WheelMovedRight , WheelMovedLeft } |
Public Member Functions | |
| Button | getButton () const |
| int | getTimeStamp () const |
| Type | getType () const |
| int | getX () const |
| int | getY () const |
| MouseInput (Button button, Type type, int x, int y, int timeStamp) | |
| void | setButton (Button button) |
| void | setTimeStamp (int timeStamp) |
| void | setType (Type type) |
| void | setX (int x) |
| void | setY (int y) |
Protected Attributes | |
| Button | mButton {Button::Empty} |
| int | mTimeStamp {0} |
| Type | mType {Type::Moved} |
| int | mX {0} |
| int | mY {0} |
Internal class representing raw mouse input data.
Generally you won't have to bother using this class unless you implement an Input class fora backend.
Definition at line 25 of file mouseinput.hpp.
|
strong |
Mouse button.
Definition at line 43 of file mouseinput.hpp.
|
strong |
Type of mouse input.
Definition at line 31 of file mouseinput.hpp.
Constructor.
| button | The button pressed. |
| type | The type of mouse input. |
| x | The mouse x coordinate. |
| y | The mouse y coordinate. |
| timeStamp | The timestamp of the mouse input. Used to check for double clicks. |
Definition at line 13 of file mouseinput.cpp.
References mButton, mTimeStamp, mType, mX, and mY.
| MouseInput::Button fcn::MouseInput::getButton | ( | ) | const |
Gets the button pressed.
Definition at line 48 of file mouseinput.cpp.
References mButton.
Referenced by fcn::Gui::handleMouseMoved(), fcn::Gui::handleMousePressed(), fcn::Gui::handleMouseReleased(), fcn::Gui::handleMouseWheelMovedDown(), fcn::Gui::handleMouseWheelMovedLeft(), fcn::Gui::handleMouseWheelMovedRight(), and fcn::Gui::handleMouseWheelMovedUp().
| int fcn::MouseInput::getTimeStamp | ( | ) | const |
Gets the time stamp of the input.
Used to check for double clicks.
Definition at line 53 of file mouseinput.cpp.
References mTimeStamp.
Referenced by fcn::Gui::handleMousePressed().
| MouseInput::Type fcn::MouseInput::getType | ( | ) | const |
Gets the type of the mouse input.
Definition at line 35 of file mouseinput.cpp.
References mType.
Referenced by fcn::Gui::handleMouseInput().
| int fcn::MouseInput::getX | ( | ) | const |
Gets the x coordinate of the mouse input.
Definition at line 69 of file mouseinput.cpp.
References mX.
Referenced by fcn::Gui::handleMouseInput(), fcn::Gui::handleMouseMoved(), fcn::Gui::handleMousePressed(), fcn::Gui::handleMouseReleased(), fcn::Gui::handleMouseWheelMovedDown(), fcn::Gui::handleMouseWheelMovedLeft(), fcn::Gui::handleMouseWheelMovedRight(), and fcn::Gui::handleMouseWheelMovedUp().
| int fcn::MouseInput::getY | ( | ) | const |
Gets the y coordinate of the mouse input.
Definition at line 79 of file mouseinput.cpp.
References mY.
Referenced by fcn::Gui::handleMouseInput(), fcn::Gui::handleMouseMoved(), fcn::Gui::handleMousePressed(), fcn::Gui::handleMouseReleased(), fcn::Gui::handleMouseWheelMovedDown(), fcn::Gui::handleMouseWheelMovedLeft(), fcn::Gui::handleMouseWheelMovedRight(), and fcn::Gui::handleMouseWheelMovedUp().
| void fcn::MouseInput::setButton | ( | Button | button | ) |
Sets the button pressed.
| button | The button pressed. |
Definition at line 40 of file mouseinput.cpp.
References mButton.
Referenced by fcn::sdl3::Input::pushInput(), fcn::GenericInput::pushMouseButtonPressed(), and fcn::GenericInput::pushMouseButtonReleased().
| void fcn::MouseInput::setTimeStamp | ( | int | timeStamp | ) |
Sets the timestamp for the mouse input.
Used to check for double clicks.
| timeStamp | The timestamp of the mouse input. |
Definition at line 58 of file mouseinput.cpp.
References mTimeStamp.
Referenced by fcn::sdl3::Input::pushInput().
| void fcn::MouseInput::setType | ( | Type | type | ) |
Sets the type of the mouse input.
| type | The type of the mouse input. |
Definition at line 26 of file mouseinput.cpp.
References mType.
Referenced by fcn::sdl3::Input::pushInput(), fcn::GenericInput::pushMouseButtonPressed(), fcn::GenericInput::pushMouseButtonReleased(), fcn::GenericInput::pushMouseMoved(), fcn::GenericInput::pushMouseWheelMovedDown(), fcn::GenericInput::pushMouseWheelMovedLeft(), fcn::GenericInput::pushMouseWheelMovedRight(), and fcn::GenericInput::pushMouseWheelMovedUp().
| void fcn::MouseInput::setX | ( | int | x | ) |
Sets the x coordinate of the mouse input.
| x | The x coordinate of the mouse input. |
Definition at line 64 of file mouseinput.cpp.
References mX.
Referenced by fcn::sdl3::Input::pushInput(), fcn::GenericInput::pushMouseButtonPressed(), fcn::GenericInput::pushMouseButtonReleased(), fcn::GenericInput::pushMouseMoved(), fcn::GenericInput::pushMouseWheelMovedDown(), fcn::GenericInput::pushMouseWheelMovedLeft(), fcn::GenericInput::pushMouseWheelMovedRight(), and fcn::GenericInput::pushMouseWheelMovedUp().
| void fcn::MouseInput::setY | ( | int | y | ) |
Sets the y coordinate of the mouse input.
| y | The y coordinate of the mouse input. |
Definition at line 74 of file mouseinput.cpp.
References mY.
Referenced by fcn::sdl3::Input::pushInput(), fcn::GenericInput::pushMouseButtonPressed(), fcn::GenericInput::pushMouseButtonReleased(), fcn::GenericInput::pushMouseMoved(), fcn::GenericInput::pushMouseWheelMovedDown(), fcn::GenericInput::pushMouseWheelMovedLeft(), fcn::GenericInput::pushMouseWheelMovedRight(), and fcn::GenericInput::pushMouseWheelMovedUp().
|
protected |
Holds the button of the mouse input.
Definition at line 156 of file mouseinput.hpp.
Referenced by getButton(), MouseInput(), and setButton().
|
protected |
Holds the timestamp of the mouse input.
Used to check for double clicks.
Definition at line 162 of file mouseinput.hpp.
Referenced by getTimeStamp(), MouseInput(), and setTimeStamp().
|
protected |
Holds the type of the mouse input.
Definition at line 151 of file mouseinput.hpp.
Referenced by getType(), MouseInput(), and setType().
|
protected |
Holds the x coordinate of the mouse input.
Definition at line 167 of file mouseinput.hpp.
Referenced by getX(), MouseInput(), and setX().
|
protected |
Holds the y coordinate of the mouse input.
Definition at line 172 of file mouseinput.hpp.
Referenced by getY(), MouseInput(), and setY().