Kaleidoscope
MouseWrapper.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Arduino.h"
4 #include "KeyboardioHID.h"
5 
6 // Warping commands
7 
8 #define WARP_END 1
9 #define WARP_UP 2
10 #define WARP_DOWN 4
11 #define WARP_LEFT 8
12 #define WARP_RIGHT 16
13 
14 // apparently, the mac discards 15% of the value space for mouse movement.
15 // need to test this on other platforms
16 
17 #define MAX_WARP_WIDTH 32767
18 #define MAX_WARP_HEIGHT 32767
19 
20 #define WARP_ABS_TOP 0
21 #define WARP_ABS_LEFT 0
22 
23 // Mouse acceleration
24 
26  public:
27  MouseWrapper_(void);
28 
29  static void begin(void);
30  static void move(int8_t x, int8_t y);
31  static void warp(uint8_t warp_cmd);
32  static void pressButton(uint8_t button);
33  static void release_button(uint8_t button);
34  static uint8_t accelStep;
35  static uint8_t speedLimit;
36 
37  private:
38  static uint16_t next_width;
39  static uint16_t next_height;
40  static uint16_t section_top;
41  static uint16_t section_left;
42  static boolean is_warping;
43 
44  static uint8_t acceleration(uint8_t cycles);
45  static void begin_warping();
46  static void end_warping();
47  static void warp_jump(uint16_t left, uint16_t top, uint16_t height, uint16_t width);
48 };
49 
static void begin(void)
Definition: MouseWrapper.cpp:20
MouseWrapper_(void)
Definition: MouseWrapper.cpp:17
static void warp(uint8_t warp_cmd)
Definition: MouseWrapper.cpp:52
MouseWrapper_ MouseWrapper
Definition: MouseWrapper.cpp:125
static void move(int8_t x, int8_t y)
Definition: MouseWrapper.cpp:101
static void pressButton(uint8_t button)
Definition: MouseWrapper.cpp:25
static uint8_t accelStep
Definition: MouseWrapper.h:34
Definition: MouseWrapper.h:25
static uint8_t speedLimit
Definition: MouseWrapper.h:35
static void release_button(uint8_t button)
Definition: MouseWrapper.cpp:30