diff options
author | InigoGutierrez <inigogf.95@gmail.com> | 2022-06-27 16:38:28 +0200 |
---|---|---|
committer | InigoGutierrez <inigogf.95@gmail.com> | 2022-06-27 16:38:28 +0200 |
commit | 98b9909429aea0869f7a6f2f44ab386a4a3ff094 (patch) | |
tree | e1080a61bb89a75edc70818489f8044adf597c48 /keyboards/z12 | |
parent | b610965fd6d851484025166fb255078b1c809261 (diff) | |
parent | fa3dd373b4925734d9843ae6014349069ffec353 (diff) | |
download | qmk_firmware-98b9909429aea0869f7a6f2f44ab386a4a3ff094.tar.gz qmk_firmware-98b9909429aea0869f7a6f2f44ab386a4a3ff094.zip |
Merge branch 'master' into taamas
Diffstat (limited to 'keyboards/z12')
-rw-r--r-- | keyboards/z12/config.h | 5 | ||||
-rw-r--r-- | keyboards/z12/info.json | 2 | ||||
-rw-r--r-- | keyboards/z12/keymaps/zigotica/encoder.c | 12 | ||||
-rw-r--r-- | keyboards/z12/keymaps/zigotica/keymap.c | 116 | ||||
-rw-r--r-- | keyboards/z12/keymaps/zigotica/oled.c | 14 | ||||
-rw-r--r-- | keyboards/z12/keymaps/zigotica/readme.md | 3 | ||||
-rw-r--r-- | keyboards/z12/rules.mk | 9 |
7 files changed, 103 insertions, 58 deletions
diff --git a/keyboards/z12/config.h b/keyboards/z12/config.h index 7f897b795d..68aff7acf7 100644 --- a/keyboards/z12/config.h +++ b/keyboards/z12/config.h @@ -25,9 +25,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #define MANUFACTURER zigotica #define PRODUCT z12 -#define ENCODERS_PAD_A { B4, B2 } -#define ENCODERS_PAD_B { B5, B6 } -#define ENCODER_DIRECTION_FLIP +#define ENCODERS_PAD_A { B5, B6 } +#define ENCODERS_PAD_B { B4, B2 } /* key matrix size */ #define MATRIX_ROWS 4 diff --git a/keyboards/z12/info.json b/keyboards/z12/info.json index 3ae8937571..2395401e47 100644 --- a/keyboards/z12/info.json +++ b/keyboards/z12/info.json @@ -19,7 +19,7 @@ {"x": 0.5, "y": 3}, {"x": 1.5, "y": 3}, - {"x": 2.5, "y": 3}, + {"x": 2.5, "y": 3} ] } } diff --git a/keyboards/z12/keymaps/zigotica/encoder.c b/keyboards/z12/keymaps/zigotica/encoder.c index 49a3d859b6..f55b9b5ae9 100644 --- a/keyboards/z12/keymaps/zigotica/encoder.c +++ b/keyboards/z12/keymaps/zigotica/encoder.c @@ -48,12 +48,8 @@ bool encoder_update_user(uint8_t index, bool clockwise) { // Cycle through Tabs if (clockwise) { tap_code16(C(KC_TAB)); - /* register_code16(G(KC_RCBR)); */ - /* unregister_code16(G(KC_RCBR)); */ } else { tap_code16(S(C(KC_TAB))); - /* register_code16(G(KC_LCBR)); */ - /* unregister_code16(G(KC_LCBR)); */ } } else { // RIGHT // Scroll up/down @@ -68,11 +64,11 @@ bool encoder_update_user(uint8_t index, bool clockwise) { break; case _FIGMA: if (index == 0) { // LEFT - // Volume control. + // Cycle through Tabs if (clockwise) { - tap_code(KC_VOLU); + tap_code16(C(KC_TAB)); } else { - tap_code(KC_VOLD); + tap_code16(S(C(KC_TAB))); } } else { // RIGHT // Zoom in/out @@ -89,7 +85,7 @@ bool encoder_update_user(uint8_t index, bool clockwise) { } } break; - case _TERMINAL: + case _BASE: default: if (index == 0) { // LEFT // Volume control. diff --git a/keyboards/z12/keymaps/zigotica/keymap.c b/keyboards/z12/keymaps/zigotica/keymap.c index 7e969de96e..ef01561f1a 100644 --- a/keyboards/z12/keymaps/zigotica/keymap.c +++ b/keyboards/z12/keymaps/zigotica/keymap.c @@ -16,25 +16,73 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include "zigotica.h" +#include "raw_hid.h" + +#ifdef RAW_ENABLE +void raw_hid_receive(uint8_t* data, uint8_t length) { + layer_clear(); + if (data[0] == 99) { + layer_on(_BASE); + } + else { + layer_on(data[0]); + } +} +#endif // Custom Keycodes -#define MODE_1 TO(_TERMINAL) +#define MODE_1 TO(_BASE) #define MODE_2 TO(_FIGMA) #define MODE_3 TO(_BROWSER) #define MODE_4 TO(_VIM) enum custom_keycodes { - VIM_SIP = SAFE_RANGE + VIM_SIF = SAFE_RANGE, + VIM_SIP, + VIM_RIF, + VIM_RIP, + VIM_NEW }; bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { - case VIM_SIP: + case VIM_SIF:// Search in File + if (record->event.pressed) { + register_code(KC_ESC); + tap_code(KC_SLASH); + } else { // released + unregister_code(KC_ESC); + } + break; + case VIM_SIP:// Search in Project if (record->event.pressed) { register_code(KC_ESC); SEND_STRING(":Ag "); - } else { - // released + } else { // released + unregister_code(KC_ESC); + } + break; + case VIM_RIF:// Replace in File + if (record->event.pressed) { + register_code(KC_ESC); + SEND_STRING(":%s/a/b/g"); + } else { // released + unregister_code(KC_ESC); + } + break; + case VIM_RIP:// Replace in Project + if (record->event.pressed) { + register_code(KC_ESC); + SEND_STRING(":cdo %s/a/b/g"); + } else { // released + unregister_code(KC_ESC); + } + break; + case VIM_NEW:// New buffer + if (record->event.pressed) { + SEND_STRING("\e:vnew\n"); + } else { // released + unregister_code(KC_ENT); unregister_code(KC_ESC); } break; @@ -44,83 +92,83 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* - * TERMINAL Layer + * BASE Layer * * ,-----------------------------. - * | | TERM | FIGM | | + * | | BASE | FIGM | | * |-------+------+------+-------| - * | VOL | BROW | VIM | SCROLL| + * |VOL/PLY| BROW | VIM | SCROLL| * |-------+------+------+-------| * |-------+-------+-------| - * | MEDIA | o | o | + * | o | o | o | * |-------+-------+-------| * | o | o | o | * |-------+-------+-------| */ - [_TERMINAL] = LAYOUT( + [_BASE] = LAYOUT( MODE_1, MODE_2, ZK_MEDIA, MODE_3, MODE_4, _______, _______, _______, _______, _______, _______, _______ ), /* - * VIM Layer + * FIGMA Layer * * ,-----------------------------. - * | | TERM | FIGM | | + * | | BASE | FIGM | | * |-------+------+------+-------| - * |BUFFER | BROW | VIM | SCROLL| + * | TABS | BROW | VIM | ZOOM | * |-------+------+------+-------| * |-------+-------+-------| - * |SEARCH | o | o | + * |ZOOMFIT| GRIDS | FULL | * |-------+-------+-------| - * | o | o | o | + * |ZOOM100| NEXT | COLOR | * |-------+-------+-------| */ - [_VIM] = LAYOUT( + [_FIGMA] = LAYOUT( _______, _______, _______, _______, _______, _______, - VIM_SIP, _______, _______, - _______, _______, _______ + LSFT(KC_1), LCTL(KC_G), LGUI(KC_BSLS), + LSFT(KC_0), KC_N, LCTL(KC_C) ), /* - * FIGMA Layer + * BROWSER Layer * * ,-----------------------------. - * | | TERM | FIGM | | + * | | BASE | FIGM | | * |-------+------+------+-------| - * | VOL | BROW | VIM | ZOOM | + * | TABS | BROW | VIM | SCROLL| * |-------+------+------+-------| * |-------+-------+-------| - * | ZOOM | GRIDS | FULL | + * |SEARCH | BOOKM | DEVTL | * |-------+-------+-------| - * | o | o | o | + * |ZOOM100| MUTE | READ | * |-------+-------+-------| */ - [_FIGMA] = LAYOUT( + [_BROWSER] = LAYOUT( _______, _______, _______, _______, _______, _______, - LSFT(KC_1), LCTL(KC_G), LGUI(KC_BSLS), - _______, _______, _______ + G(KC_F), G(KC_D), G(A(KC_I)), + G(KC_0), C(KC_M), G(A(KC_R)) ), /* - * BROWSER Layer + * VIM Layer * * ,-----------------------------. - * | | TERM | FIGM | | + * | | BASE | FIGM | | * |-------+------+------+-------| - * | TABS | BROW | VIM | SCROLL| + * |BUFFER | BROW | VIM | SCROLL| * |-------+------+------+-------| * |-------+-------+-------| - * |SEARCH | BOOKM | DEVTL | + * |SRCH FL|REPL FL|NEW BUF| * |-------+-------+-------| - * | o | o | o | + * |SRCH PR|REPL PR| o | * |-------+-------+-------| */ - [_BROWSER] = LAYOUT( + [_VIM] = LAYOUT( _______, _______, _______, _______, _______, _______, - G(KC_F), G(KC_D), G(A(KC_I)), - _______, _______, _______ + VIM_SIF, VIM_RIF, VIM_NEW, + VIM_SIP, VIM_RIP, _______ ), }; diff --git a/keyboards/z12/keymaps/zigotica/oled.c b/keyboards/z12/keymaps/zigotica/oled.c index 4b428a42b1..c96fc0f708 100644 --- a/keyboards/z12/keymaps/zigotica/oled.c +++ b/keyboards/z12/keymaps/zigotica/oled.c @@ -21,23 +21,23 @@ static void render_status(void) { oled_write_P(PSTR("Layer: "), false); switch (get_highest_layer(layer_state)) { case _VIM: - oled_write_P(PSTR("VIM\n\nBUFFER SCROLL"), false); + oled_write_P(PSTR("VIM \n\nBUFFER SCROLL"), false); break; case _FIGMA: - oled_write_P(PSTR("FIGMA\n\nVOLUME ZOOM"), false); + oled_write_P(PSTR("FIGMA \n\nTABS ZOOM"), false); break; case _BROWSER: - oled_write_P(PSTR("BROWSER\n\nTABS SCROLL"), false); + oled_write_P(PSTR("BROWSER \n\nTABS SCROLL"), false); break; - case _TERMINAL: - oled_write_P(PSTR("TERMINAL\n\nVOLUME SCROLL"), false); + case _BASE: + oled_write_P(PSTR("BASE \n\nVOLUME SCROLL"), false); break; default: oled_write_P(PSTR("Undef\n"), false); } } -void oled_task_user(void) { +bool oled_task_user(void) { render_status(); + return false; } - diff --git a/keyboards/z12/keymaps/zigotica/readme.md b/keyboards/z12/keymaps/zigotica/readme.md new file mode 100644 index 0000000000..a3746a88d2 --- /dev/null +++ b/keyboards/z12/keymaps/zigotica/readme.md @@ -0,0 +1,3 @@ +# zigotica's z12 Layout + +This layout uses `RAW_ENABLE = yes`, and benefits from [active-app-qmk-layer-updater](https://github.com/zigotica/active-app-qmk-layer-updater) node script (run by the host system) to change layers programmatically depending on the current active app. diff --git a/keyboards/z12/rules.mk b/keyboards/z12/rules.mk index 32cdab8e95..fe67be276f 100644 --- a/keyboards/z12/rules.mk +++ b/keyboards/z12/rules.mk @@ -5,16 +5,15 @@ MCU = atmega32u4 BOOTLOADER = caterina # Build Options -BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Enable Bootmagic Lite MOUSEKEY_ENABLE = no # Mouse keys EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration ENCODER_ENABLE = yes # Enables the use of encoders -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -# if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -NKRO_ENABLE = no # USB Nkey Rollover +NKRO_ENABLE = no # Enable N-Key Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow AUDIO_ENABLE = no # Audio output |