aboutsummaryrefslogtreecommitdiffstats
path: root/src/keymap.h
blob: 41f3a209e1e5ede5cd69904d8df4ca57f065e619 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/***********************************************************************
 * A firmware Sketch for the Keyboardio Model 01 -- keymap
 * Copyright © 2016, 2017, 2018 Gergely Nagy
 * Copyright © 2019 Guilhem Moulin <guilhem@fripost.org>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or (at
 * your option) any later version.

 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 **********************************************************************/

#pragma once


/* Layers */
enum {
    DVORAK
  , NAV
  , NUM

  , LAYER_MAX = NUM
};

#define Key_LockScreen Consumer_AL_TerminalLockSlashScreensaver
#define Key_PlayPause  Consumer_PlaySlashPause
#define Key_Plus       LSHIFT(Key_Equals)
#define Key_Underscore LSHIFT(Key_Minus)


/* Keymaps */
KEYMAPS(
    [DVORAK] = KEYMAP_STACKED(
        ___,          M(LEFT_BRACKET), M(AT),     M(STAR),    M(DOLLAR), M(CARET), ___
      , Key_Backtick, Key_Quote,       Key_Comma, Key_Period, Key_P,     Key_Y,    TD(LPB)
      , Key_Tab,      Key_A,           Key_O,     Key_E,      Key_U,     Key_I
      , ___,          Key_Slash,       Key_Q,     Key_J,      Key_K,     Key_X,    TD(COLON)

      , OSM(LeftControl), Key_Backspace, OSM(LeftShift), Key_Escape
      , OSL(NAV)

      , ___,        M(PERCENT), M(BANG), M(HASH), M(AMPERSAND), M(RIGHT_BRACKET), ___
      , TD(RPB),    Key_F,      Key_G,   Key_C,   Key_R,        Key_L,            Key_Backslash
      ,             Key_D,      Key_H,   Key_T,   Key_N,        Key_S,            Key_Minus
      , Key_Equals, Key_B,      Key_M,   Key_W,   Key_V,        Key_Z,            ___

      , Key_LeftGui, Key_Enter, Key_Spacebar, OSM(RightAlt)
      , OSL(NUM)
    )


  , [NAV] = KEYMAP_STACKED(
        Key_LockScreen, Key_F1,           Key_F2,          Key_F3,      Key_F4,          Key_F5,            Key_PrintScreen
      , XXX,            Key_mouseScrollR, Key_mouseWarpNW, Key_mouseUp, Key_mouseWarpNE, Key_mouseScrollDn, Key_mouseWarpEnd
      , XXX,            Key_mouseScrollL, Key_mouseL,      Key_mouseDn, Key_mouseR,      Key_mouseScrollUp
      , ___,            XXX,              Key_mouseWarpSW, XXX,         Key_mouseWarpSE, XXX,               Key_mouseBtnL

      , ___, Key_Delete, ___, ___
      , ___

      , ___,           Key_F6,       Key_F7,        Key_F8,        Key_F9,         Key_F10, Key_F11
      , Key_PlayPause, Key_PageUp,   Key_Home,      Key_UpArrow,   Key_End,        XXX,     Key_F12
      ,                Key_PageDown, Key_LeftArrow, Key_DownArrow, Key_RightArrow, XXX,     XXX
      , Key_mouseBtnR, XXX,          XXX,           XXX,           XXX,            XXX,     Key_Insert

      , ___, ___, Key_Enter, ___
      , ___
    )


  , [NUM] = KEYMAP_STACKED(
        ___, ___, ___, ___, ___, ___, ___
      , ___, ___, ___, ___, ___, ___, ___
      , ___, ___, ___, ___, ___, ___
      , ___, ___, ___, ___, ___, ___, ___

      , ___, ___, ___, ___
      , ___

      , XXX,            XXX,        XXX, XXX,     XXX,   XXX,       XXX
      , XXX,            XXX,        Key_1, Key_2, Key_3, XXX,       Key_Equals
      ,                 Key_0,      Key_4, Key_5, Key_6, Key_Minus, Key_Plus
      , Key_Underscore, Key_Period, Key_7, Key_8, Key_9, XXX,       XXX

      , ___, ___, ___, ___
      , ___
    )
)

/* Magic Combos */
USE_MAGIC_COMBOS(
    [MIDDLE_CLICK] = {
        .action = comboMiddleClick
        /* Nav + LeftClick + RightClick */
      , .keys   = {R3C6, R2C6, R2C9}
    }
)