diff options
author | milestogo <milestogo@users.noreply.github.com> | 2021-03-14 12:23:30 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-14 12:23:30 -0700 |
commit | 7b7689d30796c977b95197091c16e8bb97000101 (patch) | |
tree | dc81a91d109041e34a90940fdceaeede7d512e4f | |
parent | aa73411c14487465d7af9d9f1ca7cb5d157e9343 (diff) | |
download | qmk_firmware-7b7689d30796c977b95197091c16e8bb97000101.tar.gz qmk_firmware-7b7689d30796c977b95197091c16e8bb97000101.zip |
[Keymap] miles2go userspace update, add functions for babblepaste library, add prime_e keybard keymap (#9196)
Co-authored-by: Drashna Jaelre <drashna@live.com>
-rw-r--r-- | keyboards/primekb/prime_e/keymaps/milestogo/config.h | 41 | ||||
-rw-r--r-- | keyboards/primekb/prime_e/keymaps/milestogo/keymap.c | 150 | ||||
-rw-r--r-- | keyboards/primekb/prime_e/keymaps/milestogo/readme.md | 2 | ||||
-rw-r--r-- | keyboards/primekb/prime_e/keymaps/milestogo/rules.mk | 1 | ||||
-rw-r--r-- | users/miles2go/babblePaste.c | 130 | ||||
-rw-r--r-- | users/miles2go/babblePaste.h | 50 | ||||
-rw-r--r-- | users/miles2go/babblePaste.md | 71 | ||||
-rw-r--r-- | users/miles2go/babl_chromeos.c | 2 | ||||
-rw-r--r-- | users/miles2go/babl_emacs.c | 1 | ||||
-rw-r--r-- | users/miles2go/babl_kitty.c | 153 | ||||
-rw-r--r-- | users/miles2go/babl_nano.c | 77 | ||||
-rw-r--r-- | users/miles2go/babl_vi.c | 1 | ||||
-rw-r--r-- | users/miles2go/config.h | 8 | ||||
-rw-r--r-- | users/miles2go/milestogo.c | 29 | ||||
-rw-r--r-- | users/miles2go/milestogo.h | 343 | ||||
-rw-r--r-- | users/miles2go/readme.md | 2 | ||||
-rw-r--r-- | users/miles2go/rules.mk | 2 |
17 files changed, 842 insertions, 221 deletions
diff --git a/keyboards/primekb/prime_e/keymaps/milestogo/config.h b/keyboards/primekb/prime_e/keymaps/milestogo/config.h new file mode 100644 index 000000000..24a42bb18 --- /dev/null +++ b/keyboards/primekb/prime_e/keymaps/milestogo/config.h | |||
@@ -0,0 +1,41 @@ | |||
1 | /* | ||
2 | Copyright 2019 Holten Campbell | ||
3 | |||
4 | This program is free software: you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Public License as published by | ||
6 | the Free Software Foundation, either version 2 of the License, or | ||
7 | (at your option) any later version. | ||
8 | |||
9 | This program is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | ||
13 | |||
14 | You should have received a copy of the GNU General Public License | ||
15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | ||
17 | |||
18 | #pragma once | ||
19 | |||
20 | |||
21 | #undef MATRIX_ROWS | ||
22 | #undef MATRIX_COLS | ||
23 | #undef MATRIX_ROW_PINS | ||
24 | #undef MATRIX_COL_PINS | ||
25 | |||
26 | /* key matrix size */ | ||
27 | #define MATRIX_ROWS 5 | ||
28 | #define MATRIX_COLS 15 | ||
29 | |||
30 | /* Keyboard Matrix Assignments */ | ||
31 | #define MATRIX_ROW_PINS { E6, C7, B5, B4, C6 } | ||
32 | #define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, D6, D4, D5, D3, D2, D1, D0, B6, D7} | ||
33 | #define UNUSED_PINS | ||
34 | |||
35 | // Babble config | ||
36 | #define USE_BABBLEPASTE | ||
37 | #define BABL_MODSWAP | ||
38 | #define BABL_READMUX | ||
39 | #define BABL_KITTY | ||
40 | #define BABL_MAC | ||
41 | #define BABL_LINUX | ||
diff --git a/keyboards/primekb/prime_e/keymaps/milestogo/keymap.c b/keyboards/primekb/prime_e/keymaps/milestogo/keymap.c new file mode 100644 index 000000000..ced250e51 --- /dev/null +++ b/keyboards/primekb/prime_e/keymaps/milestogo/keymap.c | |||
@@ -0,0 +1,150 @@ | |||
1 | /* Copyright 2018 Holten Campbell | ||
2 | * | ||
3 | * This program is free software: you can redistribute it and/or modify | ||
4 | * it under the terms of the GNU General Public License as published by | ||
5 | * the Free Software Foundation, either version 2 of the License, or | ||
6 | * (at your option) any later version. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
15 | */ | ||
16 | #include QMK_KEYBOARD_H | ||
17 | #include "milestogo.h" | ||
18 | |||
19 | /* customized matrix needs to be updated in local config.h | ||
20 | #define MATRIX_ROWS 5 | ||
21 | #define MATRIX_COLS 15 | ||
22 | #define MATRIX_ROW_PINS { E6, C7, B5, B4, C6 } | ||
23 | #define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, D6, D4, D5, D3, D2, D1, D0, B6, D7} | ||
24 | */ | ||
25 | |||
26 | #define LAYOUT_wrap_m2primee(...) LAYOUT_m2primee(__VA_ARGS__) | ||
27 | #define LAYOUT_wrap_m2primee_trns(...) LAYOUT_m2primee_trns(__VA_ARGS__) | ||
28 | |||
29 | // clang-format off | ||
30 | #define LAYOUT_m2primee(\ | ||
31 | K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, \ | ||
32 | K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K112,\ | ||
33 | K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, \ | ||
34 | K300, K301, K303, K304, K306, K308, K311, K312, \ | ||
35 | K413, K414 )\ | ||
36 | {\ | ||
37 | {K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO, KC_NO},\ | ||
38 | {K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, KC_NO, K112, KC_NO, KC_NO},\ | ||
39 | {K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, KC_NO}, \ | ||
40 | {K300, K301, KC_NO, K303, K304, KC_NO, K306, KC_NO, K308, KC_NO, KC_NO, K311, K312, KC_NO, KC_NO}, \ | ||
41 | {KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K413, K414 } \ | ||
42 | } | ||
43 | |||
44 | #define LAYOUT_m2primee_trns(\ | ||
45 | K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, \ | ||
46 | K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K112, \ | ||
47 | K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211) \ | ||
48 | {\ | ||
49 | {KC_TRNS, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO, KC_NO}, \ | ||
50 | {KC_TRNS, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, KC_NO, K112, KC_NO, KC_NO}, \ | ||
51 | {KC_LSFT, K201, K202, K203, K204, K205, KC_TRNS, K207, K208, K209, K210, K211, KC_TRNS, KC_NO, KC_NO}, \ | ||
52 | {KC_LALT, KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, KC_NO, KC_TRNS, KC_NO, KC_NO, KC_TRNS, KC_RSFT, KC_NO, KC_NO}, \ | ||
53 | {KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, B_1ME, KC_ENTER } \ | ||
54 | } | ||
55 | |||
56 | |||
57 | const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | ||
58 | [_QWERTY] = LAYOUT_wrap_m2primee(\ | ||
59 | KC_TAB, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_MINS, KC_EQL, | ||
60 | LT(_MOV,KC_ESC), _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT, | ||
61 | KC_LSFT, _________________QWERTY_L3_________________, MO(_SYM), _________________QWERTY_R3_________________, KC_RSFT, | ||
62 | B_2ME, KC_LALT, LT(_NUM, KC_DEL), KC_BSPC, KC_SPC, LT(_NUM, KC_ESC), B_2ME, KC_RALT, | ||
63 | B_1ME, KC_ENTER), | ||
64 | |||
65 | [_NUM] = LAYOUT_wrap_m2primee(\ | ||
66 | KC_TRNS, __________40_______NUM_L1__________________, __________40_______NUM_R1__________________, KC_VOLD, KC_VOLU, | ||
67 | KC_TRNS, __________40_______NUM_L2__________________, __________40_______NUM_R2__________________, KC_ENT, | ||
68 | KC_TRNS, __________40_______NUM_L3__________________, KC_TRNS, __________40_______NUM_R3__________________, KC_TRNS, | ||
69 | KC_TRNS, KC_TRNS, KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, | ||
70 | KC_TRNS, KC_TRNS), | ||
71 | |||
72 | [_CDH] = LAYOUT_wrap_m2primee_trns(\ | ||
73 | ______________COLEMAK_MOD_DH_L1____________, ______________COLEMAK_MOD_DH_R1____________, KC_TRNS, KC_TRNS, | ||
74 | ______________COLEMAK_MOD_DH_L2____________, ______________COLEMAK_MOD_DH_R2____________, KC_QUOT, | ||
75 | ______________COLEMAK_MOD_DH_L3____________, KC_TRNS, ______________COLEMAK_MOD_DH_R3____________), | ||
76 | |||
77 | [_SYM] = LAYOUT_wrap_m2primee_trns(\ | ||
78 | ___________________SYM_L1__________________, ___________________SYM_R1__________________, KC_TRNS, KC_TRNS, | ||
79 | ___________________SYM_L2__________________, ___________________SYM_R2__________________, KC_TRNS, | ||
80 | ___________________SYM_L3__________________, KC_TRNS, ___________________SYM_R3__________________), | ||
81 | |||
82 | [_MOV] = LAYOUT_wrap_m2primee_trns(\ | ||
83 | __________40_______MOV_L1__________________, __________40_______MOV_R1__________________, KC_TRNS, KC_CDH, | ||
84 | __________40_______MOV_L2__________________, __________40_______MOV_R2__________________, KC_TRNS, | ||
85 | __________40_______MOV_L3__________________, KC_TRNS, __________40_______MOV_R3__________________), | ||
86 | |||
87 | [_DMOV] = LAYOUT_wrap_m2primee_trns(\ | ||
88 | ____________40__DELMOV_L1__________________, ____________40__DELMOV_R1__________________ , KC_TRNS, KC_CDH, | ||
89 | ____________40__DELMOV_L2__________________, ____________40__DELMOV_R2__________________ , KC_TRNS, | ||
90 | ____________40__DELMOV_L3__________________, KC_TRNS, ____________40__DELMOV_R3__________________ ), | ||
91 | }; | ||
92 | |||
93 | // clang-format on | ||
94 | |||
95 | void matrix_init_user(void) { | ||
96 | // set CapsLock LED to output and high by default, drop low when on. | ||
97 | setPinOutput(B1); | ||
98 | writePinHigh(B1); | ||
99 | // set NumLock LED to output and low | ||
100 | setPinOutput(B2); | ||
101 | writePinLow(B2); | ||
102 | // set ScrollLock LED to output and low | ||
103 | setPinOutput(B3); | ||
104 | writePinLow(B3); | ||
105 | |||
106 | backlight_enable(); | ||
107 | backlight_level(2); | ||
108 | } | ||
109 | |||
110 | bool led_update_kb(led_t led_state) { | ||
111 | #ifndef USE_BABBLEPASTE | ||
112 | // if we aren't using the LEDs to show bablepaste options, use them to show standard keyboard stuff | ||
113 | writePin(B1, led_state.caps_lock); | ||
114 | writePin(B2, led_state.num_lock); | ||
115 | writePin(B3, led_state.scroll_lock); | ||
116 | #endif | ||
117 | return true; | ||
118 | } | ||
119 | |||
120 | void babble_modeswitch_kb(uint8_t mode) { | ||
121 | #ifdef USE_BABBLEPASTE | ||
122 | switch (mode) { | ||
123 | case (BABL_READMUX_MODE): | ||
124 | writePinHigh(B3); | ||
125 | writePinLow(B2); | ||
126 | backlight_level(1); | ||
127 | break; | ||
128 | case (BABL_LINUX_MODE): | ||
129 | writePinHigh(B2); | ||
130 | writePinLow(B3); | ||
131 | backlight_level(2); | ||
132 | break; | ||
133 | case (BABL_MAC_MODE): // backlight on, indicator leds off | ||
134 | writePinLow(B3); | ||
135 | writePinLow(B2); | ||
136 | backlight_level(4); | ||
137 | break; | ||
138 | } | ||
139 | |||
140 | // call the user function | ||
141 | babble_modeswitch_user(mode); | ||
142 | #endif | ||
143 | } | ||
144 | |||
145 | // function for layer indicator LED | ||
146 | layer_state_t layer_state_set_user(layer_state_t state) { | ||
147 | // Turn on top LED if we are in colemak, off for qwerty. | ||
148 | writePin(B1, layer_state_cmp(state, _CDH)); | ||
149 | return state; | ||
150 | } | ||
diff --git a/keyboards/primekb/prime_e/keymaps/milestogo/readme.md b/keyboards/primekb/prime_e/keymaps/milestogo/readme.md new file mode 100644 index 000000000..c74eda3ea --- /dev/null +++ b/keyboards/primekb/prime_e/keymaps/milestogo/readme.md | |||
@@ -0,0 +1,2 @@ | |||
1 | # Modified keymap for Prime_E | ||
2 | My PrimeE has two added thumb switches, so it uses a slightly different keymap. \ No newline at end of file | ||
diff --git a/keyboards/primekb/prime_e/keymaps/milestogo/rules.mk b/keyboards/primekb/prime_e/keymaps/milestogo/rules.mk new file mode 100644 index 000000000..81d9ace79 --- /dev/null +++ b/keyboards/primekb/prime_e/keymaps/milestogo/rules.mk | |||
@@ -0,0 +1 @@ | |||
USER_NAME := miles2go | |||
diff --git a/users/miles2go/babblePaste.c b/users/miles2go/babblePaste.c index 2a32024cd..cd032882b 100644 --- a/users/miles2go/babblePaste.c +++ b/users/miles2go/babblePaste.c | |||
@@ -12,13 +12,14 @@ and https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/jee | |||
12 | #ifdef USE_BABBLEPASTE | 12 | #ifdef USE_BABBLEPASTE |
13 | # include "babblePaste.h" | 13 | # include "babblePaste.h" |
14 | 14 | ||
15 | // small function that we might also want to call from a keymap. | ||
16 | |||
17 | // GLOBAL variable to determine mode. Sets startup default if no eeppom | 15 | // GLOBAL variable to determine mode. Sets startup default if no eeppom |
18 | uint8_t babble_mode = 0; | 16 | uint8_t babble_mode = 0; |
19 | 17 | ||
20 | // function to tell the user that the mode has changed | 18 | // functions to tell the user that the mode has changed |
21 | __attribute__((weak)) void babble_led_user(void) {} | 19 | __attribute__((weak)) void babble_modeswitch_user(uint8_t mode) {} |
20 | __attribute__((weak)) void babble_modeswitch_kb(uint8_t mode) { babble_modeswitch_user( mode); } | ||
21 | |||
22 | |||
22 | 23 | ||
23 | void set_babble_mode(uint8_t id) { babble_mode = id; } | 24 | void set_babble_mode(uint8_t id) { babble_mode = id; } |
24 | 25 | ||
@@ -27,6 +28,7 @@ void babble_mode_increment() { | |||
27 | if (babble_mode >= BABL_MODEMAX) { | 28 | if (babble_mode >= BABL_MODEMAX) { |
28 | babble_mode = 0; | 29 | babble_mode = 0; |
29 | } | 30 | } |
31 | babble_modeswitch_kb(babble_mode); | ||
30 | } | 32 | } |
31 | 33 | ||
32 | void babble_mode_decrement() { | 34 | void babble_mode_decrement() { |
@@ -35,21 +37,97 @@ void babble_mode_decrement() { | |||
35 | } else { | 37 | } else { |
36 | babble_mode = BABL_MODEMAX - 1; | 38 | babble_mode = BABL_MODEMAX - 1; |
37 | } | 39 | } |
40 | babble_modeswitch_kb(babble_mode); | ||
38 | } | 41 | } |
39 | 42 | ||
40 | /* this function runs the appropriate babblepaste macro, given | 43 | /* this function runs the appropriate babblepaste macro, given |
41 | the global babble_mode and a keycode defined in the babble_keycodes enum. | 44 | the global babble_mode and a keycode defined in the babble_keycodes enum. |
42 | 45 | ||
43 | This could be made faster by splitting into two functions sorted by keycode range | 46 | This could be made faster by splitting into functions sorted by keycode range |
44 | But that makes for a *lot* of ifdefs. | 47 | But that makes for a *lot* of ifdefs. |
45 | */ | 48 | */ |
46 | bool babblePaste(uint16_t keycode) { | 49 | bool babblePaste(uint16_t keycode, bool is_pressed ) { |
47 | // handle the OS/mode switching first | 50 | // handle keys that have up & down behavior first, then OS/mode switching, then macros |
51 | |||
52 | // This is the key used for cut & paste (Propeller on Mac, Control elsewhere) | ||
53 | # ifdef BABL_MODSWAP | ||
54 | // WARNING, this assumes you have BABL_MAC_MODE defined. | ||
55 | if (keycode == BABL_PRIMARY_OS_MOD ) { | ||
56 | if (babble_mode == BABL_MAC_MODE) { | ||
57 | if (is_pressed) { | ||
58 | register_code(KC_LGUI); | ||
59 | } else { | ||
60 | unregister_code(KC_LGUI); | ||
61 | } | ||
62 | } else { // everybody else | ||
63 | |||
64 | if (is_pressed) { | ||
65 | register_code(KC_LCTL); | ||
66 | } else { | ||
67 | unregister_code(KC_LCTL); | ||
68 | } | ||
69 | } | ||
70 | } | ||
71 | |||
72 | // This is the os key not used in cut & paste. (CTRL on mac, GUI elsewhere) | ||
73 | if (keycode == BABL_SECONDARY_OS_MOD ) { | ||
74 | if (babble_mode == BABL_MAC_MODE) { | ||
75 | if (is_pressed) { | ||
76 | register_code(KC_LCTL); | ||
77 | } else { | ||
78 | unregister_code(KC_LCTL); | ||
79 | } | ||
80 | |||
81 | } else { // everybody else | ||
82 | if (is_pressed) { | ||
83 | register_code(KC_LGUI); | ||
84 | } else { | ||
85 | unregister_code(KC_LGUI); | ||
86 | } | ||
87 | } | ||
88 | } | ||
89 | |||
90 | // This is the alt key in most OSes. Mostly useful if you want to do hyper on one OS, Meh on another. | ||
91 | if (keycode == BABL_TERTIARY_OS_MOD ) { | ||
92 | if (babble_mode == BABL_MAC_MODE) { | ||
93 | if (is_pressed) { | ||
94 | register_code(KC_LALT); | ||
95 | } else { | ||
96 | unregister_code(KC_LALT); | ||
97 | } | ||
98 | } else { // everybody else | ||
99 | |||
100 | if (is_pressed) { | ||
101 | register_code(KC_LALT); | ||
102 | } else { | ||
103 | unregister_code(KC_LALT); | ||
104 | } | ||
105 | } | ||
106 | } | ||
107 | |||
108 | # endif | ||
109 | |||
110 | // below here we are only running macros - don't serve any key up events. | ||
111 | if (is_pressed == 0 ) { | ||
112 | return true; | ||
113 | } | ||
114 | |||
115 | // handle increment functions. | ||
116 | |||
117 | if (keycode == BABL_MODE_INCREMENT) { | ||
118 | babble_mode_increment(); | ||
119 | return true; | ||
120 | } | ||
121 | |||
122 | if (keycode == BABL_MODE_DECREMENT) { | ||
123 | babble_mode_decrement(); | ||
124 | return true; | ||
125 | } | ||
48 | 126 | ||
49 | # ifdef BABL_MAC | 127 | # ifdef BABL_MAC |
50 | if (keycode == BABL_DO_MAC) { | 128 | if (keycode == BABL_DO_MAC) { |
51 | set_babble_mode(BABL_MAC_MODE); | 129 | set_babble_mode(BABL_MAC_MODE); |
52 | babble_led_user(); | 130 | babble_modeswitch_kb(babble_mode); |
53 | return true; | 131 | return true; |
54 | } | 132 | } |
55 | 133 | ||
@@ -61,7 +139,7 @@ bool babblePaste(uint16_t keycode) { | |||
61 | # ifdef BABL_VI | 139 | # ifdef BABL_VI |
62 | if (keycode == BABL_DO_VI) { | 140 | if (keycode == BABL_DO_VI) { |
63 | set_babble_mode(BABL_VI_MODE); | 141 | set_babble_mode(BABL_VI_MODE); |
64 | babble_led_user(); | 142 | babble_modeswitch_kb(babble_mode); |
65 | return true; | 143 | return true; |
66 | } | 144 | } |
67 | if (babble_mode == BABL_VI_MODE) { | 145 | if (babble_mode == BABL_VI_MODE) { |
@@ -71,7 +149,7 @@ bool babblePaste(uint16_t keycode) { | |||
71 | # ifdef BABL_WINDOWS | 149 | # ifdef BABL_WINDOWS |
72 | if (keycode == BABL_DO_WINDOWS) { | 150 | if (keycode == BABL_DO_WINDOWS) { |
73 | set_babble_mode(BABL_WINDOWS_MODE); | 151 | set_babble_mode(BABL_WINDOWS_MODE); |
74 | babble_led_user(); | 152 | babble_modeswitch_kb(babble_mode); |
75 | return true; | 153 | return true; |
76 | } | 154 | } |
77 | if (babble_mode == BABL_WINDOWS_MODE) { | 155 | if (babble_mode == BABL_WINDOWS_MODE) { |
@@ -81,7 +159,7 @@ bool babblePaste(uint16_t keycode) { | |||
81 | # ifdef BABL_LINUX | 159 | # ifdef BABL_LINUX |
82 | if (keycode == BABL_DO_LINUX) { | 160 | if (keycode == BABL_DO_LINUX) { |
83 | set_babble_mode(BABL_LINUX_MODE); | 161 | set_babble_mode(BABL_LINUX_MODE); |
84 | babble_led_user(); | 162 | babble_modeswitch_kb(babble_mode); |
85 | return true; | 163 | return true; |
86 | } | 164 | } |
87 | if (babble_mode == BABL_LINUX_MODE) { | 165 | if (babble_mode == BABL_LINUX_MODE) { |
@@ -91,27 +169,47 @@ bool babblePaste(uint16_t keycode) { | |||
91 | # ifdef BABL_EMACS | 169 | # ifdef BABL_EMACS |
92 | if (keycode == BABL_DO_EMACS) { | 170 | if (keycode == BABL_DO_EMACS) { |
93 | set_babble_mode(BABL_EMACS_MODE); | 171 | set_babble_mode(BABL_EMACS_MODE); |
94 | babble_led_user(); | 172 | babble_modeswitch_kb(babble_mode); |
95 | return true; | 173 | return true; |
96 | } | 174 | } |
97 | if (babble_mode == BABL_EMACS_MODE) { | 175 | if (babble_mode == BABL_EMACS_MODE) { |
98 | babblePaste_emacs(keycode); | 176 | babblePaste_emacs(keycode); |
99 | } | 177 | } |
100 | # endif | 178 | # endif |
101 | # ifdef BABL_CHROME | 179 | # ifdef BABL_NANO |
180 | if (keycode == BABL_DO_NANO) { | ||
181 | set_babble_mode(BABL_NANO_MODE); | ||
182 | babble_modeswitch_kb(babble_mode); | ||
183 | return true; | ||
184 | } | ||
185 | if (babble_mode == BABL_NANO_MODE) { | ||
186 | babblePaste_nano(keycode); | ||
187 | } | ||
188 | # endif | ||
189 | # ifdef BABL_KITTY | ||
190 | if (keycode == BABL_DO_KITTY) { | ||
191 | set_babble_mode(BABL_KITTY_MODE); | ||
192 | babble_modeswitch_kb(babble_mode); | ||
193 | return true; | ||
194 | } | ||
195 | if (babble_mode == BABL_KITTY_MODE) { | ||
196 | babblePaste_kitty(keycode); | ||
197 | } | ||
198 | # endif | ||
199 | # ifdef BABL_CHROMEOS | ||
102 | if (keycode == BABL_DO_CHROMEOS) { | 200 | if (keycode == BABL_DO_CHROMEOS) { |
103 | set_babble_mode(BABL_CHROMEOS_MODE); | 201 | set_babble_mode(BABL_CHROMEOS_MODE); |
104 | babble_led_user(); | 202 | babble_modeswitch_kb(babble_mode); |
105 | return true; | 203 | return true; |
106 | } | 204 | } |
107 | if (babble_mode == BABL_CHROMEOS_MODE) { | 205 | if (babble_mode == BABL_CHROMEOS_MODE) { |
108 | babblePaste_readmux(keycode); | 206 | babblePaste_chromeos(keycode); |
109 | } | 207 | } |
110 | # endif | 208 | # endif |
111 | # ifdef BABL_READMUX | 209 | # ifdef BABL_READMUX |
112 | if (keycode == BABL_DO_READMUX) { | 210 | if (keycode == BABL_DO_READMUX) { |
113 | set_babble_mode(BABL_READMUX_MODE); | 211 | set_babble_mode(BABL_READMUX_MODE); |
114 | babble_led_user(); | 212 | babble_modeswitch_kb(babble_mode); |
115 | return true; | 213 | return true; |
116 | } | 214 | } |
117 | if (babble_mode == BABL_READMUX_MODE) { | 215 | if (babble_mode == BABL_READMUX_MODE) { |
diff --git a/users/miles2go/babblePaste.h b/users/miles2go/babblePaste.h index 606640227..8fc233e8d 100644 --- a/users/miles2go/babblePaste.h +++ b/users/miles2go/babblePaste.h | |||
@@ -16,7 +16,8 @@ and jeebak & algernon's keymap | |||
16 | void set_babble_mode(uint8_t id); | 16 | void set_babble_mode(uint8_t id); |
17 | void babble_mode_increment(void); | 17 | void babble_mode_increment(void); |
18 | void babble_mode_decrement(void); | 18 | void babble_mode_decrement(void); |
19 | void babble_led_user(void); | 19 | void babble_modeswitch_user(uint8_t mode); |
20 | void babble_modeswitch_kb(uint8_t mode); | ||
20 | 21 | ||
21 | // manually re-order these if you want to set the order or default. | 22 | // manually re-order these if you want to set the order or default. |
22 | enum babble_modes { | 23 | enum babble_modes { |
@@ -32,19 +33,24 @@ enum babble_modes { | |||
32 | # ifdef BABL_VI | 33 | # ifdef BABL_VI |
33 | BABL_VI_MODE, | 34 | BABL_VI_MODE, |
34 | # endif | 35 | # endif |
35 | # ifdef BABL_LINUX | ||
36 | BABL_LINUX_MODE, | ||
37 | # endif | ||
38 | # ifdef BABL_EMACS | 36 | # ifdef BABL_EMACS |
39 | BABL_EMACS_MODE, | 37 | BABL_EMACS_MODE, |
40 | # endif | 38 | # endif |
39 | # ifdef BABL_NANO | ||
40 | BABL_NANO_MODE, | ||
41 | # endif | ||
42 | # ifdef BABL_KITTY | ||
43 | BABL_KITTY_MODE, | ||
44 | # endif | ||
41 | # ifdef BABL_CHROMEOS | 45 | # ifdef BABL_CHROMEOS |
42 | BABL_CHROMEOS_MODE, | 46 | BABL_CHROMEOS_MODE, |
43 | # endif | 47 | # endif |
48 | # ifdef BABL_LINUX | ||
49 | BABL_LINUX_MODE, | ||
50 | # endif | ||
44 | BABL_MODEMAX | 51 | BABL_MODEMAX |
45 | }; | 52 | }; |
46 | 53 | ||
47 | // void babble_led_user( uint8_t id) | ||
48 | 54 | ||
49 | /// Hacks to make it easier to create sendstring macros | 55 | /// Hacks to make it easier to create sendstring macros |
50 | 56 | ||
@@ -79,6 +85,13 @@ enum babble_modes { | |||
79 | 85 | ||
80 | enum babble_keycodes { | 86 | enum babble_keycodes { |
81 | FIRST = BABBLE_START, | 87 | FIRST = BABBLE_START, |
88 | BABL_MODE_INCREMENT, | ||
89 | BABL_MODE_DECREMENT, | ||
90 | # ifdef BABL_MODSWAP | ||
91 | BABL_PRIMARY_OS_MOD, | ||
92 | BABL_SECONDARY_OS_MOD, | ||
93 | BABL_TERTIARY_OS_MOD, | ||
94 | # endif | ||
82 | # ifdef BABL_MOVE | 95 | # ifdef BABL_MOVE |
83 | // Movement macros | 96 | // Movement macros |
84 | // left & right | 97 | // left & right |
@@ -171,6 +184,7 @@ enum babble_keycodes { | |||
171 | # endif // BABL_APP_CELLS | 184 | # endif // BABL_APP_CELLS |
172 | # ifdef BABL_APP_EDITOR | 185 | # ifdef BABL_APP_EDITOR |
173 | BABL_APP_MULTI_SELECT, /* www.sublimetext.com/docs/2/multiple_selection_with_the_keyboard.html */ | 186 | BABL_APP_MULTI_SELECT, /* www.sublimetext.com/docs/2/multiple_selection_with_the_keyboard.html */ |
187 | BABL_APP_SET_MARK, // set editor mark | ||
174 | # endif // BABL_APP_EDITOR | 188 | # endif // BABL_APP_EDITOR |
175 | # ifdef BABL_APP_WINDOWSPLITTING | 189 | # ifdef BABL_APP_WINDOWSPLITTING |
176 | // These aren't useful on most oses. | 190 | // These aren't useful on most oses. |
@@ -197,6 +211,12 @@ enum babble_keycodes { | |||
197 | # ifdef BABL_EMACS | 211 | # ifdef BABL_EMACS |
198 | BABL_DO_EMACS, | 212 | BABL_DO_EMACS, |
199 | # endif | 213 | # endif |
214 | # ifdef BABL_NANO | ||
215 | BABL_DO_NANO, | ||
216 | # endif | ||
217 | # ifdef BABL_KITTY | ||
218 | BABL_DO_KITTY, | ||
219 | # endif | ||
200 | # ifdef BABL_VI | 220 | # ifdef BABL_VI |
201 | BABL_DO_VI, | 221 | BABL_DO_VI, |
202 | # endif | 222 | # endif |
@@ -210,7 +230,7 @@ enum babble_keycodes { | |||
210 | }; | 230 | }; |
211 | 231 | ||
212 | // primary function. | 232 | // primary function. |
213 | bool babblePaste(uint16_t keycode); | 233 | bool babblePaste(uint16_t keycode, bool is_pressed); |
214 | 234 | ||
215 | /****************************************************/ | 235 | /****************************************************/ |
216 | /* All per-os includes and short mode switch macros*/ | 236 | /* All per-os includes and short mode switch macros*/ |
@@ -230,6 +250,14 @@ bool babblePaste_linux(uint16_t keycode); | |||
230 | # define B_EMACS BABL_DO_EMACS | 250 | # define B_EMACS BABL_DO_EMACS |
231 | bool babblePaste_emacs(uint16_t keycode); | 251 | bool babblePaste_emacs(uint16_t keycode); |
232 | # endif | 252 | # endif |
253 | # ifdef BABL_NANO | ||
254 | # define B_NANO BABL_DO_NANO | ||
255 | bool babblePaste_nano(uint16_t keycode); | ||
256 | # endif | ||
257 | # ifdef BABL_KITTY | ||
258 | # define B_KITTY BABL_DO_KITTY | ||
259 | bool babblePaste_kitty(uint16_t keycode); | ||
260 | # endif | ||
233 | # ifdef BABL_VI | 261 | # ifdef BABL_VI |
234 | # define B_VI BABL_DO_VI | 262 | # define B_VI BABL_DO_VI |
235 | bool babblePaste_vi(uint16_t keycode); | 263 | bool babblePaste_vi(uint16_t keycode); |
@@ -243,12 +271,17 @@ bool babblePaste_readmux(uint16_t keycode); | |||
243 | bool babblePaste_chromeos(uint16_t keycode); | 271 | bool babblePaste_chromeos(uint16_t keycode); |
244 | # endif | 272 | # endif |
245 | 273 | ||
246 | # define BABL_INC babble_mode_increment(); | ||
247 | # define BABL_DEC babble_mode_decrement(); | ||
248 | 274 | ||
249 | /**************************************************** | 275 | /**************************************************** |
250 | ** All keyboard macros for Babble Actions | 276 | ** All keyboard macros for Babble Actions |
251 | *****************************************************/ | 277 | *****************************************************/ |
278 | # define B_INC BABL_MODE_INCREMENT | ||
279 | # define B_DEC BABL_MODE_DECREMENT | ||
280 | # ifdef BABL_MODSWAP | ||
281 | # define B_1ME BABL_PRIMARY_OS_MOD | ||
282 | # define B_2ME BABL_SECONDARY_OS_MOD | ||
283 | # define B_3ME BABL_TERTIARY_OS_MOD | ||
284 | # endif | ||
252 | 285 | ||
253 | # ifdef BABL_MOVE | 286 | # ifdef BABL_MOVE |
254 | # define B_L1C BABL_GO_LEFT_1C | 287 | # define B_L1C BABL_GO_LEFT_1C |
@@ -334,6 +367,7 @@ bool babblePaste_chromeos(uint16_t keycode); | |||
334 | # endif // BABL_APP_CELLS | 367 | # endif // BABL_APP_CELLS |
335 | # ifdef BABL_APP_EDITOR | 368 | # ifdef BABL_APP_EDITOR |
336 | # define B_MSEL BABL_APP_MULTI_SELECT | 369 | # define B_MSEL BABL_APP_MULTI_SELECT |
370 | # define B_MARK BABL_APP_SET_MARK | ||
337 | /* www.sublimetext.com/docs/2/multiple_selection_with_the_keyboard.html */ | 371 | /* www.sublimetext.com/docs/2/multiple_selection_with_the_keyboard.html */ |
338 | # endif // BABL_APP_EDITOR | 372 | # endif // BABL_APP_EDITOR |
339 | # ifdef BABL_APP_WINDOWSPLITTING | 373 | # ifdef BABL_APP_WINDOWSPLITTING |
diff --git a/users/miles2go/babblePaste.md b/users/miles2go/babblePaste.md index cc1c31bd0..4f68cc4ae 100644 --- a/users/miles2go/babblePaste.md +++ b/users/miles2go/babblePaste.md | |||
@@ -26,6 +26,7 @@ To switch modes, run the switch_babble_mode() function, or a pre defined BABL_DO | |||
26 | #define BABL_MAC | 26 | #define BABL_MAC |
27 | #define BABL_LINUX | 27 | #define BABL_LINUX |
28 | #define BABL_EMACS | 28 | #define BABL_EMACS |
29 | #define BABL_NANO | ||
29 | #define BABL_CHROMEOS | 30 | #define BABL_CHROMEOS |
30 | 31 | ||
31 | //// These enable subsets of babble macros. Disable options to save space | 32 | //// These enable subsets of babble macros. Disable options to save space |
@@ -56,22 +57,22 @@ To switch modes, run the switch_babble_mode() function, or a pre defined BABL_DO | |||
56 | 57 | ||
57 | Add the following to your keymap in process_record_user, before the main switch statement. | 58 | Add the following to your keymap in process_record_user, before the main switch statement. |
58 | ``` | 59 | ``` |
59 | #ifdef USE_BABBLEPASTE | 60 | #ifdef USE_BABBLEPASTE |
60 | if( keycode > BABBLE_START && keycode < BABBLE_END_RANGE ) { | 61 | if (keycode > BABBLE_START && keycode < BABBLE_END_RANGE) { |
61 | if (record->event.pressed) { // is there a case where this isn't desired? | 62 | if (record->event.pressed) { |
62 | babblePaste ( keycode ); | 63 | babblePaste(keycode, 1); |
63 | } else{ | 64 | } else { |
64 | return true; | 65 | babblePaste(keycode, 0); |
65 | } | ||
66 | } | 66 | } |
67 | #endif | 67 | } |
68 | #endif | ||
68 | ``` | 69 | ``` |
69 | 70 | ||
70 | #### Add makefile rules | 71 | #### Add makefile rules |
71 | 72 | ||
72 | Update your rules.mk to include the modes you want. | 73 | Update your rules.mk to include the modes you want. |
73 | 74 | ||
74 | `SRC += babblePaste.c babl_windows.c babl_mac.c babl_vi.c babl_readmux.c babl_chromeos.c babl_emacs.c babl_linux.c` | 75 | `SRC += babblePaste.c babl_windows.c babl_mac.c babl_nano babl_vi.c babl_readmux.c babl_chromeos.c babl_emacs.c babl_linux.c` |
75 | 76 | ||
76 | 77 | ||
77 | #### Custom Keycodes | 78 | #### Custom Keycodes |
@@ -97,9 +98,18 @@ See the full list in babblePaste.h, or the list below | |||
97 | B_LNX // switch to linux | 98 | B_LNX // switch to linux |
98 | B_VI // switch to Vi mode | 99 | B_VI // switch to Vi mode |
99 | B_EMAX // switch mode to emacs | 100 | B_EMAX // switch mode to emacs |
101 | B_NANO // switch mode to emacs | ||
100 | B_READ // switch to readline /tmux mode | 102 | B_READ // switch to readline /tmux mode |
101 | B_CROM // switch to chromeos mode. | 103 | B_CROM // switch to chromeos mode. |
102 | 104 | ||
105 | // Swap meaning of modifier key in most ergonomic location based on babble | ||
106 | // mode. Eg Thumb gets CTL on Win/Linux, pinky gets Windows key. Reverse for | ||
107 | // OS X. See first line in babblepaste function. | ||
108 | #define B_1ME BABL_PRIMARY_OS_MOD | ||
109 | #define B_2ME BABL_SECONDARY_OS_MOD | ||
110 | #define B_3ME BABL_TERTIARY_OS_MOD | ||
111 | |||
112 | // Macros | ||
103 | #define B_L1C BABL_GO_LEFT_1C | 113 | #define B_L1C BABL_GO_LEFT_1C |
104 | #define B_R1C BABL_GO_RIGHT_1C | 114 | #define B_R1C BABL_GO_RIGHT_1C |
105 | #define B_L1W BABL_GO_LEFT_WORD | 115 | #define B_L1W BABL_GO_LEFT_WORD |
@@ -137,6 +147,10 @@ See the full list in babblePaste.h, or the list below | |||
137 | #define B_PAPP BABL_SWITCH_APP_LAST // previous | 147 | #define B_PAPP BABL_SWITCH_APP_LAST // previous |
138 | #define B_CAPP BABL_CLOSE_APP | 148 | #define B_CAPP BABL_CLOSE_APP |
139 | #define B_HELP BABL_HELP | 149 | #define B_HELP BABL_HELP |
150 | #define B_HELP BABL_HELP | ||
151 | #define B_LOCK BABL_LOCK | ||
152 | #define B_SCAP BABL_SCREENCAPTURE | ||
153 | #define B_KEYB BABL_SWITCH_KEYBOARD_LAYOUT | ||
140 | 154 | ||
141 | #define B_NTAB BABL_BROWSER_NEW_TAB | 155 | #define B_NTAB BABL_BROWSER_NEW_TAB |
142 | #define B_CTAB BABL_BROWSER_CLOSE_TAB | 156 | #define B_CTAB BABL_BROWSER_CLOSE_TAB |
@@ -151,9 +165,10 @@ See the full list in babblePaste.h, or the list below | |||
151 | #define B_BDEV BABL_BROWSER_DEV_TOOLS // hard one to remember | 165 | #define B_BDEV BABL_BROWSER_DEV_TOOLS // hard one to remember |
152 | #define B_BRLD BABL_BROWSER_RELOAD | 166 | #define B_BRLD BABL_BROWSER_RELOAD |
153 | #define B_BFULL BABL_BROWSER_FULLSCREEN | 167 | #define B_BFULL BABL_BROWSER_FULLSCREEN |
154 | #define B_ZIN BABL_BROWSER_ZOOM_IN | 168 | #define B_ZIN BABL_BROWSER_ZOOM_IN |
155 | #define B_ZOUT BABL_BROWSER_ZOOM_OUT | 169 | #define B_ZOUT BABL_BROWSER_ZOOM_OUT |
156 | 170 | ||
171 | #define B_SAVE BABL_APP_SAVE | ||
157 | #define B_PASTV BABL_APP_PASTE_VALUES | 172 | #define B_PASTV BABL_APP_PASTE_VALUES |
158 | #define B_CALN BABL_APP_CENTER_ALIGN | 173 | #define B_CALN BABL_APP_CENTER_ALIGN |
159 | #define B_CFMT BABL_APP_CLEAR_FORMATTING | 174 | #define B_CFMT BABL_APP_CLEAR_FORMATTING |
@@ -167,6 +182,7 @@ See the full list in babblePaste.h, or the list below | |||
167 | #define B_SELR BABL_SELECT_ROW | 182 | #define B_SELR BABL_SELECT_ROW |
168 | 183 | ||
169 | #define B_MSEL BABL_APP_MULTI_SELECT | 184 | #define B_MSEL BABL_APP_MULTI_SELECT |
185 | #define B_MARK BABL_APP_SET_MARK | ||
170 | #define B_VSPLIT BABL_SPLIT_FRAME_VERT | 186 | #define B_VSPLIT BABL_SPLIT_FRAME_VERT |
171 | #define B_VUNSPT BABL_UNSPLIT_FRAME_VERT | 187 | #define B_VUNSPT BABL_UNSPLIT_FRAME_VERT |
172 | #define B_HSPLIT BABL_SPLIT_FRAME_HORIZONTAL | 188 | #define B_HSPLIT BABL_SPLIT_FRAME_HORIZONTAL |
@@ -175,27 +191,48 @@ See the full list in babblePaste.h, or the list below | |||
175 | #define B_PRVFM BABL_PREV_FRAME | 191 | #define B_PRVFM BABL_PREV_FRAME |
176 | ``` | 192 | ``` |
177 | 193 | ||
194 | ####Add babblepaste functions to your keyboard or userspace | ||
195 | Functions babble_led_user() and babble_led_kb() are called when babble mode is changed. | ||
196 | ``` | ||
197 | void babble_modeswitch_kb(uint8_t mode){ | ||
198 | #ifdef USE_BABBLEPASTE | ||
199 | writePinLow(B3); writePinLow(B2); | ||
200 | switch(mode) { | ||
201 | case(BABL_LINUX_MODE): | ||
202 | writePinHigh(B2); | ||
203 | backlight_level(1); | ||
204 | break; | ||
205 | case(BABL_MAC_MODE): | ||
206 | writePinHigh(B3); | ||
207 | backlight_level(4); | ||
208 | break; | ||
209 | } | ||
210 | // call the user function | ||
211 | babble_modeswitch_user(mode); | ||
212 | #endif | ||
213 | ``` | ||
214 | |||
215 | |||
178 | 216 | ||
179 | ## Development FAQs | 217 | ## Development FAQs |
180 | 218 | ||
181 | **Todos** | 219 | **Todos** |
182 | eeprom store state of babble_mode? or update docs so that people can change the order of the enum in | 220 | eeprom store state of babble_mode? or update docs so that people can change the order of the enum in babblespace.h? |
183 | babblespace.h? | ||
184 | 221 | ||
185 | **You have huge ifdef stanzas instead of functions** | 222 | **You have huge ifdef stanzas instead of functions** |
186 | This fails gracefully if you don't have all options defined. Patch if you can think how to use fewer defines. | 223 | This fails gracefully if you don't have all options defined. Patch if you can think how to use fewer defines. |
187 | 224 | ||
188 | ** Why not an array of arrays as a lookup instead of a function?** | 225 | **Why not an array of arrays as a lookup instead of a function?** |
189 | This would allow you to store the lookup table in PROGMEM. | 226 | This would allow you to store the lookup table in PROGMEM. |
190 | True, but that takes more pre-processor skill than I have, and may be less portable to ARM or other flash mappings. | 227 | True, but that takes more pre-processor skill than I have, and may be less portable to ARM or other flash mappings. |
191 | 228 | ||
192 | ** Have you tested every key on every platform?** | 229 | **Have you tested every key on every platform?** |
193 | No. Be careful, submit a patch. | 230 | No. Be careful, submit a patch. |
194 | 231 | ||
195 | ** Why not update Apps at the same global level as the OS? ** | 232 | **Why not change apps App babble modes at the same global level as the OS?** |
196 | This is only a good thing if it doesn't confuse the user. If you can show state of OS vs App, it's probably a good thing. | 233 | This is only a good thing if it doesn't confuse the user. If you can show state of OS vs App, it's probably a good thing. |
197 | 234 | ||
198 | ** Can the OS tell the keyboard what mode to use? ** | 235 | **Can the OS tell the keyboard what mode to use?** |
199 | The keyboard side is easy to do with virtser_recv & a function that updates babble_mode. It still needs a PC side app to track where the keyboard focus is. | 236 | The keyboard side is easy to do with virtser_recv & a function that updates babble_mode. It still needs a PC side app to track where the keyboard focus is. |
200 | One could use a keyboard macro to launch an app & switch modes for that app. | 237 | One could use a keyboard macro to launch an app & switch modes for that app. |
201 | 238 | ||
diff --git a/users/miles2go/babl_chromeos.c b/users/miles2go/babl_chromeos.c index a0c461f24..fd644fc5c 100644 --- a/users/miles2go/babl_chromeos.c +++ b/users/miles2go/babl_chromeos.c | |||
@@ -14,7 +14,7 @@ https://support.google.com/docs/answer/181110?co=GENIE.Platform%3DDesktop&hl=en | |||
14 | 14 | ||
15 | # ifdef BABL_CHROMEOS | 15 | # ifdef BABL_CHROMEOS |
16 | 16 | ||
17 | bool babblepaste_chromeos(uint16_t keycode) { | 17 | bool babblePaste_chromeos(uint16_t keycode) { |
18 | # ifdef BABL_MOVE | 18 | # ifdef BABL_MOVE |
19 | BABLM(BABL_GO_LEFT_1C, SS_TAP(X_LEFT)); | 19 | BABLM(BABL_GO_LEFT_1C, SS_TAP(X_LEFT)); |
20 | BABLM(BABL_GO_RIGHT_1C, SS_TAP(X_RIGHT)); | 20 | BABLM(BABL_GO_RIGHT_1C, SS_TAP(X_RIGHT)); |
diff --git a/users/miles2go/babl_emacs.c b/users/miles2go/babl_emacs.c index 201da0d1a..87560b6eb 100644 --- a/users/miles2go/babl_emacs.c +++ b/users/miles2go/babl_emacs.c | |||
@@ -69,6 +69,7 @@ bool babblePaste_emacs(uint16_t keycode) { | |||
69 | 69 | ||
70 | # ifdef BABL_APP | 70 | # ifdef BABL_APP |
71 | BABLM(BABL_APP_SAVE, SS_LCTL("x") SS_LCTL("s")); | 71 | BABLM(BABL_APP_SAVE, SS_LCTL("x") SS_LCTL("s")); |
72 | BABLM(BABL_APP_SET_MARK, IMCTL(X_SPACE)); | ||
72 | /// BABLM( BABL_APP_MULTI_SELECT, SS_LCTRL("x") "rt" ); // arguably | 73 | /// BABLM( BABL_APP_MULTI_SELECT, SS_LCTRL("x") "rt" ); // arguably |
73 | BABLM(BABL_SPLIT_FRAME_VERT, SS_LCTRL("x") "3"); | 74 | BABLM(BABL_SPLIT_FRAME_VERT, SS_LCTRL("x") "3"); |
74 | BABLM(BABL_UNSPLIT_FRAME_VERT, SS_LCTRL("u") SS_LCTRL("x") "0"); | 75 | BABLM(BABL_UNSPLIT_FRAME_VERT, SS_LCTRL("u") SS_LCTRL("x") "0"); |
diff --git a/users/miles2go/babl_kitty.c b/users/miles2go/babl_kitty.c new file mode 100644 index 000000000..44fd87e5e --- /dev/null +++ b/users/miles2go/babl_kitty.c | |||
@@ -0,0 +1,153 @@ | |||
1 | /* Keyboard mappings for Kitty terminal | ||
2 | https://sw.kovidgoyal.net/kitty/index.html# | ||
3 | |||
4 | A library to output the right key shortcut in any common app. | ||
5 | Given a global variable babble_mode to show the environment and a | ||
6 | key that calls the paste macro, do the right type of paste. | ||
7 | Setting the context is done by another macro, or TBD interaction with the host. | ||
8 | |||
9 | Huge thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts | ||
10 | and | ||
11 | https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/jeebak/keymap.c | ||
12 | */ | ||
13 | |||
14 | #include QMK_KEYBOARD_H | ||
15 | |||
16 | // #define TAB_MEANS TAB | ||
17 | /* #define TAB_MEANS_TAB to keep the meaning of "tab" and "window" used in kitty documentation. . | ||
18 | * Leaving tab undefined will mean that each babble window command applies to a tab, | ||
19 | * and each babble tab command applies to a window inside the kitty OS window. | ||
20 | */ | ||
21 | //#define TAB_MEANS_TAB | ||
22 | |||
23 | #ifdef USE_BABBLEPASTE | ||
24 | # include "babblePaste.h" | ||
25 | |||
26 | # ifdef BABL_KITTY | ||
27 | |||
28 | bool babblePaste_kitty(uint16_t keycode) { | ||
29 | # ifdef BABL_MOVE | ||
30 | BABLM(BABL_GO_LEFT_1C, SS_TAP(X_LEFT)); | ||
31 | BABLM(BABL_GO_RIGHT_1C, SS_TAP(X_RIGHT)); | ||
32 | BABLM(BABL_GO_LEFT_WORD, IMCTL(X_LEFT)); | ||
33 | BABLM(BABL_GO_RIGHT_WORD, IMCTL(X_RIGHT)); | ||
34 | BABLM(BABL_GO_START_LINE, SS_TAP(X_HOME)); | ||
35 | BABLM(BABL_GO_END_LINE, SS_TAP(X_END)); | ||
36 | BABLM(BABL_GO_START_DOC, OMSFT(IMCTL(X_HOME))); | ||
37 | BABLM(BABL_GO_END_DOC, OMSFT(IMCTL(X_END))); | ||
38 | // leaving these for command line editing. | ||
39 | BABLM(BABL_GO_NEXT_LINE, SS_TAP(X_DOWN)); | ||
40 | BABLM(BABL_GO_PREV_LINE, SS_TAP(X_UP)); | ||
41 | // These are for kitty scrolling by one line | ||
42 | // BABLM(BABL_GO_NEXT_LINE, OMSFT(IMCTL(X_DOWN))); | ||
43 | // BABLM(BABL_GO_PREV_LINE, OMSFT(IMCTL(X_UP))); | ||
44 | // passthrough | ||
45 | BABLM(BABL_PGDN, OMSFT(IMCTL(X_PGDOWN))); // kitty pagedown | ||
46 | BABLM(BABL_PGUP, OMSFT(IMCTL(X_PGUP))); // kitty pageup | ||
47 | // passthrough to commanrd line/shell. | ||
48 | BABLM(BABL_DEL_RIGHT_1C, SS_LCTL("d")); | ||
49 | BABLM(BABL_DEL_LEFT_WORD, SS_LCTL("w")); // meta-DEL instead? | ||
50 | BABLM(BABL_DEL_RIGHT_WORD, SS_LALT("d")); | ||
51 | BABLM(BABL_DEL_TO_LINE_END, SS_LCTL("k")); | ||
52 | BABLM(BABL_DEL_TO_LINE_START, SS_LCTL("u")); | ||
53 | BABLM(BABL_GO_PARA_START, IMCTL(X_UP)); | ||
54 | BABLM(BABL_GO_PARA_END, IMCTL(X_DOWN)); | ||
55 | BABLM(BABL_MODE, "Kitty! "); | ||
56 | # endif | ||
57 | # ifdef BABL_OSKEYS | ||
58 | // cut isn't real, undo/redo are passthrough. | ||
59 | BABLM(BABL_UNDO, SS_LCTL("z")); | ||
60 | BABLM(BABL_REDO, SS_LCTL("y")); | ||
61 | BABLM(BABL_CUT, OMSFT(IMCTL(X_X))); | ||
62 | BABLM(BABL_COPY, OMSFT(IMCTL(X_C))); | ||
63 | BABLM(BABL_PASTE, OMSFT(IMCTL(X_V))); | ||
64 | BABLM(BABL_SELECT_ALL, SS_LCTL("a")); | ||
65 | BABLM(BABL_FIND, SS_LCTL("f")); // passthrough. | ||
66 | // BABLM(BABL_CLOSE_APP, IMALT(X_F4)); // gnome. | ||
67 | // BABLM(BABL_HELP, SS_TAP(X_F1)); // script to pop open kitty web page? | ||
68 | // 2 passthrough. | ||
69 | BABLM(BABL_FIND_NEXT, SS_LCTL("g")); // Gnome*/ | ||
70 | BABLM(BABL_FIND_PREV, OMSFT(IMCTL(X_G))); // Gnome*/ | ||
71 | // BABLM(BABL_FIND_NEXT (SS_LALT(X_F3)) ); //KDE */ | ||
72 | /* BABLM( BABL_FIND_REPLACE , (SS_LCTL("r")) ); // KDE */ | ||
73 | // BABLM(BABL_FIND_REPLACE, SS_LCTL("h")); // Gnome*/ | ||
74 | BABLM(BABL_RUNAPP, OMSFT(IMCTL(X_O))); // pass current selection to program. | ||
75 | BABLM(BABL_SWITCH_APP_NEXT, IMGUI(X_TAB)); | ||
76 | // BABLM(BABL_SWITCH_APP_LAST, OMSFT(IMALT(X_TAB))); | ||
77 | BABLM(BABL_WINDOW_NEXT, IMGUI(X_GRAVE)); // next OS window of kitty. | ||
78 | BABLM(BABL_WINDOW_PREV, OMSFT(IMGUI(X_GRAVE))); // NA? | ||
79 | # ifdef TAB_MEANS_TAB | ||
80 | BABLM(BABL_WINDOW_NEW, OMSFT(IMCTL(X_ENTER))); // a window is a window | ||
81 | # else | ||
82 | BABLM(BABL_WINDOW_NEW, OMSFT(IMCTL(X_T))); // a window is a tab | ||
83 | # endif | ||
84 | // KITTY - missing close window. | ||
85 | // BABLM( BABL_HELP, (SS_TAP(X_F1)) ); // NA? | ||
86 | // BABLM(BABL_LOCK, OMCTL(IMALT(X_L))); // NA passthrough | ||
87 | // BABLM(BABL_SCREENCAPTURE, IMSFT(X_PSCREEN)); // NA passthrough | ||
88 | # endif | ||
89 | # ifdef BABL_BROWSER | ||
90 | |||
91 | # ifdef TAB_MEANS_TAB | ||
92 | // option A - do tab when I say tab. | ||
93 | BABLM(BABL_BROWSER_NEW_TAB, OMSFT(IMCTL(X_T))); | ||
94 | BABLM(BABL_BROWSER_CLOSE_TAB, OMSFT(IMCTL(X_Q))); | ||
95 | BABLM(BABL_BROWSER_NEXT_TAB, OMSFT(IMCTL(X_RIGHT))); | ||
96 | BABLM(BABL_BROWSER_PREV_TAB, OMSFT(IMCTL(X_LEFT))); | ||
97 | // ok, this is a bit of a stretch, overloading meaning of forwards/backwards | ||
98 | BABLM(BABL_BROWSER_FORWARD, OMSFT(IMCTL(X_DOT))); // move current kitty tab forwards | ||
99 | BABLM(BABL_BROWSER_BACK, OMSFT(IMCTL(X_COMMA))); // move current kitty tab back | ||
100 | // requires kitty config of "map ctrl+shift+f7 detach_window" | ||
101 | BABLM(BABL_BROWSER_REOPEN_LAST_TAB, IMCTL(X_F7)); // pop current frame into a window | ||
102 | # else // tab means window/frame. | ||
103 | // option B - do Kitty window (frame) when I say tab | ||
104 | BABLM(BABL_BROWSER_NEW_TAB, OMSFT(IMCTL(X_ENTER))); | ||
105 | BABLM(BABL_BROWSER_NEXT_TAB, OMSFT(IMCTL(X_LBRC))); | ||
106 | BABLM(BABL_BROWSER_PREV_TAB, OMSFT(IMCTL(X_RBRC))); | ||
107 | // ok, this is a bit of a stretch, overloading meaning of forwards/backwards | ||
108 | BABLM(BABL_BROWSER_FORWARD, OMSFT(IMCTL(X_F))); | ||
109 | BABLM(BABL_BROWSER_BACK, OMSFT(IMCTL(X_B))); | ||
110 | // kitty - questionable mental model - reopen current frame as a window | ||
111 | // requires kitty config of "map ctrl+shift+f6 detach_frame" | ||
112 | BABLM(BABL_BROWSER_REOPEN_LAST_TAB, IMCTL(X_F6)); // pop current frame into a window | ||
113 | # endif // tab means tab | ||
114 | |||
115 | // BABLM(BABL_BROWSER_FIND, SS_LCTL("f")); | ||
116 | BABLM(BABL_BROWSER_BOOKMARK, SS_LCTL(SS_LSFT(SS_LALT("t")))); // bookmark == set tab title. | ||
117 | BABLM(BABL_BROWSER_DEV_TOOLS, OMSFT(IMCTL(X_F2))); // edit kitty config. | ||
118 | BABLM(BABL_BROWSER_RELOAD, OMSFT(IMCTL(X_DEL))); // reset terminal | ||
119 | BABLM(BABL_BROWSER_FULLSCREEN, OMSFT(IMCTL(X_F11))); | ||
120 | BABLM(BABL_BROWSER_ZOOM_IN, OMSFT(IMCTL(X_EQUAL))); | ||
121 | BABLM(BABL_BROWSER_ZOOM_OUT, OMSFT(IMCTL(X_MINUS))); | ||
122 | // Again, breaking model to overload "view source" | ||
123 | BABLM(BABL_BROWSER_VIEWSRC, OMSFT(IMCTL(X_O))); // open URL in browser | ||
124 | |||
125 | # endif | ||
126 | # ifdef BABL_APP | ||
127 | BABLM(BABL_APP_SAVE, SS_LCTL("s")); // passthrough. | ||
128 | # ifdef TAB_MEANS_TAB // frames are called windows. | ||
129 | BABLM(BABL_SPLIT_FRAME_VERT, OMSFT(IMCTL(X_ENTER))); // add new frame in kitty window | ||
130 | BABLM(BABL_UNSPLIT_FRAME_VERT, OMSFT(IMCTL(X_W))); // close window | ||
131 | // BUG, this breaks the mental model. move the current frame forward/back in rotation | ||
132 | BABLM(BABL_SPLIT_FRAME_HORIZONTAL, OMSFT(IMCTL(X_F))); | ||
133 | BABLM(BABL_UNSPLIT_FRAME_HORIZONTAL, OMSFT(IMCTL(X_B))); | ||
134 | // KITTY - missing ctrl shift ` = move frame to top. | ||
135 | BABLM(BABL_NEXT_FRAME, OMSFT(IMCTL(X_RBRC))); | ||
136 | BABLM(BABL_PREV_FRAME, OMSFT(IMCTL(X_LBRC))); | ||
137 | # else // splits are tabs | ||
138 | BABLM(BABL_SPLIT_FRAME_VERT, OMSFT(IMCTL(X_T))); | ||
139 | BABLM(BABL_UNSPLIT_FRAME_VERT, OMSFT(IMCTL(X_Q))); // close Tab | ||
140 | BABLM(BABL_NEXT_FRAME, OMSFT(IMCTL(X_RIGHT))); | ||
141 | BABLM(BABL_PREV_FRAME, OMSFT(IMCTL(X_LEFT))); | ||
142 | // ok, this is a bit of a stretch, overloading meaning of forwards/backwards | ||
143 | BABLM(BABL_SPLIT_FRAME_HORIZONTAL, OMSFT(IMCTL(X_DOT))); // move current kitty tab forwards | ||
144 | BABLM(BABL_UNSPLIT_FRAME_HORIZONTAL, OMSFT(IMCTL(X_COMMA))); // move current kitty tab back | ||
145 | # endif // tab means tab | ||
146 | # endif | ||
147 | |||
148 | // Todo, ring bell, flash light, show user this isn't supported | ||
149 | return false; | ||
150 | } | ||
151 | |||
152 | # endif /* kitty mode */ | ||
153 | #endif | ||
diff --git a/users/miles2go/babl_nano.c b/users/miles2go/babl_nano.c new file mode 100644 index 000000000..ebbe9b2bc --- /dev/null +++ b/users/miles2go/babl_nano.c | |||
@@ -0,0 +1,77 @@ | |||
1 | /* A library to output the right key shortcut in any common app. | ||
2 | Given a global variable babble_mode to show the environment and a | ||
3 | key that calls the paste macro, do the right type of paste. | ||
4 | Setting the context is done by another macro, or TBD interaction with the host. | ||
5 | |||
6 | Nano mode is probably most useful for people who don't usually use Nano, but | ||
7 | sometimes find themselves using it. | ||
8 | |||
9 | https://www.nano-editor.org/dist/latest/cheatsheet.html | ||
10 | */ | ||
11 | |||
12 | #include QMK_KEYBOARD_H | ||
13 | |||
14 | #ifdef USE_BABBLEPASTE | ||
15 | # include "babblePaste.h" | ||
16 | |||
17 | # ifdef BABL_NANO | ||
18 | |||
19 | // probably should allow meta to not be ALT | ||
20 | # define DMETA IMALT | ||
21 | |||
22 | bool babblePaste_nano(uint16_t keycode) { | ||
23 | # ifdef BABL_MOVE | ||
24 | BABLM(BABL_GO_LEFT_1C, SS_LCTRL("b")); | ||
25 | BABLM(BABL_GO_RIGHT_1C, SS_LCTL("f")); | ||
26 | BABLM(BABL_GO_LEFT_WORD, IMCTL(X_LEFT)); | ||
27 | BABLM(BABL_GO_RIGHT_WORD, IMCTL(X_RIGHT)); | ||
28 | BABLM(BABL_GO_START_LINE, SS_LCTRL("a")); | ||
29 | BABLM(BABL_GO_END_LINE, SS_LCTRL("e")); | ||
30 | BABLM(BABL_GO_START_DOC, IMALT(X_BSLS)); | ||
31 | BABLM(BABL_GO_END_DOC, IMALT(X_SLASH)); | ||
32 | BABLM(BABL_GO_NEXT_LINE, SS_LCTRL("n")); | ||
33 | BABLM(BABL_GO_PREV_LINE, SS_LCTRL("p")); | ||
34 | BABLM(BABL_GO_PARA_START, IMCTL(X_UP)); | ||
35 | BABLM(BABL_GO_PARA_END, IMCTL(X_DOWN)); | ||
36 | BABLM(BABL_PGDN, SS_LCTRL("v")); | ||
37 | BABLM(BABL_PGUP, SS_LCTRL("y")); | ||
38 | BABLM(BABL_DEL_RIGHT_1C, SS_LCTRL("d")); | ||
39 | BABLM(BABL_DEL_LEFT_WORD, IMCTL(X_BSPC)); | ||
40 | BABLM(BABL_DEL_RIGHT_WORD, IMCTL(X_DEL)); | ||
41 | // BABLM(BABL_DEL_TO_LINE_END, SS_LCTRL("k")); | ||
42 | // BABLM(BABL_DEL_TO_LINE_START, SS_TAP(X_ESCAPE) "0" SS_LCTRL("k")); | ||
43 | BABLM(BABL_MODE, "Nano "); | ||
44 | # endif | ||
45 | # ifdef BABL_OSKEYS | ||
46 | BABLM(BABL_UNDO, SS_LALT("u")); | ||
47 | BABLM(BABL_REDO, SS_LALT("e")); | ||
48 | BABLM(BABL_CUT, SS_LCTRL("k")); // arguably b/c line based, not selection | ||
49 | BABLM(BABL_COPY, SS_LALT("6")); // arguably | ||
50 | BABLM(BABL_PASTE, SS_LCTRL("u")); | ||
51 | // BABLM(BABL_SELECT_ALL, SS_LCTRL("x") "h"); | ||
52 | BABLM(BABL_FIND, SS_LCTRL("w")); | ||
53 | BABLM(BABL_FIND_NEXT, SS_LALT("w")); | ||
54 | BABLM(BABL_FIND_PREV, SS_LALT("q")); | ||
55 | BABLM(BABL_FIND_REPLACE, SS_LALT("r")); | ||
56 | BABLM(BABL_RUNAPP, SS_LCTL("t")); | ||
57 | BABLM(BABL_WINDOW_NEXT, OMALT(IMSFT(X_DOT))); | ||
58 | BABLM(BABL_WINDOW_PREV, OMALT(IMSFT(X_COMMA))); | ||
59 | BABLM(BABL_WINDOW_NEW, IMCTL(X_R) IMALT(X_F)); // | ||
60 | BABLM(BABL_CLOSE_APP, SS_LCTRL("x")); | ||
61 | BABLM(BABL_HELP, SS_LCTRL("g")); | ||
62 | |||
63 | // BABLM( BABL_LOCK, () ); // lock buffer? Too many options. | ||
64 | // BABLM( BABL_SCREENCAPTURE, () ); // requires plugin? | ||
65 | |||
66 | # endif | ||
67 | |||
68 | # ifdef BABL_APP | ||
69 | BABLM(BABL_APP_SAVE, SS_LCTRL("s")); // save file blurs app & os. Move? | ||
70 | BABLM(BABL_APP_SET_MARK, SS_LALT("a")); | ||
71 | # endif | ||
72 | |||
73 | // Todo, ring bell, flash light, show user this isn't supported | ||
74 | return false; | ||
75 | } | ||
76 | # endif /* nano mode*/ | ||
77 | #endif | ||
diff --git a/users/miles2go/babl_vi.c b/users/miles2go/babl_vi.c index 7eebc0b20..f4b1d39d9 100644 --- a/users/miles2go/babl_vi.c +++ b/users/miles2go/babl_vi.c | |||
@@ -59,6 +59,7 @@ bool babblePaste_vi(uint16_t keycode) { | |||
59 | 59 | ||
60 | # ifdef BABL_APP | 60 | # ifdef BABL_APP |
61 | BABLM(BABL_APP_SAVE, SS_TAP(X_ESCAPE) ":w"); | 61 | BABLM(BABL_APP_SAVE, SS_TAP(X_ESCAPE) ":w"); |
62 | BABLM(BABL_APP_SET_MARK, SS_TAP(X_ESCAPE) "ma"); // real vi people probably want multiple marks,not just a | ||
62 | # ifdef BABL_APP_WINDOWSPLITTING | 63 | # ifdef BABL_APP_WINDOWSPLITTING |
63 | BABLM(BABL_SPLIT_FRAME_VERT, SS_TAP(X_ESCAPE) ":vsplit"); | 64 | BABLM(BABL_SPLIT_FRAME_VERT, SS_TAP(X_ESCAPE) ":vsplit"); |
64 | BABLM(BABL_UNSPLIT_FRAME_VERT, SS_TAP(X_ESCAPE) ":hide"); // debatable. | 65 | BABLM(BABL_UNSPLIT_FRAME_VERT, SS_TAP(X_ESCAPE) ":hide"); // debatable. |
diff --git a/users/miles2go/config.h b/users/miles2go/config.h index 3fb52b8a5..a704df4b5 100644 --- a/users/miles2go/config.h +++ b/users/miles2go/config.h | |||
@@ -34,6 +34,7 @@ | |||
34 | 34 | ||
35 | #define USE_BABBLEPASTE | 35 | #define USE_BABBLEPASTE |
36 | // All options | 36 | // All options |
37 | #define BABL_MODSWAP | ||
37 | #define BABL_MOVE // Uncomment to add basic cursor movement | 38 | #define BABL_MOVE // Uncomment to add basic cursor movement |
38 | #define BABL_OSKEYS // This adds Cut, paste, window movement and common OS shortcuts | 39 | #define BABL_OSKEYS // This adds Cut, paste, window movement and common OS shortcuts |
39 | #define BABL_BROWSER // Browser shortcuts, with Chrome/Firefox as the default. | 40 | #define BABL_BROWSER // Browser shortcuts, with Chrome/Firefox as the default. |
@@ -44,10 +45,11 @@ | |||
44 | #define BABL_APP_WINDOWSPLITTING // splitting frames & windows | 45 | #define BABL_APP_WINDOWSPLITTING // splitting frames & windows |
45 | 46 | ||
46 | //All OSes | 47 | //All OSes |
47 | #define BABL_WINDOWS | 48 | |
49 | //#define BABL_WINDOWS | ||
48 | #define BABL_READMUX | 50 | #define BABL_READMUX |
49 | #define BABL_VI | 51 | //#define BABL_VI |
50 | #define BABL_MAC | 52 | #define BABL_MAC |
51 | #define BABL_LINUX | 53 | #define BABL_LINUX |
52 | #define BABL_EMACS | 54 | //#define BABL_EMACS |
53 | #define BABL_CHROMEOS | 55 | #define BABL_CHROMEOS |
diff --git a/users/miles2go/milestogo.c b/users/miles2go/milestogo.c index f1da2f4d7..1c7f174e4 100644 --- a/users/miles2go/milestogo.c +++ b/users/miles2go/milestogo.c | |||
@@ -9,6 +9,8 @@ __attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t * | |||
9 | bool move_is_on = false; // track if we are in _MOV layer | 9 | bool move_is_on = false; // track if we are in _MOV layer |
10 | bool sym_is_on = false; // track if we are in _SYM layer | 10 | bool sym_is_on = false; // track if we are in _SYM layer |
11 | 11 | ||
12 | |||
13 | |||
12 | // Defines actions for global custom keycodes | 14 | // Defines actions for global custom keycodes |
13 | // Then runs the _keymap's record handier if not processed here | 15 | // Then runs the _keymap's record handier if not processed here |
14 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { | 16 | bool process_record_user(uint16_t keycode, keyrecord_t *record) { |
@@ -16,24 +18,26 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
16 | 18 | ||
17 | #ifdef USE_BABBLEPASTE | 19 | #ifdef USE_BABBLEPASTE |
18 | if (keycode > BABBLE_START && keycode < BABBLE_END_RANGE) { | 20 | if (keycode > BABBLE_START && keycode < BABBLE_END_RANGE) { |
19 | if (record->event.pressed) { // is there a case where this isn't desired? | 21 | if (record->event.pressed) { |
20 | babblePaste(keycode); | 22 | babblePaste(keycode, 1); |
21 | } else { | 23 | } else { |
22 | return true; | 24 | babblePaste(keycode, 0); |
23 | } | 25 | } |
24 | } | 26 | } |
25 | #endif | 27 | #endif |
26 | 28 | ||
27 | switch (keycode) { | 29 | switch (keycode) { |
28 | case _QWERTY: | 30 | case KC_QWERTY: |
29 | if (record->event.pressed) { | 31 | if (record->event.pressed) { |
30 | set_single_persistent_default_layer(_QWERTY); | 32 | layer_off(_CDH); |
33 | default_layer_set(_QWERTY); | ||
31 | } | 34 | } |
32 | break; | 35 | break; |
33 | 36 | ||
34 | case _CDH: | 37 | case KC_CDH: |
35 | if (record->event.pressed) { | 38 | if (record->event.pressed) { |
36 | set_single_persistent_default_layer(_CDH); | 39 | layer_on(_CDH); |
40 | default_layer_set(_CDH); | ||
37 | } | 41 | } |
38 | break; | 42 | break; |
39 | 43 | ||
@@ -71,9 +75,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { | |||
71 | return process_record_keymap(keycode, record); | 75 | return process_record_keymap(keycode, record); |
72 | } | 76 | } |
73 | 77 | ||
74 | void babble_led_user(void) { | 78 | void babble_modeswitch_user(uint8_t mode) { |
75 | #ifdef USE_BABLPASTE | 79 | #ifdef USE_BABLPASTE |
76 | extern uint8_t babble_mode; | 80 | extern uint8_t babble_mode; // still using global. why? |
77 | 81 | ||
78 | # ifdef BABL_WINDOWS | 82 | # ifdef BABL_WINDOWS |
79 | if (babble_mode == BABL_WINDOWS_MODE) { | 83 | if (babble_mode == BABL_WINDOWS_MODE) { |
@@ -140,3 +144,10 @@ void babble_led_user(void) { | |||
140 | # endif | 144 | # endif |
141 | #endif // bablepaste | 145 | #endif // bablepaste |
142 | } | 146 | } |
147 | |||
148 | |||
149 | // we always return true here, so that each keyboard can use it's own | ||
150 | // led_update_kb() function | ||
151 | bool led_update_user(led_t led_state ) { | ||
152 | return true; | ||
153 | } \ No newline at end of file | ||
diff --git a/users/miles2go/milestogo.h b/users/miles2go/milestogo.h index dfb344212..3a99f6d2a 100644 --- a/users/miles2go/milestogo.h +++ b/users/miles2go/milestogo.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* Modified from | 1 | /* Modified from |
2 | Copyright 2017 Christopher Courtney <drashna@live.com> @drashna | 2 | Copyright 2017 Christopher Courtney <drashna@live.com> @drashna |
3 | 3 | ||
4 | This program is free software: you can redistribute it and/or modify | 4 | This program is free software: you can redistribute it and/or modify |
@@ -15,117 +15,99 @@ You should have received a copy of the GNU General Public License | |||
15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. |
16 | */ | 16 | */ |
17 | 17 | ||
18 | |||
19 | #pragma once | 18 | #pragma once |
20 | #include "quantum.h" | 19 | #include "quantum.h" |
21 | #include "version.h" | 20 | #include "version.h" |
22 | #include "eeprom.h" | 21 | #include "eeprom.h" |
23 | 22 | ||
24 | |||
25 | #ifdef USE_BABBLEPASTE | 23 | #ifdef USE_BABBLEPASTE |
26 | #include "babblePaste.h" | 24 | # include "babblePaste.h" |
27 | #endif | 25 | #endif |
28 | 26 | ||
29 | #ifdef RGB_MATRIX_ENABLE | 27 | #ifdef RGB_MATRIX_ENABLE |
30 | #include "rgb_matrix.h" | 28 | # include "rgb_matrix.h" |
31 | #endif | 29 | #endif |
32 | 30 | ||
33 | #define USERSPACE_ACTIVE | 31 | #define USERSPACE_ACTIVE |
34 | 32 | ||
35 | /* Define layer names */ | 33 | /* Define layer names */ |
36 | enum userspace_layers { | 34 | enum userspace_layers { _QWERTY = 0, _CDH, _SYM, _MOV, _DMOV, _NUM }; |
37 | _QWERTY=0, | ||
38 | _CDH, | ||
39 | _SYM, | ||
40 | _MOV, | ||
41 | _DMOV, | ||
42 | _NUM | ||
43 | }; | ||
44 | |||
45 | 35 | ||
46 | /* | 36 | /* |
47 | define modifiers here, since MOD_* doesn't seem to work for these | 37 | define modifiers here, since MOD_* doesn't seem to work for these |
48 | */ | 38 | */ |
49 | #define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) | 39 | #define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) |
50 | #define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL)) | 40 | #define MODS_CTRL_MASK (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTRL)) |
51 | #define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT)) | 41 | #define MODS_ALT_MASK (MOD_BIT(KC_LALT) | MOD_BIT(KC_RALT)) |
52 | #define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) | 42 | #define MODS_GUI_MASK (MOD_BIT(KC_LGUI) | MOD_BIT(KC_RGUI)) |
53 | 43 | ||
54 | #if defined(BABBLE_END_RANGE) | 44 | #if defined(BABBLE_END_RANGE) |
55 | #define USER_START BABBLE_END_RANGE | 45 | # define USER_START BABBLE_END_RANGE |
56 | #else | 46 | #else |
57 | #if defined(KEYMAP_SAFE_RANGE) | 47 | # if defined(KEYMAP_SAFE_RANGE) |
58 | #define USER_START KEYMAP_SAFE_RANGE | 48 | # define USER_START KEYMAP_SAFE_RANGE |
59 | #else | 49 | # else |
60 | #define USER_START SAFE_RANGE | 50 | # define USER_START SAFE_RANGE |
61 | #endif | 51 | # endif |
62 | #endif | 52 | #endif |
63 | 53 | ||
64 | enum userspace_custom_keycodes { | 54 | enum userspace_custom_keycodes { |
65 | EPRM = BABBLE_END_RANGE, // Resets EEPROM do defaults (as in eeconfig_init) | 55 | EPRM = BABBLE_END_RANGE, // Resets EEPROM do defaults (as in eeconfig_init) |
66 | VRSN, // Prints QMK Firmware and board info | 56 | VRSN, // Prints QMK Firmware and board info |
67 | KC_QWERTY, // Sets default layer to QWERTY | 57 | KC_QWERTY, // Sets default layer to QWERTY |
68 | KC_CDH, // Sets default layer to COLEMAK DH | 58 | KC_CDH, // Sets default layer to COLEMAK DH |
69 | KC_MAKE, | 59 | KC_MAKE, |
70 | VIBRK, // escape : | 60 | VIBRK, // escape : |
71 | DHPASTE, // allow pasting via qwerty V,not colemak V | 61 | DHPASTE, // allow pasting via qwerty V,not colemak V |
72 | TMUX, // TMUX Ctrl-b | 62 | TMUX, // TMUX Ctrl-b |
73 | ALTSYM, // Alt when held, toggle MOV when tapped | 63 | ALTSYM, // Alt when held, toggle MOV when tapped |
74 | GUISYM, | 64 | GUISYM, |
75 | SPCMOV, | 65 | SPCMOV, |
76 | SAVE, // placeholder for CTRL-S while I get babble working again. | 66 | SAVE, // placeholder for CTRL-S while I get babble working again. |
77 | NEW_SAFE_RANGE //Keymap specific codes come AFTER this | 67 | NEW_SAFE_RANGE // Keymap specific codes come AFTER this |
78 | }; | 68 | }; |
79 | 69 | ||
80 | #define QWERTY KC_QWERTY | 70 | #define QWERTY KC_QWERTY |
81 | #define COLEMAK KC_CDH | 71 | #define COLEMAK KC_CDH |
82 | #define KC_RESET RESET | 72 | #define KC_RESET RESET |
83 | 73 | ||
84 | |||
85 | |||
86 | #if (!defined(LAYOUT) && defined(KEYMAP)) | 74 | #if (!defined(LAYOUT) && defined(KEYMAP)) |
87 | #define LAYOUT KEYMAP | 75 | # define LAYOUT KEYMAP |
88 | #endif | 76 | #endif |
89 | 77 | ||
90 | #define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) | 78 | #define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) |
91 | 79 | ||
80 | #define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T | ||
81 | #define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G | ||
82 | #define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B | ||
92 | 83 | ||
93 | #define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T | 84 | #define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P |
94 | #define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G | 85 | #define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN |
95 | #define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B | 86 | #define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH |
96 | 87 | ||
97 | #define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P | 88 | #define ______________COLEMAK_MOD_DH_L1____________ KC_Q, KC_W, KC_F, KC_P, KC_B |
98 | #define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN | 89 | #define ______________COLEMAK_MOD_DH_L2____________ KC_A, KC_R, KC_S, KC_T, KC_G |
99 | #define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH | 90 | #define ______________COLEMAK_MOD_DH_L3____________ KC_Z, KC_X, KC_C, KC_D, KC_V |
100 | 91 | ||
92 | #define ______________COLEMAK_MOD_DH_R1____________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN | ||
93 | #define ______________COLEMAK_MOD_DH_R2____________ KC_M, KC_N, KC_E, KC_I, KC_O | ||
94 | #define ______________COLEMAK_MOD_DH_R3____________ KC_K, KC_H, KC_COMM, KC_DOT, KC_SLASH | ||
101 | 95 | ||
102 | #define ______________COLEMAK_MOD_DH_L1____________ KC_Q, KC_W, KC_F, KC_P, KC_B | 96 | #define ________________NUMBER_LEFT________________ KC_1, KC_2, KC_3, KC_4, KC_5 |
103 | #define ______________COLEMAK_MOD_DH_L2____________ KC_A, KC_R, KC_S, KC_T, KC_G | 97 | #define ________________NUMBER_RIGHT_______________ KC_6, KC_7, KC_8, KC_9, KC_0 |
104 | #define ______________COLEMAK_MOD_DH_L3____________ KC_Z, KC_X, KC_C, KC_D, KC_V | ||
105 | 98 | ||
106 | #define ______________COLEMAK_MOD_DH_R1____________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN | 99 | #define ________________FKEYS__LEFT________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 |
107 | #define ______________COLEMAK_MOD_DH_R2____________ KC_M, KC_N, KC_E, KC_I, KC_O | 100 | #define ________________FKEYS__RIGHT_______________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 |
108 | #define ______________COLEMAK_MOD_DH_R3____________ KC_K, KC_H, KC_COMM, KC_DOT, KC_SLASH | 101 | #define ________________FKEYS__FAR_RIGHT___________ KC_F11, KC_F12, KC_PSCR, KC_HOME, KC_END |
109 | 102 | ||
103 | #define ________________NAV_NUMBER_LEFT____________ KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, XXXXXXX | ||
110 | 104 | ||
111 | #define ________________NUMBER_LEFT________________ KC_1, KC_2, KC_3, KC_4, KC_5 | 105 | #define ___________________BLANK___________________ _______, _______, _______, _______, _______ |
112 | #define ________________NUMBER_RIGHT_______________ KC_6, KC_7, KC_8, KC_9, KC_0 | 106 | #define ___________________BLOCK___________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX |
113 | |||
114 | #define ________________FKEYS__LEFT________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 | ||
115 | #define ________________FKEYS__RIGHT_______________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 | ||
116 | #define ________________FKEYS__FAR_RIGHT___________ KC_F11, KC_F12, KC_PSCR, KC_HOME, KC_END | ||
117 | |||
118 | #define ________________NAV_NUMBER_LEFT____________ KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, XXXXXXX | ||
119 | |||
120 | #define ___________________BLANK___________________ _______, _______, _______, _______, _______ | ||
121 | #define ___________________BLOCK___________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX | ||
122 | |||
123 | |||
124 | |||
125 | // BabblePaste | ||
126 | #define ____________BABBLE_SWITCH_L________________ B_MAC , B_READ , B_LINUX, B_VI, _______ | ||
127 | #define ____________BABBLE_SWITCH_R________________ B_CROM, B_LINUX, B_WIN , QWERTY, COLEMAK | ||
128 | 107 | ||
108 | // BabblePaste | ||
109 | #define ____________BABBLE_SWITCH_L________________ B_MAC, B_READ, B_LINUX, B_VI, _______ | ||
110 | #define ____________BABBLE_SWITCH_R________________ B_CROM, B_LINUX, B_WIN, QWERTY, COLEMAK | ||
129 | 111 | ||
130 | /////////MOVE - Full size keyboard version | 112 | /////////MOVE - Full size keyboard version |
131 | 113 | ||
@@ -140,17 +122,16 @@ enum userspace_custom_keycodes { | |||
140 | * `--------------------------------------------' `--------------------------------------------' | 122 | * `--------------------------------------------' `--------------------------------------------' |
141 | */ | 123 | */ |
142 | /* Movement layer similar to Extend, but fully enriched with babblepaste */ | 124 | /* Movement layer similar to Extend, but fully enriched with babblepaste */ |
143 | #define ____________BABBLE_MOV_LNUM________________ B_LOCK, B_PAPP, B_NAPP, B_PASTV, XXXX | 125 | #define ____________BABBLE_MOV_LNUM________________ B_LOCK, B_PAPP, B_NAPP, B_PASTV, XXXX |
144 | 126 | ||
145 | #define ____________BABBLE_MOV_L1__________________ KC_ESC, B_FINDP, B_FIND, B_FINDN, B_NCEL | 127 | #define ____________BABBLE_MOV_L1__________________ KC_ESC, B_FINDP, B_FIND, B_FINDN, B_NCEL |
146 | #define ____________BABBLE_MOV_L2__________________ B_SELA , MO(_DMOV),KC_LSFT,B_UNDO, B_HSPLIT | 128 | #define ____________BABBLE_MOV_L2__________________ B_SELA, MO(_DMOV), KC_LSFT, B_UNDO, B_HSPLIT |
147 | #define ____________BABBLE_MOV_L3__________________ B_VSPLIT, B_CUT, B_COPY, B_PASTE, B_PASTE | 129 | #define ____________BABBLE_MOV_L3__________________ B_VSPLIT, B_CUT, B_COPY, B_PASTE, B_PASTE |
148 | |||
149 | #define ____________BABBLE_MOV_RNUM________________ XXXX, XXXX, B_KEYB, B_BDEV, B_LOCK | ||
150 | #define ____________BABBLE_MOV_R1__________________ B_PTOP, B_GSOL, B_UP, B_GEOL, B_PEND | ||
151 | #define ____________BABBLE_MOV_R2__________________ B_L1W, B_L1C, B_DOWN, B_R1C, B_R1W | ||
152 | #define ____________BABBLE_MOV_R3__________________ B_PWIN, B_PTAB, B_NTAB, B_NXTB, B_NWIN | ||
153 | 130 | ||
131 | #define ____________BABBLE_MOV_RNUM________________ XXXX, XXXX, B_KEYB, B_BDEV, B_LOCK | ||
132 | #define ____________BABBLE_MOV_R1__________________ B_PTOP, B_GSOL, B_UP, B_GEOL, B_PEND | ||
133 | #define ____________BABBLE_MOV_R2__________________ B_L1W, B_L1C, B_DOWN, B_R1C, B_R1W | ||
134 | #define ____________BABBLE_MOV_R3__________________ B_PWIN, B_PTAB, B_NTAB, B_NXTB, B_NWIN | ||
154 | 135 | ||
155 | // Move in a direction, deleting as we go, or do opposite of Mov layer action */ | 136 | // Move in a direction, deleting as we go, or do opposite of Mov layer action */ |
156 | /* ,--------------------------------------------. ,--------------------------------------------. | 137 | /* ,--------------------------------------------. ,--------------------------------------------. |
@@ -160,130 +141,162 @@ enum userspace_custom_keycodes { | |||
160 | * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| | 141 | * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| |
161 | * 03 |Vsplit- | Cut | Copy | Paste |Paste | | App-- | ZoomOut| NewWin | ZoomIn | App+ | | 142 | * 03 |Vsplit- | Cut | Copy | Paste |Paste | | App-- | ZoomOut| NewWin | ZoomIn | App+ | |
162 | * `--------------------------------------------' `--------------------------------------------' | 143 | * `--------------------------------------------' `--------------------------------------------' |
163 | */ | 144 | */ |
164 | #define _________BABBLE_DELMOV_L1__________________ KC_ESC, _______, B_RPLACE, B_MSEL, B_PASTV | 145 | #define _________BABBLE_DELMOV_L1__________________ KC_ESC, _______, B_RPLACE, B_MSEL, B_PASTV |
165 | #define _________BABBLE_DELMOV_L2__________________ XXXXXXX, _______, _______, B_REDO, B_HUNSPT | 146 | #define _________BABBLE_DELMOV_L2__________________ XXXXXXX, _______, _______, B_REDO, B_HUNSPT |
166 | #define _________BABBLE_DELMOV_L3__________________ B_VUNSPT,B_CUT, B_COPY, B_PASTE, B_PRVFM | 147 | #define _________BABBLE_DELMOV_L3__________________ B_VUNSPT, B_CUT, B_COPY, B_PASTE, B_PRVFM |
167 | 148 | ||
168 | #define _________BABBLE_DELMOV_R1__________________ XXXXXXX, B_DSOL, _______, B_DEOL, XXXXXXX | 149 | #define _________BABBLE_DELMOV_R1__________________ XXXXXXX, B_DSOL, _______, B_DEOL, XXXXXXX |
169 | #define _________BABBLE_DELMOV_R2__________________ B_DLW, KC_BSPC, _______, B_DEL, B_DRW | 150 | #define _________BABBLE_DELMOV_R2__________________ B_DLW, KC_BSPC, _______, B_DEL, B_DRW |
170 | #define _________BABBLE_DELMOV_R3__________________ B_NAPP, B_ZOUT, B_WINN, B_ZIN, B_PAPP | 151 | #define _________BABBLE_DELMOV_R3__________________ B_NAPP, B_ZOUT, B_WINN, B_ZIN, B_PAPP |
171 | 152 | ||
172 | /* SYM / excel / programming logic +=1 optimization*/ | 153 | /* SYM / excel / programming logic +=1 optimization*/ |
173 | /* ,----------------------------------. ,----------------------------------. | 154 | /* ,----------------------------------. ,----------------------------------. |
174 | * 01 | | [ | ] | { | | | | } | ( | ) | | | 155 | * 01 | | [ | ] | { | } | | { | } | ( | ) | | |
175 | * |------+------+------+------+------| |------+------+------+------+------| | 156 | * |------+------+------+------+------| |------+------+------+------+------| |
176 | * 02 | ^ | ! | = | 0 | $ | | # | 1 | - | + | ` | | 157 | * 02 | ^ | ! | = | 0 | $ | | # | 1 | - | + | ` | |
177 | * |------+------+------+------+------| |------+------+------+------+------| | 158 | * |------+------+------+------+------| |------+------+------+------+------| |
178 | * 03 | \ | % | @ | | | _ | | * | & | ~ | . | / | | 159 | * 03 | \ | % | @ | | | _ | | * | & | ~ | . | / | |
179 | * `----------------------------------' `----------------------------------' | 160 | * `----------------------------------' `----------------------------------' |
180 | Memnonics | 161 | Memnonics |
181 | ^begining end$ . &&/|| on strong finger. #at start of line. | 162 | ^begining end$ . &&/|| on strong finger. #at start of line. |
182 | * (multiply) opposite / | 163 | * (multiply) opposite / |
183 | Minus is left of plus as normal. | 164 | Minus is left of plus as normal. |
184 | ` is a shifted '' | 165 | ` is a shifted '' |
185 | ~/ is an outwards roll. / .* is a roll. !=0 is a roll , ++1 --1 roll. | 166 | ~/ is an outwards roll. / .* is a roll. !=0 is a roll , ++1 --1 roll. |
186 | _ is hard to get to. | 167 | _ is hard to get to. |
168 | */ | ||
169 | #define ___________________SYM_L1__________________ XXXXXXX, KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR | ||
170 | #define ___________________SYM_L2__________________ KC_CIRC, KC_EXLM, KC_EQL, KC_0, KC_DLR | ||
171 | #define ___________________SYM_L3__________________ KC_BSLS, KC_PERC, KC_AT, KC_PIPE, KC_UNDS | ||
172 | |||
173 | #define ___________________SYM_R1__________________ KC_LCBR, KC_RCBR, KC_LPRN, KC_RPRN, XXXXXXX | ||
174 | #define ___________________SYM_R2__________________ KC_HASH, KC_1, KC_MINS, KC_PLUS, KC_GRAVE | ||
175 | #define ___________________SYM_R3__________________ KC_ASTR, KC_AMPR, KC_TILDE, KC_DOT, KC_SLASH | ||
187 | 176 | ||
177 | // Move and brackets - 40% optimization. | ||
178 | /* ,--------------------------------------------. ,--------------------------------------------. | ||
179 | * 01 | ESC | ( | ) | { | } | | PgDn |LineStrt| Up | EOL | PGUp | | ||
180 | * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| | ||
181 | * 02 | [ |DelMove | Shift | Undo | ] | | WrdLft | Left | Down | Right | WrdRght| | ||
182 | * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| | ||
183 | * 03 | CDH | Cut | Copy | Paste | Paste | | Babl-- | Tab-- | NewTab | Tab++ | Babl++ | | ||
184 | * `--------------------------------------------' `--------------------------------------------' | ||
188 | */ | 185 | */ |
189 | #define ___________________SYM_L1__________________ XXXXXXX, KC_LBRC, KC_RBRC, KC_LCBR, XXXXXXX | ||
190 | #define ___________________SYM_L2__________________ KC_CIRC, KC_EXLM, KC_EQL, KC_0, KC_DLR | ||
191 | #define ___________________SYM_L3__________________ KC_BSLS, KC_PERC, KC_AT, KC_PIPE, KC_UNDS | ||
192 | |||
193 | #define ___________________SYM_R1__________________ XXXXXXX, KC_RCBR, KC_LPRN, KC_RPRN, XXXXXXX | ||
194 | #define ___________________SYM_R2__________________ KC_HASH, KC_KP_1, KC_MINS, KC_PLUS, KC_GRAVE | ||
195 | #define ___________________SYM_R3__________________ KC_PERC, KC_TILDE,KC_AMPR, KC_DOT, KC_SLASH | ||
196 | 186 | ||
187 | #define __________40_______MOV_L1__________________ KC_ESC, KC_LPRN, KC_RPRN, KC_LCBR, KC_RCBR | ||
188 | #define __________40_______MOV_L2__________________ KC_LBRC, MO(_DMOV), KC_LSFT, KC_UNDO, KC_RBRC | ||
189 | #define __________40_______MOV_L3__________________ KC_CDH, B_CUT, B_COPY, B_PASTE, B_PASTE | ||
197 | 190 | ||
191 | #define __________40_______MOV_R1__________________ B_PGDN, B_GSOL, B_UP, B_GEOL, B_PGUP | ||
192 | #define __________40_______MOV_R2__________________ B_L1W, B_L1C, B_DOWN, B_R1C, B_R1W | ||
193 | #define __________40_______MOV_R3__________________ B_DEC, B_PTAB, B_NTAB, B_NXTB, B_INC | ||
198 | 194 | ||
199 | /* excel centric symbol layer*/ | 195 | // Move in a direction, deleting as we go, or do opposite of Mov layer action |
200 | /* ,--------------------------------------------. ,--------------------------------------------. | 196 | /* ,--------------------------------------------. ,--------------------------------------------. |
201 | * 01 | DelRow|InsCol | SelCol |PasteVal| | | . | 1 | 2 | 3 | | | 197 | * 01 | Esc | | B_print| | | | Zoom-- |LineStrt| . | EOL | Zoom++| |
202 | * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| | 198 | * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| |
203 | * 02 | - |InsRow | SelRow | Undo | + | | * | 4 | 5 | 6 | - | | 199 | * 02 | | Do_DEL | Shift | Redo | | | WrdLft | Left | . | Right | WrdRght| |
204 | * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| | 200 | * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| |
205 | * 03 | Undo | Cut | Copy | Paste |Paste | | / | 7 | 8 | 9 | Paste | | 201 | * 03 | Qwerty | Cut | Copy | Paste |Paste | | WIN-- |PrvFrame| Split |nxtFrame| Win++ | |
206 | * `--------------------------------------------' `--------------------------------------------' | 202 | * `--------------------------------------------' `--------------------------------------------' |
207 | |||
208 | */ | 203 | */ |
209 | #define _________________EXCEL_L1__________________ B_DROW, B_ICOL, B_SELC, B_PASTV, XXXX | 204 | #define ____________40__DELMOV_L1__________________ KC_ESC, XXXXXXX, B_MODE, XXXXXXX, XXXXXXX |
210 | #define _________________EXCEL_L2__________________ KC_MINS, B_ICOL, B_SELC, B_UNDO, KC_PLUS | 205 | #define ____________40__DELMOV_L2__________________ XXXXXXX, _______, _______, B_REDO, XXXXXXX |
211 | #define _________________EXCEL_L3__________________ B_UNDO, B_CUT, B_COPY, B_PASTE, B_PASTE | 206 | #define ____________40__DELMOV_L3__________________ KC_QWERTY, _______, _______, _______, _______ |
212 | |||
213 | #define _________________EXCEL_R1__________________ XXXXXXX, KC_1, KC_2, KC_3, XXXXXXX | ||
214 | #define _________________EXCEL_R2__________________ KC_ASTR, KC_4, KC_5, KC_6, KC_MINS | ||
215 | #define _________________EXCEL_R3__________________ KC_SLASH, KC_7, KC_8, KC_8, B_PASTE | ||
216 | 207 | ||
208 | #define ____________40__DELMOV_R1__________________ B_ZOUT, B_DSOL, _______, B_DEOL, B_ZIN | ||
209 | #define ____________40__DELMOV_R2__________________ B_DLW, KC_BSPC, _______, B_DEL, B_DRW | ||
210 | #define ____________40__DELMOV_R3__________________ B_PWIN, B_PRVFM, B_VSPLIT, B_NXTFM, B_NWIN | ||
217 | 211 | ||
218 | /* Based on BEKL 15 punctuation | 212 | /* NUM + symbol / programming logic +=1 optimization*/ |
219 | * ,----------------------------------. ,----------------------------------. | 213 | /* ,----------------------------------. ,----------------------------------. |
220 | * 01 | | < | $ | > | | | | [ | _ | ] | | | 214 | * 01 | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | |
221 | * |------+------+------+------+------| |------+------+------+------+------| | 215 | * |------+------+------+------+------| |------+------+------+------+------| |
222 | * 02 | \ | ( | "" | ) | # | | % | { | = | } | "|" | | 216 | * 02 | ^ | ! | = | 0 | $ | | # | 1 | - | + | ` | |
223 | * |------+------+------+------+------| |------+------+------+------+------| | 217 | * |------+------+------+------+------| |------+------+------+------+------| |
224 | * 03 | | : | * | + | | | | & | ^ | ~ | | | 218 | * 03 | \ | % | @ | | | _ | | * | & | ~ | . | / | |
225 | * `----------------------------------' `----------------------------------' | 219 | * `----------------------------------' `----------------------------------' |
226 | Memnonics | 220 | Memnonics |
227 | 221 | ^begining end$ . &&/|| on strong finger. #at start of line. | |
222 | Minus is left of plus as normal. ` is a shifted '' | ||
223 | ~/ and is an outwards roll. / * is a roll. | ||
224 | _ is hard to get to. | ||
228 | */ | 225 | */ |
229 | #define ______________BEKL_SYM_L1__________________ XXXXXXX, KC_LBRC, KC_RBRC, KC_LCBR, XXXXXXX | 226 | |
230 | #define ______________BEKL_SYM_L2__________________ KC_CIRC, KC_EXLM, KC_EQL, KC_0, KC_DLR | 227 | #define __________40_______NUM_L1__________________ ________________NUMBER_LEFT________________ |
231 | #define ______________BEKL_SYM_L3__________________ KC_BSLS, KC_PERC, KC_AT, KC_PIPE, KC_UNDS | 228 | #define __________40_______NUM_L2__________________ KC_CIRC, KC_EXLM, KC_EQL, KC_0, KC_DLR |
232 | 229 | #define __________40_______NUM_L3__________________ KC_BSLS, KC_PERC, KC_AT, KC_PIPE, KC_UNDS | |
233 | #define ______________BEKL_SYM_R1__________________ XXXXXXX, KC_RCBR, KC_LPRN, KC_RPRN, XXXXXXX | 230 | |
234 | #define ______________BEKL_SYM_R2__________________ KC_HASH, KC_KP_1, KC_MINS, KC_PLUS, KC_GRAVE | 231 | #define __________40_______NUM_R1__________________ ________________NUMBER_RIGHT_______________ |
235 | #define ______________BEKL_SYM_R3__________________ KC_PERC, KC_TILDE,KC_AMPR, KC_DOT, KC_SLASH | 232 | #define __________40_______NUM_R2__________________ KC_HASH, KC_1, KC_MINS, KC_PLUS, KC_GRAVE |
236 | 233 | #define __________40_______NUM_R3__________________ KC_ASTR, KC_AMPR, KC_TILDE, KC_DOT, KC_SLASH | |
237 | // NUM | 234 | |
235 | // NUM | ||
238 | /* ,----------------------------------. ,----------------------------------. | 236 | /* ,----------------------------------. ,----------------------------------. |
239 | * 01 | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | 237 | * 01 | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | |
240 | * |------+------+------+------+------| |------+------+------+------+------| | 238 | * |------+------+------+------+------| |------+------+------+------+------| |
241 | * 02 | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | | 239 | * 02 | F1 | F2 | F3 | F4 | F5 | | + | 4 | 5 | 6 | - | |
242 | * |------+------+------+------+------| |------+------+------+------+------| | 240 | * |------+------+------+------+------| |------+------+------+------+------| |
243 | * 03 | F11 | F12 | | | QWERT| | CDH | | | | | | 241 | * 03 | F11 | F12 | | CDH| QWERT| | 0 | 1 | 2 | 3 | . | |
244 | * `----------------------------------' `----------------------------------' | 242 | * `----------------------------------' `----------------------------------' |
245 | */ | 243 | */ |
246 | 244 | ||
247 | #define ___________________NUM_L1__________________ ________________NUMBER_LEFT________________ | 245 | #define ___________________NUM_L1__________________ ________________NUMBER_LEFT________________ |
248 | #define ___________________NUM_L2__________________ ________________FKEYS__LEFT________________ | 246 | #define ___________________NUM_L2__________________ ________________FKEYS__LEFT________________ |
249 | #define ___________________NUM_L3__________________ KC_F11, KC_F11, XXXXXXX, XXXXXXX, QWERTY | 247 | #define ___________________NUM_L3__________________ KC_F11, KC_F11, XXXXXXX, XXXXXXX, QWERTY |
250 | 248 | ||
251 | #define ___________________NUM_R1__________________ ________________NUMBER_RIGHT_______________ | 249 | #define ___________________NUM_R1__________________ ________________NUMBER_RIGHT_______________ |
252 | #define ___________________NUM_R2__________________ ________________FKEYS__RIGHT_______________ | 250 | #define ___________________NUM_R2__________________ KC_PLUS, KC_4, KC_5, KC_6, KC_MINS |
253 | #define ___________________NUM_R3__________________ COLEMAK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX | 251 | #define ___________________NUM_R3__________________ KC_0, KC_1, KC_2, KC_3, KC_DOT |
254 | 252 | ||
255 | 253 | // Standard Sym | |
256 | |||
257 | /* NUM / excel / programming logic +=1 optimization*/ | ||
258 | /* ,----------------------------------. ,----------------------------------. | 254 | /* ,----------------------------------. ,----------------------------------. |
259 | * 01 | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | 255 | * 01 | ! | @ | # | $ | % | | ^ | & | * | ( | ) | |
260 | * |------+------+------+------+------| |------+------+------+------+------| | ||
261 | * 02 | ^ | ! | = | 0 | $ | | # | 1 | - | + | ` | | ||
262 | * |------+------+------+------+------| |------+------+------+------+------| | 256 | * |------+------+------+------+------| |------+------+------+------+------| |
263 | * 03 | \ | % | @ | | | _ | | * | & | ~ | . | / | | ||
264 | * `----------------------------------' `----------------------------------' | ||
265 | Memnonics | ||
266 | ^begining end$ . &&/|| on strong finger. #at start of line. * missing? | ||
267 | Minus is left of plus as normal. ` is a shifted '' | ||
268 | ~/ is an outwards roll. / * is a roll. | ||
269 | _ is hard to get to. | ||
270 | |||
271 | */ | 257 | */ |
272 | #define __________40_______NUM_L1__________________ ________________NUMBER_LEFT________________ | 258 | #define __________________SSYM_L1__________________ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC |
273 | #define __________40_______NUM_L2__________________ KC_CIRC, KC_EXLM, KC_EQL, KC_0, KC_DLR | 259 | #define __________________SSYM_R1__________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN |
274 | #define __________40_______NUM_L3__________________ KC_BSLS, KC_PERC, KC_AT, KC_PIPE, KC_UNDS | 260 | |
275 | 261 | #define _________________ADJUST_L1_________________ RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG | |
276 | #define __________40_______NUM_R1__________________ ________________NUMBER_RIGHT_______________ | 262 | #define _________________ADJUST_L2_________________ MU_TOG, CK_TOGG, AU_ON, AU_OFF, AG_NORM |
277 | #define __________40_______NUM_R2__________________ KC_HASH, KC_KP_1, KC_MINS, KC_PLUS, KC_GRAVE | 263 | #define _________________ADJUST_L3_________________ RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, KC_RGB_T |
278 | #define __________40_______NUM_R3__________________ KC_PERC, KC_TILDE, KC_AMPR,KC_DOT, KC_SLASH | 264 | |
279 | 265 | #define _________________ADJUST_R1_________________ KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5 | |
266 | #define _________________ADJUST_R2_________________ AG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN | ||
267 | #define _________________ADJUST_R3_________________ MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT | ||
268 | |||
269 | /* excel centric symbol layer*/ | ||
270 | /* ,--------------------------------------------. ,--------------------------------------------. | ||
271 | * 01 | DelRow|InsCol | SelCol |PasteVal| | | . | 1 | 2 | 3 | | | ||
272 | * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| | ||
273 | * 02 | - |InsRow | SelRow | Undo | + | | * | 4 | 5 | 6 | - | | ||
274 | * |--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------| | ||
275 | * 03 | Undo | Cut | Copy | Paste |Paste | | / | 7 | 8 | 9 | Paste | | ||
276 | * `--------------------------------------------' `--------------------------------------------' | ||
280 | 277 | ||
281 | #define _________________ADJUST_L1_________________ RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG | 278 | */ |
282 | #define _________________ADJUST_L2_________________ MU_TOG , CK_TOGG, AU_ON, AU_OFF, AG_NORM | 279 | #define _________________EXCEL_L1__________________ B_DROW, B_ICOL, B_SELC, B_PASTV, XXXX |
283 | #define _________________ADJUST_L3_________________ RGB_RMOD,RGB_HUD,RGB_SAD, RGB_VAD, KC_RGB_T | 280 | #define _________________EXCEL_L2__________________ KC_MINS, B_ICOL, B_SELC, B_UNDO, KC_PLUS |
281 | #define _________________EXCEL_L3__________________ B_UNDO, B_CUT, B_COPY, B_PASTE, B_PASTE | ||
284 | 282 | ||
285 | #define _________________ADJUST_R1_________________ KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5 | 283 | #define _________________EXCEL_R1__________________ XXXXXXX, KC_1, KC_2, KC_3, XXXXXXX |
286 | #define _________________ADJUST_R2_________________ AG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN | 284 | #define _________________EXCEL_R2__________________ KC_ASTR, KC_4, KC_5, KC_6, KC_MINS |
287 | #define _________________ADJUST_R3_________________ MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT | 285 | #define _________________EXCEL_R3__________________ KC_SLASH, KC_7, KC_8, KC_8, B_PASTE |
288 | 286 | ||
287 | /* Based on BEKL 15 punctuation | ||
288 | * ,----------------------------------. ,----------------------------------. | ||
289 | * 01 | | < | $ | > | | | | [ | _ | ] | | | ||
290 | * |------+------+------+------+------| |------+------+------+------+------| | ||
291 | * 02 | \ | ( | "" | ) | # | | % | { | = | } | "|" | | ||
292 | * |------+------+------+------+------| |------+------+------+------+------| | ||
293 | * 03 | | : | * | + | | | | & | ^ | ~ | | | ||
294 | * `----------------------------------' `----------------------------------' | ||
295 | */ | ||
296 | #define ______________BEKL_SYM_L1__________________ XXXXXXX, KC_LBRC, KC_RBRC, KC_LCBR, XXXXXXX | ||
297 | #define ______________BEKL_SYM_L2__________________ KC_CIRC, KC_EXLM, KC_EQL, KC_0, KC_DLR | ||
298 | #define ______________BEKL_SYM_L3__________________ KC_BSLS, KC_PERC, KC_AT, KC_PIPE, KC_UNDS | ||
289 | 299 | ||
300 | #define ______________BEKL_SYM_R1__________________ XXXXXXX, KC_RCBR, KC_LPRN, KC_RPRN, XXXXXXX | ||
301 | #define ______________BEKL_SYM_R2__________________ KC_HASH, KC_KP_1, KC_MINS, KC_PLUS, KC_GRAVE | ||
302 | #define ______________BEKL_SYM_R3__________________ KC_PERC, KC_TILDE, KC_AMPR, KC_DOT, KC_SLASH | ||
diff --git a/users/miles2go/readme.md b/users/miles2go/readme.md index b55f51b15..57983660b 100644 --- a/users/miles2go/readme.md +++ b/users/miles2go/readme.md | |||
@@ -3,7 +3,7 @@ | |||
3 | This is my personal userspace file. Most of my code exists here, as it's heavily shared. | 3 | This is my personal userspace file. Most of my code exists here, as it's heavily shared. |
4 | 4 | ||
5 | ## Custom Keycodes | 5 | ## Custom Keycodes |
6 | See the babblepaste.txt readme | 6 | See the babblepaste.md readme |
7 | 7 | ||
8 | ## Layer Indication | 8 | ## Layer Indication |
9 | 9 | ||
diff --git a/users/miles2go/rules.mk b/users/miles2go/rules.mk index 7fb771952..b7a7dcdba 100644 --- a/users/miles2go/rules.mk +++ b/users/miles2go/rules.mk | |||
@@ -1,4 +1,4 @@ | |||
1 | SRC += milestogo.c babblePaste.c babl_windows.c babl_mac.c babl_vi.c babl_readmux.c babl_chromeos.c babl_emacs.c babl_linux.c | 1 | SRC += milestogo.c babblePaste.c babl_windows.c babl_mac.c babl_vi.c babl_readmux.c babl_chromeos.c babl_kitty.c babl_linux.c |
2 | LTO_ENABLE = yes | 2 | LTO_ENABLE = yes |
3 | 3 | ||
4 | ifeq ($(strip $(MACROS_ENABLED)), yes) | 4 | ifeq ($(strip $(MACROS_ENABLED)), yes) |