Browse Source

Update usb_mouse.h

Add MOUSE_BACK, MOUSE_FORWARD
main
Xenoamor 8 years ago
parent
commit
adb0042ca2
1 changed files with 6 additions and 4 deletions
  1. +6
    -4
      teensy3/usb_mouse.h

+ 6
- 4
teensy3/usb_mouse.h View File

#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
int usb_mouse_buttons(uint8_t left, uint8_t middle, uint8_t right);
int usb_mouse_buttons(uint8_t left, uint8_t middle, uint8_t right, uint8_t back, uint8_t forward);
int usb_mouse_move(int8_t x, int8_t y, int8_t wheel); int usb_mouse_move(int8_t x, int8_t y, int8_t wheel);
int usb_mouse_position(uint16_t x, uint16_t y); int usb_mouse_position(uint16_t x, uint16_t y);
void usb_mouse_screen_size(uint16_t width, uint16_t height, uint8_t mac); void usb_mouse_screen_size(uint16_t width, uint16_t height, uint8_t mac);
#define MOUSE_LEFT 1 #define MOUSE_LEFT 1
#define MOUSE_MIDDLE 4 #define MOUSE_MIDDLE 4
#define MOUSE_RIGHT 2 #define MOUSE_RIGHT 2
#define MOUSE_ALL (MOUSE_LEFT | MOUSE_RIGHT | MOUSE_MIDDLE)
#define MOUSE_BACK 8
#define MOUSE_FORWARD 16
#define MOUSE_ALL (MOUSE_LEFT | MOUSE_RIGHT | MOUSE_MIDDLE | MOUSE_BACK | MOUSE_FORWARD)


// C++ interface // C++ interface
#ifdef __cplusplus #ifdef __cplusplus
usb_mouse_move(0, 0, 0); usb_mouse_move(0, 0, 0);
} }
void scroll(int8_t wheel) { usb_mouse_move(0, 0, wheel); } void scroll(int8_t wheel) { usb_mouse_move(0, 0, wheel); }
void set_buttons(uint8_t left, uint8_t middle=0, uint8_t right=0) {
usb_mouse_buttons(left, middle, right);
void set_buttons(uint8_t left, uint8_t middle=0, uint8_t right=0, uint8_t back=0, uint8_t forward=0) {
usb_mouse_buttons(left, middle, right, back, forward);
} }
void press(uint8_t b = MOUSE_LEFT) { void press(uint8_t b = MOUSE_LEFT) {
uint8_t buttons = usb_mouse_buttons_state | (b & MOUSE_ALL); uint8_t buttons = usb_mouse_buttons_state | (b & MOUSE_ALL);

Loading…
Cancel
Save