Generic pointing (mouse) peripheral.
#include <srl_input.hpp>
Public Types | |
enum | Button { Left = 1 << 10 , Right = 1 << 9 , Middle = 1 << 8 , Start = 1 << 11 } |
Pointer device buttons. More... | |
Public Member Functions | |
Pointer (const uint8_t &port) | |
Construct a new pointing peripheral handler. | |
PeripheralFamily | GetFamily () |
Gets connected peripheral type family. | |
virtual SRL::Math::Types::Vector2D | GetPosition () |
Get the pointer position. | |
PeripheralType | GetType () |
Gets connected peripheral type. | |
bool | IsConnected () override |
Indicates whether peripheral is connected or not. | |
virtual bool | IsHeld (const Button &button) |
Check if user is holding down a button. | |
virtual bool | WasPressed (const Button &button) |
Check if user pressed a button. | |
virtual bool | WasReleased (const Button &button) |
Check if user released a button. | |
Public Attributes | |
uint8_t | Port = 0 |
Port number peripheral is connected to. | |
Protected Member Functions | |
PerDigital * | GetCurrentFrameState () |
Get state of the peripheral in the current frame. | |
PerDigital * | GetPreviousFrameState () |
Get state of the peripheral in the previous frame. | |