clean up mouse data

pull/18/head
Jesse Vincent 9 years ago
parent 798172633d
commit 8de8775a91

@ -28,7 +28,7 @@ void setup();
#include "led_control.h"
#include <Wire.h>
#include "KeyboardioSX1509.h"
#include "mouse_movement.h"
//extern uint8_t usbMaxPower;
char x;
@ -49,14 +49,6 @@ byte load_primary_keymap();
// Mouse-related methods
double mouse_accel (double cycles);
void handle_mouse_movement( char x, char y);
void begin_warping();
void end_warping();
void warp_mouse(Key key);
//internals
void reboot_bootloader();
@ -77,7 +69,6 @@ void set_keymap_keymap(Key keymapEntry, byte matrixStateEntry);
// sending events to the computer
void handle_synthetic_key_press(byte switchState, Key mappedKey);
void handle_mouse_key_press(byte switchState, Key mappedKey, char &x, char &y);
void send_key_events();
void send_key_event(byte row, byte col);
void press_key(Key mappedKey);

@ -4,9 +4,25 @@
//
#include "Arduino.h"
#include "key_defs.h"
#include "mouse_movement.h"
#include "debouncing.h"
#include "HID-Project.h"
#include "mouse_movement.h"
// Warping
static double mouseActiveForCycles = 0;
static float carriedOverX = 0;
static float carriedOverY = 0;
static int abs_left = 0;
static int abs_top = 0;
static int next_width;
static int next_height;
static int section_top;
static int section_left;
static boolean is_warping = false;
void _warp_jump(long left, long top, long height, long width) {
long x_center = left + width/2;

@ -1,11 +1,16 @@
#pragma once
// Mouse-related 'public' API methods
double mouse_accel (double cycles);
void handle_mouse_key_press(byte switchState, Key mappedKey, char &x, char &y);
void handle_mouse_movement( char x, char y);
void begin_warping();
void end_warping();
void warp_mouse(Key key);
// Warping
double mouseActiveForCycles = 0;
float carriedOverX = 0;
float carriedOverY = 0;
// apparently, the mac discards 15% of the value space for mouse movement.
@ -15,18 +20,7 @@ float carriedOverY = 0;
#define HALF_HEIGHT 16384
int abs_left = 0;
int abs_top = 0;
int next_width;
int next_height;
int section_top;
int section_left;
boolean is_warping = false;
// Mouse acceleration
// Mouse acceleration
// we want the whole s curve, not just the bit
// that's usually above the x and y axes;

Loading…
Cancel
Save