1e03ed42aa
- Added better string handling and canned messages - Added LED error function - Moved code around - Prepared the matrix code for multiple styles of scanning (changed at compile time)
229 lines
3.1 KiB
C
229 lines
3.1 KiB
C
#ifndef __KEYMAP_h
|
|
#define __KEYMAP_h
|
|
|
|
#include "usb_keys.h"
|
|
|
|
// Modifier Mask
|
|
#define MODIFIERS_KEYPAD 0
|
|
#define MODIFIERS_KEYBOARD 4
|
|
static uint8_t keypad_modifierMask[] = {};
|
|
static uint8_t keyboard_modifierMask[] = { 1, 17, 33, 49 };
|
|
static uint8_t alternate_modifierMask[] = { 1, 17, 33, 49, 62 };
|
|
|
|
// Default 1-indexed key mappings
|
|
static uint8_t keypadDefaultMap[] = { 0,
|
|
KEYPAD_7,
|
|
KEYPAD_8,
|
|
KEYPAD_9,
|
|
KEYPAD_SLASH,
|
|
KEYPAD_4,
|
|
KEYPAD_5,
|
|
KEYPAD_6,
|
|
KEYPAD_ASTERIX,
|
|
KEYPAD_1,
|
|
KEYPAD_2,
|
|
KEYPAD_3,
|
|
KEYPAD_MINUS,
|
|
KEYPAD_ENTER,
|
|
KEYPAD_0,
|
|
KEYPAD_PERIOD,
|
|
KEYPAD_PLUS };
|
|
|
|
static uint8_t defaultMap[] = { 0,
|
|
KEY_GUI,
|
|
KEY_1,
|
|
KEY_2,
|
|
KEY_3,
|
|
KEY_4,
|
|
KEY_5,
|
|
KEY_6,
|
|
KEY_7,
|
|
KEY_8,
|
|
KEY_9,
|
|
KEY_0,
|
|
KEY_MINUS,
|
|
KEY_EQUAL,
|
|
KEY_BACKSLASH,
|
|
KEY_TILDE,
|
|
KEY_BACKSPACE,
|
|
KEY_ALT,
|
|
KEY_TAB,
|
|
KEY_Q,
|
|
KEY_W,
|
|
KEY_E,
|
|
KEY_R,
|
|
KEY_T,
|
|
KEY_Y,
|
|
KEY_U,
|
|
KEY_I,
|
|
KEY_O,
|
|
KEY_P,
|
|
KEY_LEFT_BRACE,
|
|
KEY_RIGHT_BRACE,
|
|
KEY_DELETE,
|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