From 601fc4b20a62dc00c6ef696cc2b4e36fc7e16c6e Mon Sep 17 00:00:00 2001 From: juanlufont Date: Sun, 15 May 2022 22:14:08 +0200 Subject: [PATCH] Add Vial support for KPRepublic JJ40 (#168) * Add Vial support for KPRepublic JJ40 * Fix label --- .../kprepublic/jj40/keymaps/vial/config.h | 9 ++ .../kprepublic/jj40/keymaps/vial/keymap.c | 93 +++++++++++++++++++ .../kprepublic/jj40/keymaps/vial/rules.mk | 7 ++ .../kprepublic/jj40/keymaps/vial/vial.json | 84 +++++++++++++++++ 4 files changed, 193 insertions(+) create mode 100644 keyboards/kprepublic/jj40/keymaps/vial/config.h create mode 100644 keyboards/kprepublic/jj40/keymaps/vial/keymap.c create mode 100755 keyboards/kprepublic/jj40/keymaps/vial/rules.mk create mode 100644 keyboards/kprepublic/jj40/keymaps/vial/vial.json diff --git a/keyboards/kprepublic/jj40/keymaps/vial/config.h b/keyboards/kprepublic/jj40/keymaps/vial/config.h new file mode 100644 index 00000000000..493fa6e0efa --- /dev/null +++ b/keyboards/kprepublic/jj40/keymaps/vial/config.h @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +#pragma once +#define VIAL_KEYBOARD_UID {0x00, 0xBF, 0xFC, 0x85, 0xD8, 0x20, 0x1C, 0x36} + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// top left + top right keys +#define VIAL_UNLOCK_COMBO_ROWS { 0, 0 } +#define VIAL_UNLOCK_COMBO_COLS { 0, 11 } diff --git a/keyboards/kprepublic/jj40/keymaps/vial/keymap.c b/keyboards/kprepublic/jj40/keymaps/vial/keymap.c new file mode 100644 index 00000000000..d190d53ba86 --- /dev/null +++ b/keyboards/kprepublic/jj40/keymaps/vial/keymap.c @@ -0,0 +1,93 @@ +/* Copyright 2019 + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +#include QMK_KEYBOARD_H + +#define LOWER FN_MO13 +#define RAISE FN_MO23 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[0] = LAYOUT_planck_mit( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + KC_TRNS, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[1] = LAYOUT_planck_mit( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[2] = LAYOUT_planck_mit( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[3] = LAYOUT_planck_mit( + KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, + KC_TRNS, KC_TRNS, BL_TOGG, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS +) +}; diff --git a/keyboards/kprepublic/jj40/keymaps/vial/rules.mk b/keyboards/kprepublic/jj40/keymaps/vial/rules.mk new file mode 100755 index 00000000000..bee6b60147e --- /dev/null +++ b/keyboards/kprepublic/jj40/keymaps/vial/rules.mk @@ -0,0 +1,7 @@ +COMBO_ENABLE = no +KEY_OVERRIDE_ENABLE = no +LTO_ENABLE = yes +RGBLIGHT_ENABLE = yes +TAP_DANCE_ENABLE = no +VIAL_ENABLE = yes +VIA_ENABLE = yes diff --git a/keyboards/kprepublic/jj40/keymaps/vial/vial.json b/keyboards/kprepublic/jj40/keymaps/vial/vial.json new file mode 100644 index 00000000000..5a8d6709758 --- /dev/null +++ b/keyboards/kprepublic/jj40/keymaps/vial/vial.json @@ -0,0 +1,84 @@ +{ + "name": "JJ40", + "vendorId": "0x4B50", + "productId": "0x0040", + "lightning": "qmk_backlight_rgblight", + "matrix": { + "rows": 4, + "cols": 12 + }, + "layouts": { + "labels": ["No 2U spacebar"], + "keymap": [ + { + "name": "KPRepublic JJ40" + }, + [ + "0,0", + "0,1", + "0,2", + "0,3", + "0,4", + "0,5", + "0,6", + "0,7", + "0,8", + "0,9", + "0,10", + "0,11" + ], + [ + "1,0", + "1,1", + "1,2", + "1,3", + "1,4", + "1,5", + "1,6", + "1,7", + "1,8", + "1,9", + "1,10", + "1,11" + ], + [ + "2,0", + "2,1", + "2,2", + "2,3", + "2,4", + "2,5", + "2,6", + "2,7", + "2,8", + "2,9", + "2,10", + "2,11" + ], + [ + "3,0", + "3,1", + "3,2", + "3,3", + "3,4", + { + "w": 2 + }, + "3,5\n\n\n0,0", + "3,7", + "3,8", + "3,9", + "3,10", + "3,11" + ], + [ + { + "y": 0.25, + "x": 5 + }, + "3,5\n\n\n0,1", + "3,6\n\n\n0,1" + ] + ] + } +}