mirror of
https://github.com/gdsports/keymapper
synced 2024-12-21 23:28:53 -05:00
added Workman layout and removed unnecessary comments
This commit is contained in:
parent
3a94bdf5b7
commit
d84d358c00
@ -1,3 +1,17 @@
|
||||
/*
|
||||
Usage: Convert standard QWERTY keyboard to any keyboard layout you want
|
||||
Default layout: QWERTY
|
||||
Reserved key combination to switch layout:
|
||||
Ctrl-Shift 0 => QWERTY (DEFAULT)
|
||||
Ctrl-Shift 1 => tarmak1
|
||||
Ctrl-Shift 2 => tarmak2
|
||||
Ctrl-Shift 3 => tarmak3
|
||||
Ctrl-Shift 4 => tarmak4
|
||||
Ctrl-Shift 5 => Colemak
|
||||
Ctrl-Shift 6 => Dvorak
|
||||
Ctrl-Shift 7 => Workman
|
||||
*/
|
||||
|
||||
#include <avr/pgmspace.h>
|
||||
#include <Usb.h>
|
||||
#include <hidboot.h>
|
||||
@ -8,6 +22,7 @@
|
||||
#define modeLED 13
|
||||
//#define TEENSY
|
||||
|
||||
|
||||
// function definitions
|
||||
bool HandleReservedKeystrokes(HID *hid, uint8_t *buf);
|
||||
inline void SendKeysToHost (uint8_t *buf);
|
||||
@ -24,7 +39,8 @@ typedef enum
|
||||
tarmak3,
|
||||
tarmak4,
|
||||
colemak,
|
||||
dvorak
|
||||
dvorak,
|
||||
workman
|
||||
} KeyboardLayout;
|
||||
|
||||
// Keymap based on the scancodes from 4 to 57, refer to the HID usage table on the meaning of each element
|
||||
@ -35,6 +51,7 @@ PROGMEM prog_uint8_t tarmak3Keymap[] = {4, 5, 6, 7, 9, 23, 51, 11, 12, 17, 8, 15
|
||||
PROGMEM prog_uint8_t tarmak4Keymap[] = {4, 5, 6, 7, 9, 23, 51, 11, 24, 17, 8, 12, 16, 14, 28, 19, 20, 21, 22, 10, 15, 25, 26, 27, 13, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 18, 52, 53, 54, 55, 56, 42};
|
||||
PROGMEM prog_uint8_t colemakKeymap[] = {4, 5, 6, 22, 9, 23, 7, 11, 24, 17, 8, 12, 16, 14, 28, 51, 20, 19, 21, 10, 15, 25, 26, 27, 13, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 18, 52, 53, 54, 55, 56, 42};
|
||||
PROGMEM prog_uint8_t dvorakKeymap[] = {4, 27, 13, 8, 55, 24, 12, 7, 6, 11, 23, 17, 16, 5, 21, 15, 52, 19, 18, 28, 10, 14, 54, 20, 9, 51, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 47, 48, 56, 46, 49, 50, 22, 45, 53, 26, 25, 29, 57};
|
||||
PROGMEM prog_uint8_t workmanKeymap[] = {4, 25, 16, 11, 21, 23, 10, 28, 24, 17, 8, 18, 15, 14, 19, 51, 20, 26, 22, 5, 9, 6, 7, 27, 13, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 12, 52, 53, 54, 55, 56, 42};
|
||||
|
||||
|
||||
const uint8_t *Keymap[] =
|
||||
@ -45,7 +62,8 @@ const uint8_t *Keymap[] =
|
||||
tarmak3Keymap,
|
||||
tarmak4Keymap,
|
||||
colemakKeymap,
|
||||
dvorakKeymap
|
||||
dvorakKeymap,
|
||||
workmanKeymap
|
||||
};
|
||||
|
||||
// global variables
|
||||
@ -210,6 +228,12 @@ bool HandleReservedKeystrokes(HID *hid, uint8_t *buf) // return true if it is a
|
||||
digitalWrite(modeLED, HIGH);
|
||||
LatchKey(buf[keyPosition]);
|
||||
return true;
|
||||
|
||||
case 0x24: // 7
|
||||
CurrentLayout = workman;
|
||||
digitalWrite(modeLED, HIGH);
|
||||
LatchKey(buf[keyPosition]);
|
||||
return true;
|
||||
|
||||
case 0x2c: // space bar
|
||||
play_word_game();
|
||||
@ -321,9 +345,6 @@ uint32_t next_time;
|
||||
|
||||
KbdRptParser Prs;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void setup()
|
||||
@ -360,4 +381,3 @@ void loop()
|
||||
Usb.Task();
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user