Apply new keymap for gh60

This commit is contained in:
tmk 2013-02-20 10:40:07 +09:00
parent 998dc6c17e
commit abf0b04d14
9 changed files with 195 additions and 226 deletions

View File

@ -125,8 +125,8 @@ plain: all
poker: OPT_DEFS += -DKEYMAP_POKER
poker: all
poker_bit: OPT_DEFS += -DKEYMAP_POKER_SET
poker_bit: all
poker_set: OPT_DEFS += -DKEYMAP_POKER_SET
poker_set: all
poker_bit: OPT_DEFS += -DKEYMAP_POKER_BIT
poker_bit: all

View File

@ -95,8 +95,8 @@ plain: all
poker: OPT_DEFS += -DKEYMAP_POKER
poker: all
poker_bit: OPT_DEFS += -DKEYMAP_POKER_SET
poker_bit: all
poker_set: OPT_DEFS += -DKEYMAP_POKER_SET
poker_set: all
poker_bit: OPT_DEFS += -DKEYMAP_POKER_BIT
poker_bit: all

View File

@ -47,9 +47,10 @@ See [keymap_plain.h](keymap_plain.h) for detail.
`-----------------------------------------------------------'
### 2 Poker keymap
Poker layer emulation
See [keymap_poker.h](keymap_poker.h) for detail.
See [keymap_poker.h](keymap_poker.h) for Poker layer emulation, [keymap_poker_bit.h](keymap_poker_bit.h) and [keymap_poker_set.h](keymap_poker_set.h) for better support of Esc and arrow.
These keymap supports Colemak, Dvorak and Workmans, use `Magic` + {`1`, `2`, `3`} to switch and `Magic` + `0` to return to Qwerty.
#### 2.0 Poker Default Layer
,-----------------------------------------------------------.
@ -108,7 +109,7 @@ See [keymap_poker.h](keymap_poker.h) for detail.
### 3. Funky keymap
This is my keymap(default) with HHKB, Vi cursor and Mousekey layer.
See [keymap.h](keymap.h) for detail.
See [keymap.c](keymap.c) for detail.
#### 3.0 Funky Default Layer
,-----------------------------------------------------------.

View File

@ -41,6 +41,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
/* Set 0 if need no debouncing */
#define DEBOUNCE 5
/* To use new keymap framework */
#define USE_KEYMAP_V2
/* key combination for command */
#define IS_COMMAND() ( \

View File

@ -20,6 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "keycode.h"
#include "action.h"
#include "action_macro.h"
#include "layer_switch.h"
#include "report.h"
#include "host.h"
#include "print.h"
@ -73,7 +74,7 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*
* Funky
*/
/* Layer 0: Default Layer
/* Keymap 0: Default Layer
* ,-----------------------------------------------------------.
* |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |
* |-----------------------------------------------------------|
@ -92,7 +93,34 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
LCTL,A, S, D, F, G, H, J, K, L, FN3, QUOT, ENT, \
LSFT,Z, X, C, V, B, N, M, COMM,DOT, FN2, RSFT, \
LCTL,LGUI,LALT, SPC, RALT,FN4, FN4, FN1),
/* Layer 1: HHKB mode
/* Keymap 1: colemak */
KEYMAP_ANSI(
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, \
TAB, Q, W, F, P, G, J, L, U, Y, SCLN,LBRC,RBRC,BSLS, \
BSPC,A, R, S, T, D, H, N, E, I, O, QUOT, ENT, \
LSFT,Z, X, C, V, B, K, M, COMM,DOT, SLSH, RSFT, \
LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, FN1),
/* Keymap 2: dvorak */
KEYMAP_ANSI(
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, LBRC,RBRC,BSPC, \
TAB, QUOT,COMM,DOT, P, Y, F, G, C, R, L, SLSH,EQL, BSLS, \
CAPS,A, O, E, U, I, D, H, T, N, S, MINS, ENT, \
LSFT,SCLN,Q, J, K, X, B, M, W, V, Z, RSFT, \
LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, FN1),
/* Keymap: workman */
KEYMAP_ANSI(
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, \
TAB, Q, D, R, W, B, J, F, U, P, SCLN,LBRC,RBRC,BSLS, \
BSPC,A, S, H, T, G, Y, N, E, O, I, QUOT, ENT, \
LSFT,Z, X, M, C, V, K, L, COMM,DOT, SLSH, RSFT, \
LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, FN1),
};
static const uint8_t PROGMEM overlays[][MATRIX_ROWS][MATRIX_COLS] = {
/*
* Funky
*/
/* Overlay 0: HHKB mode
* ,-----------------------------------------------------------.
* |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delete |
* |-----------------------------------------------------------|
@ -107,11 +135,11 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/
KEYMAP_ANSI(
PWR, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, \
CAPS,NO, NO, NO, NO, NO, NO, NO, PSCR,SLCK,PAUS,UP, NO, INS, \
LCTL,VOLD,VOLU,MUTE,NO, NO, PAST,PSLS,HOME,PGUP,LEFT,RGHT, ENT, \
LSFT,NO, NO, NO, NO, NO, PPLS,PMNS,END, PGDN,DOWN, RSFT, \
CAPS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS,UP, TRNS,INS, \
LCTL,VOLD,VOLU,MUTE,TRNS,TRNS,PAST,PSLS,HOME,PGUP,LEFT,RGHT, ENT, \
LSFT,TRNS,TRNS,TRNS,TRNS,TRNS,PPLS,PMNS,END, PGDN,DOWN, RSFT, \
LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, FN0),
/* Layer 2: Vi mode (Slash)
/* Overlay 1: Vi mode (Slash)
* ,-----------------------------------------------------------.
* | `| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Backsp |
* |-----------------------------------------------------------|
@ -126,11 +154,11 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/
KEYMAP_ANSI(
GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, BSPC, \
TAB, HOME,PGDN,UP, PGUP,END, HOME,PGDN,PGUP,END, NO, NO, NO, NO, \
LCTL,NO, LEFT,DOWN,RGHT,NO, LEFT,DOWN,UP, RGHT,NO, NO, ENT, \
LSFT,NO, NO, NO, NO, NO, HOME,PGDN,PGUP,END, FN0, RSFT, \
TAB, HOME,PGDN,UP, PGUP,END, HOME,PGDN,PGUP,END, TRNS,TRNS,TRNS,TRNS, \
LCTL,TRNS,LEFT,DOWN,RGHT,TRNS,LEFT,DOWN,UP, RGHT,TRNS,TRNS, ENT, \
LSFT,TRNS,TRNS,TRNS,TRNS,TRNS,HOME,PGDN,PGUP,END, FN0, RSFT, \
LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, RCTL),
/* Layer 3: Mouse mode (Semicolon/App)
/* Overlay 2: Mouse mode (Semicolon/App)
* ,-----------------------------------------------------------.
* | `| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Backsp |
* |-----------------------------------------------------------|
@ -146,10 +174,10 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/
KEYMAP_ANSI(
GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, BSPC, \
TAB, NO, NO, NO, NO, NO, WH_L,WH_D,WH_U,WH_R,NO, NO, NO, NO, \
LCTL,NO, ACL0,ACL1,ACL2,NO, MS_L,MS_D,MS_U,MS_R,FN0, NO, ENT, \
LSFT,NO, NO, NO, NO, BTN3,BTN2,BTN1,BTN4,BTN5,NO, RSFT, \
LCTL,LGUI,LALT, BTN1, NO, FN0, FN0, NO ),
TAB, TRNS,TRNS,TRNS,TRNS,TRNS,WH_L,WH_D,WH_U,WH_R,TRNS,TRNS,TRNS,TRNS, \
LCTL,TRNS,ACL0,ACL1,ACL2,TRNS,MS_L,MS_D,MS_U,MS_R,FN0, TRNS, ENT, \
LSFT,TRNS,TRNS,TRNS,TRNS,BTN3,BTN2,BTN1,BTN4,BTN5,TRNS, RSFT, \
LCTL,LGUI,LALT, BTN1, TRNS,FN0, FN0, RCTL),
};
/*
@ -157,41 +185,52 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/
static const uint16_t PROGMEM fn_actions[] = {
ACTION_LAYER_DEFAULT, // FN0
ACTION_LAYER_SET(1), // FN1
ACTION_LAYER_SET_TAP_KEY(2, KC_SLASH), // FN2 Layer with Slash
ACTION_LAYER_SET_TAP_KEY(3, KC_SCLN), // FN3 Layer with Semicolon
ACTION_LAYER_SET(3), // FN4
ACTION_LAYER_SET(0), // FN1
ACTION_LAYER_SET_TAP_KEY(1, KC_SLASH), // FN2
ACTION_LAYER_SET_TAP_KEY(2, KC_SCLN), // FN3
ACTION_LAYER_SET(2), // FN4
};
#endif
#define KEYMAPS_SIZE (sizeof(keymaps) / sizeof(keymaps[0]))
#define OVERLAYS_SIZE (sizeof(overlays) / sizeof(overlays[0]))
#define FN_ACTIONS_SIZE (sizeof(fn_actions) / sizeof(fn_actions[0]))
/* translates key to keycode */
uint8_t keymap_key_to_keycode(uint8_t layer, key_t key)
{
return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
/* Overlay: 16-31(OVERLAY_BIT(0x10) | overlay_layer) */
if (layer & OVERLAY_BIT) {
layer &= OVERLAY_MASK;
if (layer < OVERLAYS_SIZE) {
return pgm_read_byte(&overlays[(layer)][(key.row)][(key.col)]);
} else {
debug("key_to_keycode: overlay "); debug_dec(layer); debug(" is invalid.\n");
return KC_TRANSPARENT;
}
}
/* Keymap: 0-15 */
else {
if (layer < KEYMAPS_SIZE) {
return pgm_read_byte(&keymaps[(layer)][(key.row)][(key.col)]);
} else {
// fall back to layer 0
debug("key_to_keycode: base "); debug_dec(layer); debug(" is invalid.\n");
return pgm_read_byte(&keymaps[0][(key.row)][(key.col)]);
}
}
}
/* translates Fn index to action */
/* translates Fn keycode to action */
action_t keymap_fn_to_action(uint8_t keycode)
{
action_t action;
if (FN_INDEX(keycode) < sizeof(fn_actions) / sizeof(fn_actions[0])) {
if (FN_INDEX(keycode) < FN_ACTIONS_SIZE) {
action.code = pgm_read_word(&fn_actions[FN_INDEX(keycode)]);
} else {
action.code = ACTION_NO;
}
return action;
}
/* convert key to action */
action_t action_for_key(uint8_t layer, key_t key)
{
uint8_t keycode = keymap_key_to_keycode(layer, key);
switch (keycode) {
case KC_FN0 ... KC_FN31:
return keymap_fn_to_action(keycode);
default:
return keymap_keycode_to_action(keycode);
}
}

View File

@ -1,24 +1,10 @@
static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*
* Plain
*/
/* Layer 0: Default Layer
* ,-----------------------------------------------------------.
* |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |
* |-----------------------------------------------------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \|
* |-----------------------------------------------------------|
* |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return |
* |-----------------------------------------------------------|
* |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |
* |-----------------------------------------------------------|
* |Ctrl|Gui |Alt | Space |Alt |Gui |App |Ctrl|
* `-----------------------------------------------------------'
*/
/* Keymap 0: qwerty */
KEYMAP(ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, \
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, \
CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT,NO, ENT, \
LSFT,NO, Z, X, C, V, B, N, M, COMM,DOT, SLSH,NO, RSFT, \
LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, RCTL),
};
static const uint8_t PROGMEM overlays[][MATRIX_ROWS][MATRIX_COLS] = {};
static const uint16_t PROGMEM fn_actions[] = {};

View File

@ -1,75 +1,104 @@
static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Poker Default Layer
* ,-----------------------------------------------------------.
* | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |
* |-----------------------------------------------------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \|
* |-----------------------------------------------------------|
* |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return |
* |-----------------------------------------------------------|
* |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |
* |-----------------------------------------------------------|
* |Ctrl|Gui |Alt | Space |Fn |Gui |App |Ctrl|
* `-----------------------------------------------------------'
*/
/* Layer 0: qwerty */
/* Keymap 0: qwerty */
KEYMAP_ANSI(
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, \
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, \
LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, \
CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, \
LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, \
LCTL,LGUI,LALT, SPC, FN0, RGUI,APP, RCTL),
/* Layer 1: colemak */
/* Keymap 1: colemak */
KEYMAP_ANSI(
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, \
TAB, Q, W, F, P, G, J, L, U, Y, SCLN,LBRC,RBRC,BSLS, \
BSPC,A, R, S, T, D, H, N, E, I, O, QUOT, ENT, \
LSFT,Z, X, C, V, B, K, M, COMM,DOT, SLSH, RSFT, \
LCTL,LGUI,LALT, SPC, FN0, RGUI,APP, RCTL),
/* Layer 2: dvorak */
/* Keymap 2: dvorak */
KEYMAP_ANSI(
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, LBRC,RBRC,BSPC, \
TAB, QUOT,COMM,DOT, P, Y, F, G, C, R, L, SLSH,EQL, BSLS, \
CAPS,A, O, E, U, I, D, H, T, N, S, MINS, ENT, \
LSFT,SCLN,Q, J, K, X, B, M, W, V, Z, RSFT, \
LCTL,LGUI,LALT, SPC, FN0, RGUI,APP, RCTL),
/* Layer3: workman */
/* Keymap: workman */
KEYMAP_ANSI(
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, \
TAB, Q, D, R, W, B, J, F, U, P, SCLN,LBRC,RBRC,BSLS, \
BSPC,A, S, H, T, G, Y, N, E, O, I, QUOT, ENT, \
LSFT,Z, X, M, C, V, K, L, COMM,DOT, SLSH, RSFT, \
LCTL,LGUI,LALT, SPC, FN0, RGUI,APP, RCTL),
/* Layer 4: Poker with Arrow */
};
static const uint8_t PROGMEM overlays[][MATRIX_ROWS][MATRIX_COLS] = {
/* Overlay 0: Poker with Arrow */
KEYMAP_ANSI(
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, UP, \
TRNS,TRNS,TRNS, TRNS, FN0, LEFT,DOWN,RGHT),
/* Layer 5: Poker with Esc */
TRNS,TRNS,TRNS, TRNS, TRNS,LEFT,DOWN,RGHT),
/* Overlay 1: Poker with Esc */
KEYMAP_ANSI(
ESC, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \
TRNS,TRNS,TRNS, TRNS, FN0, TRNS,TRNS,TRNS),
/* Layer 6: Poker Fn'd */
TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS),
/* Overlay 2: Poker Fn
* ,-----------------------------------------------------------.
* |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| |
* |-----------------------------------------------------------|
* | |FnQ| Up| | | | | | |Cal| |Hom|Ins|FnL |
* |-----------------------------------------------------------|
* | |Lef|Dow|Rig| | |Psc|Slk|Pau| |Tsk|End| |
* |-----------------------------------------------------------|
* | |Del| |Web|Mut|VoU|VoD| |PgU|PgD|Del| |
* |-----------------------------------------------------------|
* | | | | FnS | | | | |
* `-----------------------------------------------------------'
* Fn: to Fn overlay
* FnL: to Layout selector overaly
* FnQ: toggle Esc overlay
* FnS: toggle Arrow overlay
*/
KEYMAP_ANSI(
ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, \
TRNS,FN2, UP, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,CALC,TRNS,HOME,INS, TRNS, \
TRNS,FN2, UP, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,CALC,TRNS,HOME,INS, FN4, \
TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,PSCR,SLCK,PAUS,TRNS,FN3, END, TRNS, \
TRNS,DEL, TRNS,WHOM,MUTE,VOLU,VOLD,TRNS,PGUP,PGDN,DEL, TRNS, \
TRNS,TRNS,TRNS, FN1, FN0, TRNS,TRNS,TRNS),
TRNS,TRNS,TRNS, FN1, TRNS,TRNS,TRNS,TRNS),
/* Overlay 3: Layout selector
* ,-----------------------------------------------------------.
* | Lq| Lc| Ld| Lw| | | | | | | | | | |
* |-----------------------------------------------------------|
* | |Lq |Lw | | | | | | | | | | | |
* |-----------------------------------------------------------|
* | | | |Ld | | | | | | | | | |
* |-----------------------------------------------------------|
* | | | |Lc | | | | | | | | |
* |-----------------------------------------------------------|
* | | | | | | | | |
* `-----------------------------------------------------------'
* Lq: set Qwerty layout
* Lc: set Colemak layout
* Ld: set Dvorak layout
* Lw: set Workman layout
*/
KEYMAP_ANSI(
FN5, FN6, FN7, FN8, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
TRNS,FN5, FN8, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
TRNS,TRNS,TRNS,FN7, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \
TRNS,TRNS,TRNS,FN6, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \
TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS),
};
/*
* Fn action definition
*/
static const uint16_t PROGMEM fn_actions[] = {
/* Poker Layout */
[0] = ACTION_LAYER_SWITCH_MOMENTARY(6), // FN0 switch to Fn
[1] = ACTION_LAYER_SWITCH_TOGGLE(4), // FN1 toggle arrow
[2] = ACTION_LAYER_SWITCH_TOGGLE(5), // FN2 toggle Esc
[3] = ACTION_RMODS_KEY(MOD_BIT(KC_RCTL)|MOD_BIT(KC_RSFT), KC_ESC), // FN3 Task(RControl,RShift+Esc)
[0] = ACTION_OVERLAY(2), // to Fn overlay
[1] = ACTION_OVERLAY_TOGGLE(0), // toggle arrow overlay
[2] = ACTION_OVERLAY_TOGGLE(1), // toggle Esc overlay
[3] = ACTION_RMODS_KEY(MOD_BIT(KC_RCTL)|MOD_BIT(KC_RSFT), KC_ESC), // Task(RControl,RShift+Esc)
[4] = ACTION_OVERLAY(3), // to Layout selector
[5] = ACTION_SET_DEFAULT_LAYER(0), // set qwerty layout
[6] = ACTION_SET_DEFAULT_LAYER(1), // set colemak layout
[7] = ACTION_SET_DEFAULT_LAYER(2), // set dvorak layout
[8] = ACTION_SET_DEFAULT_LAYER(3), // set workman layout
};

View File

@ -1,109 +1,50 @@
// Poker fix with toggle and bit operation
// Fn + Esc = `
// Fn + {left, down, up, right} = {home, pgdown, pgup, end}
static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*
* Poker Layer
*/
/* Layer x000: Poker Default Layer
* ,-----------------------------------------------------------.
* | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |
* |-----------------------------------------------------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \|
* |-----------------------------------------------------------|
* |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return |
* |-----------------------------------------------------------|
* |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |
* |-----------------------------------------------------------|
* |Ctrl|Gui |Alt | Space |Fn |Gui |App |Ctrl|
* `-----------------------------------------------------------'
*/
/* Keymap 0: qwerty */
KEYMAP_ANSI(
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, \
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, \
LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, \
LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, \
LCTL,LGUI,LALT, SPC, FN2, RGUI,APP, RCTL),
/* Layer x001: Poker with Arrow */
LCTL,LGUI,LALT, SPC, FN0, RGUI,APP, RCTL),
};
static const uint8_t PROGMEM overlays[][MATRIX_ROWS][MATRIX_COLS] = {
/* Overlay 0: Poker Default + Fn'd */
KEYMAP_ANSI(
TRNS,F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, \
CAPS,FN2, UP, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,CALC,TRNS,HOME,INS, TRNS, \
TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,PSCR,SLCK,PAUS,TRNS,FN4, END, TRNS, \
TRNS,DEL, TRNS,WHOM,MUTE,VOLU,VOLD,TRNS,PGUP,PGDN,DEL, TRNS, \
TRNS,TRNS,TRNS, FN1, TRNS,TRNS,TRNS,TRNS),
/* Overlay 1: Poker with Arrow */
KEYMAP_ANSI(
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, UP, \
TRNS,TRNS,TRNS, TRNS, FN2, LEFT,DOWN,RGHT),
/* Layer x010: Poker with Esc */
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, PGUP, \
TRNS,TRNS,TRNS, TRNS, FN3, HOME,PGDN,END),
/* Overlay 2: Poker with Esc */
KEYMAP_ANSI(
ESC, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \
TRNS,TRNS,TRNS, TRNS, FN2, TRNS,TRNS,TRNS),
/* Layer x011: Poker with Arrow and Esc */
TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS),
/* Overlay 3: Poker with Arrow + Fn'd */
KEYMAP_ANSI(
ESC, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, UP, \
TRNS,TRNS,TRNS, TRNS, FN2, LEFT,DOWN,RGHT),
/*
* Poker Momentary Fn Layer
*/
/* Layer x100: Poker Default + Fn'd */
KEYMAP_ANSI(
ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, \
CAPS,FN1, UP, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,CALC,TRNS,HOME,INS, TRNS, \
TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,PSCR,SLCK,PAUS,TRNS,FN3, END, TRNS, \
TRNS,DEL, TRNS,WHOM,MUTE,VOLU,VOLD,TRNS,PGUP,PGDN,DEL, TRNS, \
TRNS,TRNS,TRNS, FN0, FN2, TRNS,TRNS,TRNS),
/* Layer x101: Poker with Arrow + Fn'd */
KEYMAP_ANSI(
ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, \
CAPS,FN1, UP, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,CALC,TRNS,HOME,INS, TRNS, \
TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,PSCR,SLCK,PAUS,TRNS,FN3, END, TRNS, \
TRNS,DEL, TRNS,WHOM,MUTE,VOLU,VOLD,TRNS,PGUP,PGDN,DEL, PGUP, \
TRNS,TRNS,TRNS, FN0, FN2, HOME,PGDN,END),
/* Layer x110: Poker with Esc + Fn'd */
KEYMAP_ANSI(
GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, \
CAPS,FN1, UP, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,CALC,TRNS,HOME,INS, TRNS, \
TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,PSCR,SLCK,PAUS,TRNS,FN3, END, TRNS, \
TRNS,DEL, TRNS,WHOM,MUTE,VOLU,VOLD,TRNS,PGUP,PGDN,DEL, TRNS, \
TRNS,TRNS,TRNS, FN0, FN2, TRNS,TRNS,TRNS),
/* Layer x111: Poker with Arrow and Esc + Fn'd */
KEYMAP_ANSI(
GRV, F9, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, \
CAPS,FN1, UP, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,CALC,TRNS,HOME,INS, TRNS, \
TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,PSCR,SLCK,PAUS,TRNS,FN3, END, TRNS, \
TRNS,DEL, TRNS,WHOM,MUTE,VOLU,VOLD,TRNS,PGUP,PGDN,DEL, PGUP, \
TRNS,TRNS,TRNS, FN0, FN2, HOME,PGDN,END),
/* colemak */
[8] = KEYMAP_ANSI(
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, \
TAB, Q, W, F, P, G, J, L, U, Y, SCLN,LBRC,RBRC,BSLS, \
BSPC,A, R, S, T, D, H, N, E, I, O, QUOT, ENT, \
LSFT,Z, X, C, V, B, K, M, COMM,DOT, SLSH, RSFT, \
LCTL,LGUI,LALT, SPC, FN2, RGUI,APP, RCTL),
/* dvorak */
KEYMAP_ANSI(
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, LBRC,RBRC,BSPC, \
TAB, QUOT,COMM,DOT, P, Y, F, G, C, R, L, SLSH,EQL, BSLS, \
LCTL,A, O, E, U, I, D, H, T, N, S, MINS, ENT, \
LSFT,SCLN,Q, J, K, X, B, M, W, V, Z, RSFT, \
LCTL,LGUI,LALT, SPC, FN2, RGUI,APP, RCTL),
/* workman */
KEYMAP_ANSI(
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, \
TAB, Q, D, R, W, B, J, F, U, P, SCLN,LBRC,RBRC,BSLS, \
BSPC,A, S, H, T, G, Y, N, E, O, I, QUOT, ENT, \
LSFT,Z, X, M, C, V, K, L, COMM,DOT, SLSH, RSFT, \
LCTL,LGUI,LALT, SPC, FN2, RGUI,APP, RCTL),
TRNS,TRNS,TRNS, TRNS, TRNS,LEFT,DOWN,RGHT),
};
/*
* Fn action definition
*/
static const uint16_t PROGMEM fn_actions[] = {
/* Poker Layout */
[0] = ACTION_LAYER_BIT_TOGGLE(1), // FN0 Poker Arrow toggle(Space)
[1] = ACTION_LAYER_BIT_TOGGLE(2), // FN1 Poker Esc toggle(Q)
[2] = ACTION_LAYER_BIT(4), // FN2 Poker Fn
[3] = ACTION_RMODS_KEY(MOD_BIT(KC_RCTL)|MOD_BIT(KC_RSFT), KC_ESC), // FN3 Task(RControl,RShift+Esc)
[0] = ACTION_OVERLAY_INV4(0b0101, 0), // Poker Fn(with fix for Esc)
[1] = ACTION_OVERLAY_TOGGLE(1), // Poker Arrow toggle
[2] = ACTION_OVERLAY_TOGGLE(2), // Poker Esc toggle
[3] = ACTION_OVERLAY_INV4(0b1101, 0), // Poker Fn(with fix for Arrow)
[4] = ACTION_RMODS_KEY(MOD_BIT(KC_RCTL)|MOD_BIT(KC_RSFT), KC_ESC), // FN3 Task(RControl,RShift+Esc)
};

View File

@ -1,88 +1,59 @@
// Poker fix with set(state transition)
// Fn + Esc = `
// Fn + {left, down, up, right} = {home, pgdown, pgup, end}
static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Poker Default Layer
* ,-----------------------------------------------------------.
* | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |
* |-----------------------------------------------------------|
* |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \|
* |-----------------------------------------------------------|
* |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return |
* |-----------------------------------------------------------|
* |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |
* |-----------------------------------------------------------|
* |Ctrl|Gui |Alt | Space |Fn |Gui |App |Ctrl|
* `-----------------------------------------------------------'
*/
/* Layer 0: qwerty */
/* Keymap 0: qwerty */
KEYMAP_ANSI(
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, \
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, \
LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, \
LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, \
LCTL,LGUI,LALT, SPC, FN0, RGUI,APP, RCTL),
/* Layer 1: colemak */
KEYMAP_ANSI(
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, \
TAB, Q, W, F, P, G, J, L, U, Y, SCLN,LBRC,RBRC,BSLS, \
BSPC,A, R, S, T, D, H, N, E, I, O, QUOT, ENT, \
LSFT,Z, X, C, V, B, K, M, COMM,DOT, SLSH, RSFT, \
LCTL,LGUI,LALT, SPC, FN0, RGUI,APP, RCTL),
/* Layer 2: dvorak */
KEYMAP_ANSI(
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, LBRC,RBRC,BSPC, \
TAB, QUOT,COMM,DOT, P, Y, F, G, C, R, L, SLSH,EQL, BSLS, \
CAPS,A, O, E, U, I, D, H, T, N, S, MINS, ENT, \
LSFT,SCLN,Q, J, K, X, B, M, W, V, Z, RSFT, \
LCTL,LGUI,LALT, SPC, FN0, RGUI,APP, RCTL),
/* Layer3: workman */
KEYMAP_ANSI(
GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, \
TAB, Q, D, R, W, B, J, F, U, P, SCLN,LBRC,RBRC,BSLS, \
BSPC,A, S, H, T, G, Y, N, E, O, I, QUOT, ENT, \
LSFT,Z, X, M, C, V, K, L, COMM,DOT, SLSH, RSFT, \
LCTL,LGUI,LALT, SPC, FN0, RGUI,APP, RCTL),
/* Layer 4: Poker with Arrow */
};
static const uint8_t PROGMEM overlays[][MATRIX_ROWS][MATRIX_COLS] = {
/* Overlay 0: Poker with Arrow */
KEYMAP_ANSI(
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, UP, \
TRNS,TRNS,TRNS, TRNS, FN1, LEFT,DOWN,RGHT),
/* Layer 5: Poker with Esc */
/* Overlay 1: Poker with Esc */
KEYMAP_ANSI(
ESC, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \
TRNS,TRNS,TRNS, TRNS, FN2, TRNS,TRNS,TRNS),
/* Layer 6: Poker with Arrow and Esc */
/* Overlay 2: Poker with Arrow and Esc */
KEYMAP_ANSI(
ESC, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, \
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, UP, \
TRNS,TRNS,TRNS, TRNS, FN3, LEFT,DOWN,RGHT),
/* Layer 7: Poker Fn'd */
/* Overlay 3: Poker Fn'd */
KEYMAP_ANSI(
ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, \
TRNS,FN6, UP, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,CALC,TRNS,HOME,INS, TRNS, \
TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,PSCR,SLCK,PAUS,TRNS,FN8, END, TRNS, \
TRNS,DEL, TRNS,WHOM,MUTE,VOLU,VOLD,TRNS,PGUP,PGDN,DEL, TRNS, \
TRNS,TRNS,TRNS, FN5, FN4, TRNS,TRNS,TRNS),
/* Layer 8: Poker Fn'd arrow */
/* Overlay 4: Poker Fn'd arrow */
KEYMAP_ANSI(
ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, \
TRNS,FN7, UP, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,CALC,TRNS,HOME,INS, TRNS, \
TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,PSCR,SLCK,PAUS,TRNS,FN8, END, TRNS, \
TRNS,DEL, TRNS,WHOM,MUTE,VOLU,VOLD,TRNS,PGUP,PGDN,DEL, PGUP, \
TRNS,TRNS,TRNS, FN4, FN5, HOME,PGDN,END),
/* Layer 9: Poker Fn'd Esc */
/* Overlay 5: Poker Fn'd Esc */
KEYMAP_ANSI(
GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, \
TRNS,FN4, UP, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,CALC,TRNS,HOME,INS, TRNS, \
TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,PSCR,SLCK,PAUS,TRNS,FN8, END, TRNS, \
TRNS,DEL, TRNS,WHOM,MUTE,VOLU,VOLD,TRNS,PGUP,PGDN,DEL, TRNS, \
TRNS,TRNS,TRNS, FN7, FN6, TRNS,TRNS,TRNS),
/* Layer 10: Poker Fn'd Arrow + Esc */
/* Overlay 6: Poker Fn'd Arrow + Esc */
KEYMAP_ANSI(
GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, \
TRNS,FN5, UP, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,CALC,TRNS,HOME,INS, TRNS, \
@ -96,15 +67,15 @@ static const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
*/
static const uint16_t PROGMEM fn_actions[] = {
/* Poker Layout */
[0] = ACTION_LAYER_SET_P(7), // FN0 move to Fn'd when press
[1] = ACTION_LAYER_SET_P(8), // FN1 move to Fn'd arrow when press
[2] = ACTION_LAYER_SET_P(9), // FN2 move to Fn'd Esc when press
[3] = ACTION_LAYER_SET_P(10), // FN3 move to Fn'd arrow + Esc when press
[0] = ACTION_OVERLAY_SET_P(3), // FN0 move to Fn'd when press
[1] = ACTION_OVERLAY_SET_P(4), // FN1 move to Fn'd arrow when press
[2] = ACTION_OVERLAY_SET_P(5), // FN2 move to Fn'd Esc when press
[3] = ACTION_OVERLAY_SET_P(6), // FN3 move to Fn'd arrow + Esc when press
[4] = ACTION_LAYER_SET_R(0), // FN4 move to default when release
[5] = ACTION_LAYER_SET_R(4), // FN5 move to arrow when release
[6] = ACTION_LAYER_SET_R(5), // FN6 move to Esc when release
[7] = ACTION_LAYER_SET_R(6), // FN7 move to arrow + Esc when release
[4] = ACTION_OVERLAY_CLEAR, // FN4 clear overlay when release
[5] = ACTION_OVERLAY_SET_R(0), // FN5 move to arrow when release
[6] = ACTION_OVERLAY_SET_R(1), // FN6 move to Esc when release
[7] = ACTION_OVERLAY_SET_R(2), // FN7 move to arrow + Esc when release
[8] = ACTION_RMODS_KEY(MOD_BIT(KC_RCTL)|MOD_BIT(KC_RSFT), KC_ESC), // FN8 Task(RControl,RShift+Esc)
};