Added releaseAll() for abs Mouse

This commit is contained in:
NicoHood 2016-03-05 18:02:50 +01:00
parent b33ff31253
commit 7c269d9749
2 changed files with 9 additions and 4 deletions

View file

@ -71,6 +71,7 @@ public:
inline void move(int x, int y, signed char wheel = 0);
inline void press(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);
// Sending is public in the base class for advanced users.
@ -79,4 +80,3 @@ public:
// Implementation is inline
#include "AbsoluteMouseAPI.hpp"

View file

@ -98,6 +98,11 @@ void AbsoluteMouseAPI::release(uint8_t b){
buttons(_buttons & ~b);
}
void AbsoluteMouseAPI::releaseAll(void){
_buttons = 0;
moveTo(xAxis, yAxis, 0);
}
bool AbsoluteMouseAPI::isPressed(uint8_t b){
// check LEFT by default
if ((b & _buttons) > 0)