Added releaseAll() for abs Mouse
This commit is contained in:
parent
b33ff31253
commit
7c269d9749
2 changed files with 9 additions and 4 deletions
|
|
@ -71,6 +71,7 @@ public:
|
||||||
inline void move(int x, int y, signed char wheel = 0);
|
inline void move(int x, int y, signed char wheel = 0);
|
||||||
inline void press(uint8_t b = MOUSE_LEFT);
|
inline void press(uint8_t b = MOUSE_LEFT);
|
||||||
inline void release(uint8_t b = MOUSE_LEFT);
|
inline void release(uint8_t b = MOUSE_LEFT);
|
||||||
|
inline void releaseAll(void);
|
||||||
inline bool isPressed(uint8_t b = MOUSE_LEFT);
|
inline bool isPressed(uint8_t b = MOUSE_LEFT);
|
||||||
|
|
||||||
// Sending is public in the base class for advanced users.
|
// Sending is public in the base class for advanced users.
|
||||||
|
|
@ -79,4 +80,3 @@ public:
|
||||||
|
|
||||||
// Implementation is inline
|
// Implementation is inline
|
||||||
#include "AbsoluteMouseAPI.hpp"
|
#include "AbsoluteMouseAPI.hpp"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -98,6 +98,11 @@ void AbsoluteMouseAPI::release(uint8_t b){
|
||||||
buttons(_buttons & ~b);
|
buttons(_buttons & ~b);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AbsoluteMouseAPI::releaseAll(void){
|
||||||
|
_buttons = 0;
|
||||||
|
moveTo(xAxis, yAxis, 0);
|
||||||
|
}
|
||||||
|
|
||||||
bool AbsoluteMouseAPI::isPressed(uint8_t b){
|
bool AbsoluteMouseAPI::isPressed(uint8_t b){
|
||||||
// check LEFT by default
|
// check LEFT by default
|
||||||
if ((b & _buttons) > 0)
|
if ((b & _buttons) > 0)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue