|
FifeGUI 0.2.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 23 of file mouseinput.hpp.
|
strong |
Mouse button.
Definition at line 41 of file mouseinput.hpp.
|
strong |
Type of mouse input.
Definition at line 29 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 9 of file mouseinput.cpp.
References mButton, mTimeStamp, mType, mX, and mY.
| MouseInput::Button fcn::MouseInput::getButton | ( | ) | const |
Gets the button pressed.
Definition at line 29 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 34 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 19 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 49 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 59 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 24 of file mouseinput.cpp.
References mButton.
Referenced by fcn::sdl2::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 39 of file mouseinput.cpp.
References mTimeStamp.
Referenced by fcn::sdl2::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 14 of file mouseinput.cpp.
References mType.
Referenced by fcn::sdl2::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 44 of file mouseinput.cpp.
References mX.
Referenced by fcn::sdl2::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 54 of file mouseinput.cpp.
References mY.
Referenced by fcn::sdl2::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 154 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 160 of file mouseinput.hpp.
Referenced by getTimeStamp(), MouseInput(), and setTimeStamp().
|
protected |
Holds the type of the mouse input.
Definition at line 149 of file mouseinput.hpp.
Referenced by getType(), MouseInput(), and setType().
|
protected |
Holds the x coordinate of the mouse input.
Definition at line 165 of file mouseinput.hpp.
Referenced by getX(), MouseInput(), and setX().
|
protected |
Holds the y coordinate of the mouse input.
Definition at line 170 of file mouseinput.hpp.
Referenced by getY(), MouseInput(), and setY().