Skip to content

Commit a9ba21d

Browse files
committed
make click() virtual
1 parent d45e37b commit a9ba21d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

libraries/USB/src/USBHIDMouse.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ class USBHIDMouseBase: public USBHIDDevice {
6565
template <typename T> bool sendReport(T report) { return hid.SendReport( HID_REPORT_ID_MOUSE, &report, _type->report_size ); };
6666
// internal use
6767
uint16_t _onGetDescriptor(uint8_t* buffer);
68-
virtual void buttons(uint8_t b);
68+
virtual void click(uint8_t b) = 0;
69+
virtual void buttons(uint8_t b) = 0;
6970
protected:
7071
USBHID hid;
7172
uint8_t _buttons;
@@ -77,7 +78,7 @@ class USBHIDRelativeMouse: public USBHIDMouseBase {
7778
public:
7879
USBHIDRelativeMouse(void): USBHIDMouseBase(&HIDMouseRel) { }
7980
void move(int8_t x, int8_t y, int8_t wheel = 0, int8_t pan = 0);
80-
void click(uint8_t b = MOUSE_LEFT);
81+
void click(uint8_t b = MOUSE_LEFT) override;
8182
void buttons(uint8_t b) override;
8283
};
8384

@@ -86,7 +87,7 @@ class USBHIDAbsoluteMouse: public USBHIDMouseBase {
8687
public:
8788
USBHIDAbsoluteMouse(void): USBHIDMouseBase(&HIDMouseAbs) { }
8889
void move(int16_t x, int16_t y, int8_t wheel = 0, int8_t pan = 0);
89-
void click(uint8_t b = MOUSE_LEFT);
90+
void click(uint8_t b = MOUSE_LEFT) override;
9091
void buttons(uint8_t b) override;
9192
private:
9293
int16_t _lastx = 0;

0 commit comments

Comments
 (0)