2013-12-12 08:06:29 +00:00
|
|
|
#include "keymap_common.h"
|
|
|
|
|
2013-11-21 04:08:32 +00:00
|
|
|
// Poker2
|
|
|
|
#ifdef KEYMAP_SECTION_ENABLE
|
2013-12-12 08:06:29 +00:00
|
|
|
const uint8_t keymaps[KEYMAPS_COUNT][MATRIX_ROWS][MATRIX_COLS] __attribute__ ((section (".keymap.keymaps"))) = {
|
2013-11-21 04:08:32 +00:00
|
|
|
#else
|
2013-12-12 08:06:29 +00:00
|
|
|
const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = {
|
2013-11-21 04:08:32 +00:00
|
|
|
#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| [| ]| \|
|
|
|
|
* |-----------------------------------------------------------|
|
2013-12-02 02:22:34 +00:00
|
|
|
* |Caps | A| S| D| F| G| H| J| K| L| ;| '|Return |
|
2013-11-21 04:08:32 +00:00
|
|
|
* |-----------------------------------------------------------|
|
2013-12-12 03:58:14 +00:00
|
|
|
* |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Fn0|
|
2013-11-21 04:08:32 +00:00
|
|
|
* |-----------------------------------------------------------|
|
|
|
|
* |Ctrl|Gui |Alt | Space |Alt |Fn0 |Gui |Ctrl|
|
|
|
|
* `-----------------------------------------------------------'
|
|
|
|
*/
|
2013-12-12 03:58:14 +00:00
|
|
|
KEYMAP(
|
2013-11-21 04:08:32 +00:00
|
|
|
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, \
|
2013-12-12 03:58:14 +00:00
|
|
|
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,FN0, RSFT, \
|
2014-05-26 04:37:54 +00:00
|
|
|
LCTL,LGUI,LALT, SPC, RALT,FN0, RGUI,RCTL),
|
2013-11-21 04:08:32 +00:00
|
|
|
/* Keymap 1: Fn Layer
|
|
|
|
* ,-----------------------------------------------------------.
|
|
|
|
* | `| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delete |
|
|
|
|
* |-----------------------------------------------------------|
|
|
|
|
* | | |Up | | | |Cal| |Ins| |Psc|Slk|Pau| |
|
|
|
|
* |-----------------------------------------------------------|
|
|
|
|
* | |Lef|Dow|Rig| | | | | | |Hom|PgU| |
|
|
|
|
* |-----------------------------------------------------------|
|
2013-12-12 03:58:14 +00:00
|
|
|
* | | |App|Fn1|Fn2|Fn3|VoD|VoU|Mut|End|PgD| | |
|
2013-11-21 04:08:32 +00:00
|
|
|
* |-----------------------------------------------------------|
|
|
|
|
* | | | | | | | | |
|
|
|
|
* `-----------------------------------------------------------'
|
|
|
|
*/
|
2013-12-12 03:58:14 +00:00
|
|
|
KEYMAP(
|
2013-11-21 04:08:32 +00:00
|
|
|
GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, DEL, \
|
|
|
|
TRNS,TRNS,UP, TRNS,TRNS,TRNS,CALC,TRNS,INS, TRNS,PSCR,SLCK,PAUS,TRNS, \
|
2013-12-12 03:58:14 +00:00
|
|
|
TRNS,LEFT,DOWN,RGHT,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,HOME,PGUP,NO, TRNS, \
|
|
|
|
TRNS,NO, TRNS,APP, FN1, FN2, FN3, VOLD,VOLU,MUTE,END, PGDN,TRNS,TRNS, \
|
2014-05-26 04:37:54 +00:00
|
|
|
TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS),
|
2013-11-21 04:08:32 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Fn action definition
|
|
|
|
*/
|
|
|
|
#ifdef KEYMAP_SECTION_ENABLE
|
2013-12-12 08:06:29 +00:00
|
|
|
const uint16_t fn_actions[FN_ACTIONS_COUNT] __attribute__ ((section (".keymap.fn_actions"))) = {
|
2013-11-21 04:08:32 +00:00
|
|
|
#else
|
2013-12-12 08:06:29 +00:00
|
|
|
const uint16_t fn_actions[] PROGMEM = {
|
2013-11-21 04:08:32 +00:00
|
|
|
#endif
|
|
|
|
/* Poker2 Layout */
|
|
|
|
[0] = ACTION_LAYER_MOMENTARY(1),
|
|
|
|
[1] = ACTION_BACKLIGHT_DECREASE(),
|
|
|
|
[2] = ACTION_BACKLIGHT_TOGGLE(),
|
|
|
|
[3] = ACTION_BACKLIGHT_INCREASE()
|
|
|
|
};
|
2013-12-12 08:06:29 +00:00
|
|
|
|
2014-05-26 04:37:54 +00:00
|
|
|
#ifdef KEYMAP_IN_EEPROM_ENABLE
|
2013-12-12 08:06:29 +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-11-18 09:36:29 +00:00
|
|
|
|
2014-11-27 06:32:14 +00:00
|
|
|
enum macro_id {
|
|
|
|
KEYPAD_00 = 0,
|
|
|
|
};
|
|
|
|
|
|
|
|
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
|
|
|
{
|
|
|
|
switch (id) {
|
|
|
|
case KEYPAD_00:
|
|
|
|
return (record->event.pressed ?
|
|
|
|
MACRO( T(P0), T(P0), END ) :
|
|
|
|
MACRO_NONE );
|
|
|
|
}
|
|
|
|
return MACRO_NONE;
|
|
|
|
}
|
|
|
|
|
|
|
|
enum function_id {
|
2014-11-18 09:36:29 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|