2014-03-11 03:12:47 +00:00
|
|
|
#include "keymap_common.h"
|
|
|
|
|
|
|
|
// Poker2
|
|
|
|
#ifdef KEYMAP_SECTION_ENABLE
|
|
|
|
const uint8_t keymaps[KEYMAPS_COUNT][MATRIX_ROWS][MATRIX_COLS] __attribute__ ((section (".keymap.keymaps"))) = {
|
|
|
|
#else
|
|
|
|
const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
|
|
|
|
#endif
|
|
|
|
/* Keymap 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| [| ]| \|Del|
|
|
|
|
* |---------------------------------------------------------------|
|
|
|
|
* |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return |PgU|
|
|
|
|
* |---------------------------------------------------------------|
|
|
|
|
* |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Up |PgD|
|
|
|
|
* |---------------------------------------------------------------|
|
2014-06-26 08:49:49 +00:00
|
|
|
* |Ctrl |Gui |Alt | Space |Alt |Ctrl |Lef|Dow|Rig|
|
2014-03-11 03:12:47 +00:00
|
|
|
* `---------------------------------------------------------------'
|
2014-06-26 08:49:49 +00:00
|
|
|
* | Fn0 |
|
|
|
|
* `----------------------'
|
2014-03-11 03:12:47 +00:00
|
|
|
*/
|
|
|
|
KEYMAP(
|
|
|
|
ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC,GRV, \
|
|
|
|
TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS,DEL, \
|
|
|
|
CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, PGUP, \
|
|
|
|
LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT,UP, PGDN, \
|
2014-06-26 08:49:49 +00:00
|
|
|
LCTL,LGUI,LALT, SPC, RALT,RCTL,LEFT,DOWN,RGHT, \
|
2014-03-11 03:12:47 +00:00
|
|
|
FN0 ),
|
|
|
|
/* Keymap 1: Fn Layer
|
|
|
|
* ,---------------------------------------------------------------.
|
2014-06-26 08:49:49 +00:00
|
|
|
* |Mut| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| | |
|
2014-03-11 03:12:47 +00:00
|
|
|
* |---------------------------------------------------------------|
|
2014-07-05 12:43:21 +00:00
|
|
|
* | | |Up | | | | | | | |Psc|Slk|Pau| Ins| |
|
2014-03-11 03:12:47 +00:00
|
|
|
* |---------------------------------------------------------------|
|
2014-07-05 12:43:21 +00:00
|
|
|
* | |Lef|Dow|Rig| | | | | | | | |Fn1 |Hom|
|
2014-03-11 03:12:47 +00:00
|
|
|
* |---------------------------------------------------------------|
|
2014-06-26 08:49:49 +00:00
|
|
|
* | | | | | | | | | | | | |VoU|End|
|
2014-03-11 03:12:47 +00:00
|
|
|
* |---------------------------------------------------------------|
|
2014-06-26 08:49:49 +00:00
|
|
|
* | | | | | | |Fn2|VoD|Fn3|
|
2014-03-11 03:12:47 +00:00
|
|
|
* `---------------------------------------------------------------'
|
2014-06-26 08:49:49 +00:00
|
|
|
* | |
|
|
|
|
* `----------------------'
|
2014-03-11 03:12:47 +00:00
|
|
|
*/
|
|
|
|
KEYMAP(
|
2014-06-26 08:49:49 +00:00
|
|
|
MUTE,F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS,TRNS, \
|
2014-07-05 12:43:21 +00:00
|
|
|
TRNS,TRNS,UP, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PSCR,SLCK,PAUS,INS, TRNS, \
|
|
|
|
TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, FN1, HOME, \
|
2014-06-26 08:49:49 +00:00
|
|
|
TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,VOLU,END, \
|
|
|
|
TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,FN3, VOLD,FN3, \
|
|
|
|
TRNS ),
|
2014-03-11 03:12:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Fn action definition
|
|
|
|
*/
|
|
|
|
#ifdef KEYMAP_SECTION_ENABLE
|
|
|
|
const uint16_t fn_actions[FN_ACTIONS_COUNT] __attribute__ ((section (".keymap.fn_actions"))) = {
|
|
|
|
#else
|
|
|
|
const uint16_t fn_actions[] PROGMEM = {
|
|
|
|
#endif
|
|
|
|
/* Poker2 Layout */
|
|
|
|
[0] = ACTION_LAYER_MOMENTARY(1),
|
|
|
|
[1] = ACTION_BACKLIGHT_DECREASE(),
|
|
|
|
[2] = ACTION_BACKLIGHT_TOGGLE(),
|
|
|
|
[3] = ACTION_BACKLIGHT_INCREASE()
|
|
|
|
};
|
|
|
|
|
2014-07-05 12:43:21 +00:00
|
|
|
#ifdef KEYMAP_IN_EEPROM_ENABLE
|
2014-03-11 03:12:47 +00:00
|
|
|
uint16_t keys_count(void) {
|
|
|
|
return sizeof(keymaps) / sizeof(keymaps[0]) * MATRIX_ROWS * MATRIX_COLS;
|
|
|
|
}
|
|
|
|
|
|
|
|
uint16_t fn_actions_count(void) {
|
|
|
|
return sizeof(fn_actions) / sizeof(fn_actions[0]);
|
|
|
|
}
|
|
|
|
#endif
|
2014-12-10 10:51:11 +00:00
|
|
|
|
|
|
|
enum function_id {
|
|
|
|
TRICKY_ESC = 0,
|
|
|
|
};
|
|
|
|
|
|
|
|
#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
|
|
|
|
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
|
|
|
|
{
|
|
|
|
static uint8_t tricky_esc_registered;
|
|
|
|
switch (id) {
|
|
|
|
case TRICKY_ESC:
|
|
|
|
if (record->event.pressed) {
|
|
|
|
if (get_mods() & MODS_SHIFT_MASK) {
|
|
|
|
tricky_esc_registered = KC_GRV;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
tricky_esc_registered = KC_ESC;
|
|
|
|
}
|
|
|
|
register_code(tricky_esc_registered);
|
|
|
|
send_keyboard_report();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
unregister_code(tricky_esc_registered);
|
|
|
|
send_keyboard_report();
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|