2017-04-02 02:27:24 -07:00
|
|
|
//Author: tong92 <tong92power@gmail.com>
|
2018-09-13 09:40:43 -07:00
|
|
|
#include QMK_KEYBOARD_H
|
2017-04-02 02:27:24 -07:00
|
|
|
|
|
|
|
#ifdef BACKLIGHT_ENABLE
|
|
|
|
#include "backlight.h"
|
|
|
|
#endif
|
|
|
|
|
2018-08-11 13:24:06 -07:00
|
|
|
extern keymap_config_t keymap_config;
|
|
|
|
|
|
|
|
enum tv44_layers {
|
|
|
|
_WINDOW,
|
|
|
|
_MAC,
|
|
|
|
_LOWER,
|
|
|
|
_RAISE,
|
|
|
|
_WINDOW_SHORTCUT,
|
|
|
|
_MAC_SHORTCUT,
|
|
|
|
_MOUSE
|
|
|
|
};
|
|
|
|
|
|
|
|
enum tv44_keycodes {
|
|
|
|
WINDOW = SAFE_RANGE,
|
|
|
|
MAC,
|
|
|
|
MOUSE,
|
|
|
|
BACKLIT,
|
|
|
|
EXT_MOUSE
|
|
|
|
};
|
|
|
|
|
2020-02-29 12:00:00 -08:00
|
|
|
#define LOWER LT(_LOWER, KC_SPC)
|
|
|
|
#define RAISE LT(_RAISE, KC_SPC)
|
2018-08-11 13:24:06 -07:00
|
|
|
#define WINDOW_SHORTCUT MO(_WINDOW_SHORTCUT)
|
|
|
|
#define MAC_SHORTCUT MO(_MAC_SHORTCUT)
|
2017-04-02 02:27:24 -07:00
|
|
|
|
|
|
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|
|
|
|
2018-08-11 13:24:06 -07:00
|
|
|
/* Window - Qwerty
|
2017-04-02 02:27:24 -07:00
|
|
|
* ,--------------------------------------------------------------------------.
|
|
|
|
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
|
|
|
|
* |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------|
|
|
|
|
* | Ctrl | A | S | D | F | G | H | J | K | L | ; | Enter|
|
|
|
|
* |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------|
|
|
|
|
* | Shift | Z | X | C | V | B | N | M | , | . | / |Shift|
|
|
|
|
* |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----|
|
2018-08-11 13:24:06 -07:00
|
|
|
* | Ft | GUI | Alt | Space/LOWER | Space/RAISE | ' | [ | ] | Alt |
|
2017-04-02 02:27:24 -07:00
|
|
|
* `--------------------------------------------------------------------------'
|
|
|
|
*/
|
2018-08-11 13:24:06 -07:00
|
|
|
[_WINDOW] = LAYOUT_arrow(
|
2017-06-15 12:48:59 -07:00
|
|
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
|
|
|
|
KC_LCTL,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_ENT,
|
|
|
|
KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT,
|
2018-08-11 13:24:06 -07:00
|
|
|
WINDOW_SHORTCUT, KC_LGUI,KC_LALT, LOWER, RAISE, KC_QUOT,KC_LBRC,KC_RBRC,KC_RALT
|
|
|
|
),
|
|
|
|
/* Mac - Qwerty
|
|
|
|
* ,--------------------------------------------------------------------------.
|
|
|
|
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
|
|
|
|
* |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------|
|
|
|
|
* | Cmd | A | S | D | F | G | H | J | K | L | ; | Enter|
|
|
|
|
* |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------|
|
|
|
|
* | Shift | Z | X | C | V | B | N | M | , | . | / |Shift|
|
|
|
|
* |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----|
|
|
|
|
* | Ft | Alt | Ctrl | Space/LOWER | Space/RAISE | ' | [ | ] | Alt |
|
|
|
|
* `--------------------------------------------------------------------------'
|
|
|
|
*/
|
|
|
|
[_MAC] = LAYOUT_arrow(
|
|
|
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
|
|
|
|
KC_LGUI,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_ENT,
|
|
|
|
KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT,
|
2022-10-16 06:14:40 -07:00
|
|
|
MAC_SHORTCUT, KC_LALT, KC_LCTL, LOWER, RAISE, KC_QUOT,KC_LBRC,KC_RBRC,KC_RALT
|
2017-06-15 12:48:59 -07:00
|
|
|
),
|
2017-04-02 02:27:24 -07:00
|
|
|
/* LOWER
|
|
|
|
* ,--------------------------------------------------------------------------.
|
|
|
|
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | |
|
|
|
|
* |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------|
|
|
|
|
* | | F1 | F2 | F3 | F4 | F5 | F6 | - | + | [ | ] | \ |
|
|
|
|
* |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------|
|
|
|
|
* | | F7 | F8 | F9 | F10 | F11 | F12 | | HOME| PgUp| UP | PgDo|
|
|
|
|
* |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----|
|
|
|
|
* | | | | | | END | LEFT| Down|RIGHT|
|
|
|
|
* `--------------------------------------------------------------------------'
|
|
|
|
*/
|
2018-08-11 13:24:06 -07:00
|
|
|
[_LOWER] = LAYOUT_arrow(
|
2017-06-15 12:48:59 -07:00
|
|
|
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______,
|
|
|
|
_______,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS,KC_PLUS,KC_LBRC,KC_RBRC,KC_BSLS,
|
|
|
|
_______,KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX,KC_HOME,KC_PGUP,KC_UP ,KC_PGDN,
|
|
|
|
XXXXXXX,_______,_______, _______,XXXXXXX, KC_END, KC_LEFT,KC_DOWN,KC_RIGHT
|
|
|
|
),
|
2017-04-02 02:27:24 -07:00
|
|
|
/* RAISE
|
|
|
|
* ,--------------------------------------------------------------------------.
|
|
|
|
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | |
|
|
|
|
* |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------|
|
|
|
|
* | | F1 | F2 | F3 | F4 | F5 | F6 | _ | = | { | } | | |
|
|
|
|
* |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------|
|
|
|
|
* | | F7 | F8 | F9 | F10 | F11 | F12 | | HOME| PgUp| UP | PgDo|
|
|
|
|
* |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----|
|
|
|
|
* | | | | | | END | LEFT| Down|RIGHT|
|
|
|
|
* `--------------------------------------------------------------------------'
|
|
|
|
*/
|
2018-08-11 13:24:06 -07:00
|
|
|
[_RAISE] = LAYOUT_arrow(
|
2017-06-15 12:48:59 -07:00
|
|
|
KC_TILD,KC_EXLM,KC_AT, KC_HASH,KC_DLR, KC_PERC,KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN,_______,
|
|
|
|
_______,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS,KC_EQL, KC_LCBR,KC_RCBR,KC_PIPE,
|
|
|
|
_______,KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______,KC_HOME,KC_PGUP,KC_UP ,KC_PGDN,
|
|
|
|
XXXXXXX,_______,_______, _______,_______, KC_END, KC_LEFT,KC_DOWN,KC_RIGHT
|
|
|
|
),
|
2018-08-11 13:24:06 -07:00
|
|
|
/* Window Shortcut
|
2017-04-02 02:27:24 -07:00
|
|
|
* ,--------------------------------------------------------------------------.
|
|
|
|
* | ESC |WinOf|WinUp| | |Sh+Ca| | PgUp| UP | PgDo|PrtSc| DELET |
|
|
|
|
* |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------|
|
|
|
|
* | |WinLe|WinDo|WinRi| |Al+Ca|CapsL| LEFT| DOWN|RIGHT| | |
|
|
|
|
* |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------|
|
|
|
|
* | |WinLW|WinRW| | |Ct+Ca|ScroL| HOME| | END | | Ctrl|
|
|
|
|
* |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----|
|
|
|
|
* | | DeskL | DeskR| Task Manager| DeskX | MOUSE| | | LED |
|
|
|
|
* `--------------------------------------------------------------------------'
|
|
|
|
*/
|
2018-08-11 13:24:06 -07:00
|
|
|
[_WINDOW_SHORTCUT] = LAYOUT_arrow(
|
2019-08-02 12:52:53 -07:00
|
|
|
KC_ESC ,LALT(KC_F4) ,LGUI(KC_UP) ,XXXXXXX ,XXXXXXX,S(KC_CAPS) ,XXXXXXX ,KC_PGUP,KC_UP ,KC_PGDN ,KC_PSCR,KC_DEL,
|
2017-06-15 12:48:59 -07:00
|
|
|
_______,LGUI(KC_LEFT) ,LGUI(KC_DOWN) ,LGUI(KC_RIGHT),XXXXXXX,LALT(KC_CAPS) ,KC_CAPS ,KC_LEFT,KC_DOWN,KC_RIGHT,XXXXXXX,XXXXXXX,
|
2022-10-15 14:29:43 -07:00
|
|
|
_______,LGUI(LSFT(KC_LEFT)),LGUI(LSFT(KC_RIGHT)),XXXXXXX ,XXXXXXX,LCTL(KC_CAPS) ,KC_SCRL ,KC_HOME,XXXXXXX,KC_END ,XXXXXXX,KC_RCTL,
|
2019-08-02 12:52:53 -07:00
|
|
|
_______,LGUI(LCTL(KC_LEFT)),LGUI(LCTL(KC_RIGHT)), LCTL(LALT(KC_DEL)) ,LGUI(LCTL(KC_F4)), MOUSE ,XXXXXXX ,XXXXXXX,BACKLIT
|
2018-08-11 13:24:06 -07:00
|
|
|
),
|
|
|
|
/* Mac Shortcut
|
|
|
|
* ,--------------------------------------------------------------------------.
|
|
|
|
* | ESC |CmdUp|CmdDo| | | | | PgUp| UP | PgDo|PrtSc| DELET |
|
|
|
|
* |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------|
|
|
|
|
* | |WBlkL|WBlkR| |ScrFu| |CapsL| LEFT| DOWN|RIGHT| | |
|
|
|
|
* |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------|
|
|
|
|
* | |BlckL|BlckR| | | | | HOME| | END | | Ctrl|
|
|
|
|
* |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----|
|
|
|
|
* | | | | | | MOUSE| | | LED |
|
|
|
|
* `--------------------------------------------------------------------------'
|
|
|
|
*/
|
|
|
|
[_MAC_SHORTCUT] = LAYOUT_arrow(
|
2019-08-02 12:52:53 -07:00
|
|
|
KC_ESC ,LGUI(KC_UP) ,LGUI(KC_DOWN) ,XXXXXXX ,XXXXXXX,XXXXXXX ,XXXXXXX ,KC_PGUP,KC_UP ,KC_PGDN ,KC_PSCR,KC_DEL,
|
2018-08-11 13:24:06 -07:00
|
|
|
_______,LALT(LSFT(KC_LEFT)) ,LALT(LSFT(KC_RIGHT)) ,XXXXXXX,LGUI(LCTL(KC_F)),XXXXXXX ,KC_CAPS ,KC_LEFT,KC_DOWN,KC_RIGHT,XXXXXXX,XXXXXXX,
|
|
|
|
_______,LGUI(LSFT(KC_LEFT)),LGUI(LSFT(KC_RIGHT)),XXXXXXX ,XXXXXXX,XXXXXXX ,XXXXXXX ,KC_HOME,XXXXXXX,KC_END ,XXXXXXX,KC_RCTL,
|
|
|
|
_______,_______,_______, _______,_______, MOUSE ,XXXXXXX ,XXXXXXX,BACKLIT
|
2017-06-15 12:48:59 -07:00
|
|
|
),
|
2017-04-02 02:27:24 -07:00
|
|
|
/* MOUSE
|
|
|
|
* ,--------------------------------------------------------------------------.
|
2022-08-21 15:55:30 -07:00
|
|
|
* | | | |Mo_Up| | | |M_WhL|M_WhU|M_WhR| | QK_BOOT |
|
2017-04-02 02:27:24 -07:00
|
|
|
* |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------|
|
|
|
|
* | | |Mo_Le|Mo_Do|Mo_Ri| | |M_Bt1|M_WhD|M_Bt2| | |
|
|
|
|
* |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------|
|
2018-08-11 13:24:06 -07:00
|
|
|
* | | | | | | | |M_AC0|M_AC1|M_AC2| |WINDO|
|
2017-04-02 02:27:24 -07:00
|
|
|
* |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----|
|
2018-08-11 13:24:06 -07:00
|
|
|
* | | | | GO_DEFAULT | GO_DEFAULT | | | | MAC |
|
2017-04-02 02:27:24 -07:00
|
|
|
* `--------------------------------------------------------------------------'
|
|
|
|
*/
|
2018-08-11 13:24:06 -07:00
|
|
|
[_MOUSE] = LAYOUT_arrow(
|
2022-08-21 15:55:30 -07:00
|
|
|
XXXXXXX,XXXXXXX,XXXXXXX,KC_MS_U,XXXXXXX,XXXXXXX,XXXXXXX,KC_WH_L,KC_WH_U,KC_WH_R,XXXXXXX,QK_BOOT,
|
2017-06-15 12:48:59 -07:00
|
|
|
XXXXXXX,XXXXXXX,KC_MS_L,KC_MS_D,KC_MS_R,XXXXXXX,XXXXXXX,KC_BTN1,KC_WH_D,KC_BTN2,XXXXXXX,XXXXXXX,
|
2018-08-11 13:24:06 -07:00
|
|
|
XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,KC_ACL0,KC_ACL1,KC_ACL2,XXXXXXX,WINDOW,
|
|
|
|
XXXXXXX,XXXXXXX,XXXXXXX, EXT_MOUSE,EXT_MOUSE, XXXXXXX,XXXXXXX,XXXXXXX,MAC
|
2017-06-15 12:48:59 -07:00
|
|
|
)
|
2017-04-02 02:27:24 -07:00
|
|
|
};
|
|
|
|
|
2018-08-11 13:24:06 -07:00
|
|
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|
|
|
switch(keycode) {
|
|
|
|
case WINDOW:
|
|
|
|
if (record->event.pressed) {
|
|
|
|
set_single_persistent_default_layer(_WINDOW);
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
break;
|
|
|
|
case MAC:
|
|
|
|
if (record->event.pressed) {
|
|
|
|
set_single_persistent_default_layer(_MAC);
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
break;
|
|
|
|
case BACKLIT:
|
|
|
|
if (record->event.pressed) {
|
|
|
|
#ifdef BACKLIGHT_ENABLE
|
|
|
|
backlight_step();
|
|
|
|
#endif
|
2017-04-02 02:27:24 -07:00
|
|
|
}
|
2018-08-11 13:24:06 -07:00
|
|
|
return false;
|
|
|
|
break;
|
|
|
|
case MOUSE:
|
|
|
|
if (record->event.pressed) {
|
|
|
|
layer_on(_MOUSE);
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
break;
|
|
|
|
case EXT_MOUSE:
|
|
|
|
if (record->event.pressed) {
|
|
|
|
layer_off(_MOUSE);
|
|
|
|
layer_off(_WINDOW_SHORTCUT);
|
|
|
|
layer_off(_MAC_SHORTCUT);
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return true;
|
2017-06-15 12:48:59 -07:00
|
|
|
};
|
2018-08-11 13:24:06 -07:00
|
|
|
|