summaryrefslogtreecommitdiff
path: root/users/ericgebhart/layers/nav.h
blob: 97243872e277990ba8562aaeef272275ed817467 (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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
/*
  Copyright 2018-2022 Eric Gebhart <e.a.gebhart@gmail.com>

  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 2 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/>.
*/
/********************************************************************************/
/* NAVIGATION  - MOUSE, Scroll, Buttons, Arrows, Tab, Home, page up/down, End   */
/* Navigation layers:                                                           */
/*    3 row Layer                                                               */
/*    4 Row Layer with repeated and swapped VI arrows, and Scroll wheel.        */
/********************************************************************************/
/*                                                                              */
/* Navigation layer with optional 4th Row....                                   */
/*                                                                              */
/* M = Mouse                                                                    */
/* B = Button                                                                   */
/* W = Wheel                                                                    */
/* AC   = Acceleration                                                          */
/* CCCV = Tap -> Ctrl-C, hold for double tap duration -> Ctrl-V                 */
/* CTCN = Tap -> Ctrl-T, hold for double tap duration -> Ctrl-N                 */
/* CWCQ = Tap -> Ctrl-W, hold for double tap duration -> Ctrl-Q                 */
/* HOME = TAB & PGDN                                                            */
/* END =  BKTAB & PGUP -- See combos.                                           */
/*                                                                              */
/* MB5  MB4    MB3    MB2  MB1     MAC0  |  CTCN  MB1    MB2    MB3  MB4   MB5 */
/* TAB  MLeft  MDown  MUp  MRight  MAC1  |  CCCV  Left   Down   UP   Right TAB */
/*      WLeft  WDown  WUp  WRight  MAC2  |  CWCQ  TAB    PGDN   PGUP BKTAB       */
/*                                                                              */
/*      Left   Down   Up   Right   CCCV  |  CCCV   MLeft  MDown  MUp  MRight    */
/*                                                                              */
/********************************************************************************/

#ifdef MOUSEKEY_ENABLE
#define ___MOUSE_LDUR___      KC_MS_L,  KC_MS_D,  KC_MS_U,  KC_MS_R
#define ___MWHEEL_LDUR___     KC_WH_L,  KC_WH_D,  KC_WH_U,  KC_WH_R
//  really BTN 1, 2, 3, 8, 9 - according to xev.
#define ___MOUSE_BTNS_R___    KC_BTN1,  KC_BTN3,  KC_BTN2,  KC_BTN4,  KC_BTN5
#define ___4MOUSE_BTNS_R___   KC_BTN1,  KC_BTN3,  KC_BTN2,  KC_BTN4
#define ___3MOUSE_BTNS_R___   KC_BTN1,  KC_BTN3,  KC_BTN2
//  really BTN 9, 8, 3, 2, 1 - according to xev
#define ___4MOUSE_BTNS_L___   KC_BTN4,  KC_BTN2,  KC_BTN3,  KC_BTN1
#define ___MOUSE_BTNS_L___    KC_BTN5,  KC_BTN4,  KC_BTN2,  KC_BTN3,  KC_BTN1
#define ___MOUSE_ACCL_012___  KC_ACL0,  KC_ACL1,  KC_ACL2
#define ___MACCL___ ___MOUSE_ACCL_012___
#endif

#define ___VI_ARROWS___           KC_LEFT, KC_DOWN, KC_UP,   KC_RIGHT
#define ___HOME_PGDN_PGUP_END___  KC_HOME,  KC_PGDN, KC_PGUP, KC_END
#define ___TAB_PGDN_PGUP_BKTAB___ KC_TAB,  KC_PGDN, KC_PGUP, KC_BKTAB
// home and end are combos.  tab/pgdn = home, bktab/pgup = end.

#define ___REDO_CUT_COPY_PASTE_UNDO___ S_REDO, S_CUT, S_COPY, S_PASTE, S_UNDO

#ifdef MOUSEKEY_ENABLE
#define ___NAV_La_1___ ___SML_MODS_L___, KC_ACL0
#define ___NAV_L_1___ ___4MOUSE_BTNS_L___, KC_ACL0
#define ___NAV_L_2___ ___MOUSE_LDUR___,  KC_ACL1
#define ___NAV_L_3___ ___MWHEEL_LDUR___, KC_ACL2
#define ___NAV_L_4___ ___VI_ARROWS___,   KC_CCCV

#define ___NAV_R_1___  KC_CTCN, ___4MOUSE_BTNS_R___
#define ___NAV_R_4___  KC_CCCV, ___MOUSE_LDUR___

#else

#define ___NAV_La_1___ ___NAV_L_1___
#define ___NAV_L_1___  ___OS_MODS_L___
#define ___NAV_L_2___  ___SML_MODS_L___, ___
#define ___NAV_L_3___  ___5___
#define ___NAV_L_4___  ___VI_ARROWS___,   KC_CCCV

#define ___NAV_R_1___  KC_CTCN, ___SML_MODS_R___
#define ___NAV_R_4___  KC_CCCV, ___4___

#endif // end mousekey

#define ___NAV_R_2___  KC_CCCV, ___VI_ARROWS___
#define ___NAV_R_3___  KC_CWCQ, ___HOME_PGDN_PGUP_END___
#define ___NAV_Ra_3___ KC_CWCQ, ___TAB_PGDN_PGUP_BKTAB___

#ifdef MOUSEKEY_ENABLE

#define ___6NAV_L_1___ ___MOUSE_BTNS_L___,           KC_ACL0
#define ___6NAV_L_2___ TAB_BKTAB, ___MOUSE_LDUR___,  KC_ACL1
#define ___6NAV_L_3___ ___,       ___MWHEEL_LDUR___, KC_ACL2
#define ___6NAV_L_4___ ___,       ___VI_ARROWS___,   KC_CCCV

#define ___6NAV_R_1___ KC_CTCN, ___MOUSE_BTNS_R___
#define ___6NAV_R_4___ KC_CCCV, ___MOUSE_LDUR___, ___

#else

#define ___6NAV_L_1___ ___6___
#define ___6NAV_L_2___ TAB_BKTAB, ___SML_MODS_L___, ___

#define ___6NAV_L_3___ ___,       ___5___
#define ___6NAV_L_4___ ___,       ___VI_ARROWS___,   KC_CCCV

#define ___6NAV_R_1___ KC_CTCN, ___SML_MODS_R___
#define ___6NAV_R_4___ KC_CCCV, ___4___, ___

#endif // end mousekey

#define ___6NAV_R_2___ KC_CCCV, ___VI_ARROWS___,          TAB_BKTAB
#define ___6NAV_R_3___ KC_CWCQ, ___HOME_PGDN_PGUP_END___, ___

// compact. 3x10 per layer.
#define ___10_NAV_1a___ ___NAV_La_1___, ___NAV_R_1___
#define ___10_NAV_1___ ___NAV_L_1___, ___NAV_R_1___
#define ___10_NAV_2___ ___NAV_L_2___, ___NAV_R_2___
#define ___10_NAV_3___ ___NAV_L_3___, ___NAV_Ra_3___

// designed without mouse, mods on left.
#define ___NAVnm_La_1___ ___NAV_L_1___
#define ___NAVnm_L_1___  ___SML_MODS_L___
#define ___NAVnm_L_2___  ___OS_MODS_L___, ___
#ifdef MOUSEKEY_ENABLE
#define ___NAVnm_L_3___  ___2___, SML_NAVm, ___2___  // get to mouse layer if enabled.
#else
#define ___NAVnm_L_3___  ___5___
#endif

#define ___10_NAVnm_1___ ___SML_MODS_L___, ___, ___NAV_R_1___
#define ___10_NAVnm_2___ ___OS_MODS_L___, ___NAV_R_2___
#define ___10_NAVnm_3___ ___NAVnm_L_3___, ___NAV_R_3___

#ifdef MOUSEKEY_ENABLE
// Mouse layer only. mods on right.
#define ___10_NAVm_1___ ___NAV_L_1___, ___NAV_R_1___
#define ___10_NAVm_2___ ___NAV_L_2___, ___NAV_R_2___
#define ___10_NAVm_3___ ___NAV_L_3___, ___NAV_R_3___
#endif

/********************************************************************************/
/* The Navigation LAYER Chunks                                                  */
/********************************************************************************/
// A Navigation Layer
#define CARTE_NAV                               \
  carte_de_map("54321 0  ctn 12345",            \
               " ldur 1  ccv ldur",             \
               " ldur 2  cwq tdubt")

#define CARTE_NAVA                              \
  carte_de_map(" gacs 0  ctn 12345",             \
               " ldur 1  ccv ldur",              \
               " ldur 2  cwq tdubt")

#define CARTE_NAVnm                             \
  carte_de_map(" gacsc2 ctn cscag ",            \
               " gacs   ccv ldur",              \
               " __M_   cwq tdubt")

// currently the same as NAVA
#define CARTE_NAVm                                 \
  carte_de_map(" gacs 0  ctn 12345",               \
               " ldur 1  ccv ldur",                \
               " ldur 2  cwq tdubt")

#define CARTE_NAV_miryoku                       \
  carte_de_map("  rdo  ccp undo",               \
               "  Caps ldur",                   \
               "  Ins  HDUE")

#define CARTE_NAVm_miryoku                      \
  carte_de_map("  rdo ccp undo",               \
               "      ldur",                   \
               "      ldur")


#ifdef MOUSEKEY_ENABLE
#define ___NAVm_3x10___ ___10_NAVm_1___, ___10_NAVm_2___, ___10_NAVm_3___
#endif

#define ___NAVnm_3x10___ ___10_NAVnm_1___, ___10_NAVnm_2___, ___10_NAVnm_3___
#define ___NAVA_3x10___ ___10_NAV_1a___, ___10_NAV_2___, ___10_NAV_3___
#define ___NAV_3x10___ ___10_NAV_1___, ___10_NAV_2___, ___10_NAV_3___
#define ___NAV_3x12___ ___12_NAV_1___, ___12_NAV_2___, ___12_NAV_3___
#define ___NAV_miryoku___ \
  ___5___, ___redo_cut_copy_paste_undo___,                              \
    ___5___, KC_CAPS, ___VI_ARROWS___,                                  \
    ___5___, KC_INSERT, ___HOME_PGDN_PGUP_END___

#ifdef MOUSEKEY_ENABLE
#define ___NAVm_miryoku___                                              \
  ___5___, ___redo_cut_copy_paste_undo___,                              \
    ___5___, ___, ___MOUSE_LDUR___,                                     \
    ___5___, ___, ___MWHEEL_LDUR___,
#endif