pull/18/head
Jesse Vincent 9 years ago
parent a2648d7996
commit ae33e7aef2

@ -7,13 +7,13 @@
#include "HID-Project.h"
uint8_t matrixState[ROWS][COLS] = {0};
const Key keymaps[KEYMAPS][ROWS][COLS] = { KEYMAP_LIST };
uint8_t primary_keymap = 0;
uint8_t temporary_keymap = 0;
uint8_t matrixState[ROWS][COLS] = {0};
const Key keymaps[KEYMAPS][ROWS][COLS] = { KEYMAP_LIST };
uint8_t primary_keymap = 0;
uint8_t temporary_keymap = 0;
KeyboardStorage Storage;
LEDControl LEDs;
KeyboardStorage Storage;
LEDControl LEDs;

@ -32,9 +32,9 @@ typedef struct {
#define MOUSE_UP B0000001
#define MOUSE_DOWN B0000010
#define MOUSE_LEFT B0000100
#define MOUSE_RIGHT B0001000
#define MOUSE_DOWN B0000010
#define MOUSE_LEFT B0000100
#define MOUSE_RIGHT B0001000
#define MOUSE_CENTER B0010000
#define MOUSE_WARP B0100000
#define MOUSE_WARP_END B1000000

@ -41,15 +41,15 @@ void handle_synthetic_key_event(byte switchState, Key mappedKey) {
|| mappedKey.rawKey == KEY_MOUSE_BTN_R) {
if (key_toggled_on (switchState)) {
press_button(
(mappedKey.rawKey == KEY_MOUSE_BTN_L ? MOUSE_BUTTON_LEFT : 0x00) |
(mappedKey.rawKey == KEY_MOUSE_BTN_M ? MOUSE_BUTTON_MIDDLE : 0x00) |
(mappedKey.rawKey == KEY_MOUSE_BTN_R ? MOUSE_BUTTON_RIGHT : 0x00) );
(mappedKey.rawKey == KEY_MOUSE_BTN_L ? MOUSE_BUTTON_LEFT : 0x00) |
(mappedKey.rawKey == KEY_MOUSE_BTN_M ? MOUSE_BUTTON_MIDDLE : 0x00) |
(mappedKey.rawKey == KEY_MOUSE_BTN_R ? MOUSE_BUTTON_RIGHT : 0x00) );
} else if (key_toggled_off(switchState)) {
release_button(
(mappedKey.rawKey == KEY_MOUSE_BTN_L ? MOUSE_BUTTON_LEFT : 0x00) |
(mappedKey.rawKey == KEY_MOUSE_BTN_M ? MOUSE_BUTTON_MIDDLE : 0x00) |
(mappedKey.rawKey == KEY_MOUSE_BTN_R ? MOUSE_BUTTON_RIGHT : 0x00) );
release_button(
(mappedKey.rawKey == KEY_MOUSE_BTN_L ? MOUSE_BUTTON_LEFT : 0x00) |
(mappedKey.rawKey == KEY_MOUSE_BTN_M ? MOUSE_BUTTON_MIDDLE : 0x00) |
(mappedKey.rawKey == KEY_MOUSE_BTN_R ? MOUSE_BUTTON_RIGHT : 0x00) );
}
}
}

@ -21,13 +21,13 @@ static boolean is_warping = false;
void press_button(uint8_t button) {
Mouse.press(button);
end_warping();
Mouse.press(button);
end_warping();
}
}
void release_button(uint8_t button) {
Mouse.release(button);
Mouse.release(button);
}

Loading…
Cancel
Save