aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan <fauxpark@gmail.com>2020-04-25 04:52:27 +1000
committerGitHub <noreply@github.com>2020-04-24 19:52:27 +0100
commit8650b9f10ced7a9e1502ababe8164635bfc454bc (patch)
tree921612860ca46e64b0e8d17e91fa3cc0aee3ed16
parent4baf49191f70e184d6100a9e9d1b68253463f47d (diff)
downloadqmk_firmware-8650b9f10ced7a9e1502ababe8164635bfc454bc.tar.gz
qmk_firmware-8650b9f10ced7a9e1502ababe8164635bfc454bc.zip
VIA keymap for JJ4x4 and general cleanup (#8888)
-rw-r--r--keyboards/jj4x4/config.h4
-rw-r--r--keyboards/jj4x4/info.json56
-rw-r--r--keyboards/jj4x4/jj4x4.h21
-rw-r--r--keyboards/jj4x4/keymaps/default/keymap.c83
-rw-r--r--keyboards/jj4x4/keymaps/via/keymap.c44
-rw-r--r--keyboards/jj4x4/keymaps/via/rules.mk3
-rw-r--r--keyboards/jj4x4/readme.md (renamed from keyboards/jj4x4/README.md)26
-rw-r--r--keyboards/jj4x4/rules.mk2
8 files changed, 140 insertions, 99 deletions
diff --git a/keyboards/jj4x4/config.h b/keyboards/jj4x4/config.h
index 8c5b1988d..45c8671cc 100644
--- a/keyboards/jj4x4/config.h
+++ b/keyboards/jj4x4/config.h
@@ -19,8 +19,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
19 19
20#include "config_common.h" 20#include "config_common.h"
21 21
22#define VENDOR_ID 0x20A0 22#define VENDOR_ID 0x4B50 // "KP"
23#define PRODUCT_ID 0x422D 23#define PRODUCT_ID 0x0044 // 4x4
24#define DEVICE_VER 0x0200 24#define DEVICE_VER 0x0200
25#define MANUFACTURER KPrepublic 25#define MANUFACTURER KPrepublic
26#define PRODUCT JJ4x4 26#define PRODUCT JJ4x4
diff --git a/keyboards/jj4x4/info.json b/keyboards/jj4x4/info.json
index 602fdc90a..0fff9b9c8 100644
--- a/keyboards/jj4x4/info.json
+++ b/keyboards/jj4x4/info.json
@@ -1,30 +1,30 @@
1{ 1{
2 "keyboard_name": "jj4x4", 2 "keyboard_name": "JJ4x4",
3 "url": "", 3 "url": "",
4 "maintainer": "qmk", 4 "maintainer": "qmk",
5 "width": 4, 5 "width": 4,
6 "height": 4, 6 "height": 4,
7 "layouts": { 7 "layouts": {
8 "LAYOUT_ortho_4x4": { 8 "LAYOUT_ortho_4x4": {
9 "key_count": 16, 9 "key_count": 16,
10 "layout": [ 10 "layout": [
11 {"x":0, "y":0}, 11 {"x":0, "y":0},
12 {"x":1, "y":0}, 12 {"x":1, "y":0},
13 {"x":2, "y":0}, 13 {"x":2, "y":0},
14 {"x":3, "y":0}, 14 {"x":3, "y":0},
15 {"x":0, "y":1}, 15 {"x":0, "y":1},
16 {"x":1, "y":1}, 16 {"x":1, "y":1},
17 {"x":2, "y":1}, 17 {"x":2, "y":1},
18 {"x":3, "y":1}, 18 {"x":3, "y":1},
19 {"x":0, "y":2}, 19 {"x":0, "y":2},
20 {"x":1, "y":2}, 20 {"x":1, "y":2},
21 {"x":2, "y":2}, 21 {"x":2, "y":2},
22 {"x":3, "y":2}, 22 {"x":3, "y":2},
23 {"x":0, "y":3}, 23 {"x":0, "y":3},
24 {"x":1, "y":3}, 24 {"x":1, "y":3},
25 {"x":2, "y":3}, 25 {"x":2, "y":3},
26 {"x":3, "y":3} 26 {"x":3, "y":3}
27 ] 27 ]
28 }
28 } 29 }
29 } 30}
30} \ No newline at end of file
diff --git a/keyboards/jj4x4/jj4x4.h b/keyboards/jj4x4/jj4x4.h
index 7b8cb8183..ee17e896d 100644
--- a/keyboards/jj4x4/jj4x4.h
+++ b/keyboards/jj4x4/jj4x4.h
@@ -28,14 +28,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
28 * represents the switch matrix. 28 * represents the switch matrix.
29 */ 29 */
30#define LAYOUT_ortho_4x4( \ 30#define LAYOUT_ortho_4x4( \
31 K01, K02, K03, K04, \ 31 K00, K01, K02, K03, \
32 K11, K12, K13, K14, \ 32 K10, K11, K12, K13, \
33 K21, K22, K23, K24, \ 33 K20, K21, K22, K23, \
34 K31, K32, K33, K34 \ 34 K30, K31, K32, K33 \
35) \ 35) { \
36{ \ 36 { K00, K01, K02, K03 }, \
37 { K01, K02, K03, K04 }, \ 37 { K10, K11, K12, K13 }, \
38 { K11, K12, K13, K14 }, \ 38 { K20, K21, K22, K23 }, \
39 { K21, K22, K23, K24 }, \ 39 { K30, K31, K32, K33 } \
40 { K31, K32, K33, K34 } \ 40}
41}
diff --git a/keyboards/jj4x4/keymaps/default/keymap.c b/keyboards/jj4x4/keymaps/default/keymap.c
index a0b06ee92..ae2c6b541 100644
--- a/keyboards/jj4x4/keymaps/default/keymap.c
+++ b/keyboards/jj4x4/keymaps/default/keymap.c
@@ -13,61 +13,56 @@
13 * You should have received a copy of the GNU General Public License 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/>. 14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */ 15 */
16
16#include QMK_KEYBOARD_H 17#include QMK_KEYBOARD_H
17 18
18enum layers { 19enum layers {
19 _BASE = 0, 20 _BASE = 0,
20 _FN1, 21 _FN1,
21 _FN2, 22 _FN2
22}; 23};
23 24
24// Defines the keycodes used by our macros in process_record_user 25// Defines the keycodes used by our macros in process_record_user
25enum custom_keycodes { 26enum custom_keycodes {
26 QMKBEST = SAFE_RANGE, 27 QMKBEST = SAFE_RANGE,
27 QMKURL 28 QMKURL
28}; 29};
29 30
30const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 31const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
31 32 [_BASE] = LAYOUT_ortho_4x4(
32 [_BASE] = LAYOUT_ortho_4x4( 33 KC_PGUP, KC_HOME, KC_UP, KC_END,
33 KC_PGUP, KC_HOME, KC_UP, KC_END , \ 34 KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT,
34 KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, \ 35 MO(_FN2), KC_VOLU, KC_MPLY, KC_MPRV,
35 MO(_FN2), KC_VOLU, KC_MPLY, KC_MPRV, \ 36 MO(_FN1), KC_VOLD, KC_MUTE, KC_MNXT
36 MO(_FN1), KC_VOLD, KC_MUTE, KC_MNXT \ 37 ),
37 ), 38 [_FN1] = LAYOUT_ortho_4x4(
38 [_FN1] = LAYOUT_ortho_4x4( 39 KC_ESC, KC_P7, KC_P8, KC_P9,
39 KC_ESC, KC_P7, KC_P8, KC_P9, \ 40 KC_TAB, KC_P4, KC_P5, KC_P6,
40 KC_TAB, KC_P4, KC_P5, KC_P6, \ 41 KC_ENT, KC_P1, KC_P2, KC_P3,
41 KC_ENT, KC_P1, KC_P2, KC_P3, \ 42 _______, KC_P0, KC_P0, KC_DOT
42 _______, KC_P0, KC_P0, KC_DOT \ 43 ),
43 ), 44 [_FN2] = LAYOUT_ortho_4x4(
44 [_FN2] = LAYOUT_ortho_4x4( 45 RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI,
45 RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ 46 RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD,
46 RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, \ 47 _______, _______, _______, RESET,
47 _______, _______, _______, RESET, \ 48 BL_STEP, _______, QMKBEST, QMKURL
48 BL_STEP, _______, QMKBEST, QMKURL \ 49 )
49 )
50
51}; 50};
52 51
53bool process_record_user(uint16_t keycode, keyrecord_t *record) { 52bool process_record_user(uint16_t keycode, keyrecord_t *record) {
54 switch (keycode) { 53 switch (keycode) {
55 case QMKBEST: 54 case QMKBEST:
56 if (record->event.pressed) { 55 if (record->event.pressed) {
57 // when keycode QMKBEST is pressed 56 // when keycode QMKBEST is pressed
58 SEND_STRING("QMK is the best thing ever!"); 57 SEND_STRING("QMK is the best thing ever!");
59 } else { 58 }
60 // when keycode QMKBEST is released 59 break;
61 } 60 case QMKURL:
62 break; 61 if (record->event.pressed) {
63 case QMKURL: 62 // when keycode QMKURL is pressed
64 if (record->event.pressed) { 63 SEND_STRING("https://qmk.fm/\n");
65 // when keycode QMKURL is pressed 64 }
66 SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); 65 break;
67 } else { 66 }
68 // when keycode QMKURL is released 67 return true;
69 }
70 break;
71 }
72 return true;
73} 68}
diff --git a/keyboards/jj4x4/keymaps/via/keymap.c b/keyboards/jj4x4/keymaps/via/keymap.c
new file mode 100644
index 000000000..35ca0e361
--- /dev/null
+++ b/keyboards/jj4x4/keymaps/via/keymap.c
@@ -0,0 +1,44 @@
1/* Copyright 2020
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
17#include QMK_KEYBOARD_H
18
19const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
20 LAYOUT_ortho_4x4(
21 KC_P7, KC_P8, KC_P9, KC_PSLS,
22 KC_P4, KC_P5, KC_P6, KC_PAST,
23 KC_P1, KC_P2, KC_P3, KC_PMNS,
24 KC_P0, KC_PDOT, KC_PPLS, LT(1, KC_ENT)
25 ),
26 LAYOUT_ortho_4x4(
27 RESET, _______, _______, _______,
28 _______, _______, _______, _______,
29 _______, _______, _______, _______,
30 _______, _______, _______, _______
31 ),
32 LAYOUT_ortho_4x4(
33 _______, _______, _______, _______,
34 _______, _______, _______, _______,
35 _______, _______, _______, _______,
36 _______, _______, _______, _______
37 ),
38 LAYOUT_ortho_4x4(
39 _______, _______, _______, _______,
40 _______, _______, _______, _______,
41 _______, _______, _______, _______,
42 _______, _______, _______, _______
43 )
44};
diff --git a/keyboards/jj4x4/keymaps/via/rules.mk b/keyboards/jj4x4/keymaps/via/rules.mk
new file mode 100644
index 000000000..82fb80d5e
--- /dev/null
+++ b/keyboards/jj4x4/keymaps/via/rules.mk
@@ -0,0 +1,3 @@
1VIA_ENABLE = yes
2EXTRAKEY_ENABLE = no
3MOUSEKEY_ENABLE = no
diff --git a/keyboards/jj4x4/README.md b/keyboards/jj4x4/readme.md
index 24212bc99..714e8e88f 100644
--- a/keyboards/jj4x4/README.md
+++ b/keyboards/jj4x4/readme.md
@@ -1,8 +1,8 @@
1# jj4x4 1# JJ4x4
2 2
3![jj4x4](https://cdn.shopify.com/s/files/1/2711/4238/products/JJ4x4case-1_1024x1024.jpg?v=1532325339) 3![jj4x4](https://cdn.shopify.com/s/files/1/2711/4238/products/JJ4x4case-1_1024x1024.jpg?v=1532325339)
4 4
5A 4x4 keypad kit made and KPRepublic on AliExpress. This is a chopped off version of the jj40 with rearranged keys. 5A 4x4 keypad kit made and KPRepublic on AliExpress. This is a chopped off version of the JJ40 with rearranged keys.
6 6
7* Keyboard Maintainer: [QMK Community](https://github.com/qmk) 7* Keyboard Maintainer: [QMK Community](https://github.com/qmk)
8* Hardware Supported: Atmega32A 8* Hardware Supported: Atmega32A
@@ -18,22 +18,22 @@ Flashing example for this keyboard ([after setting up the bootloadHID flashing e
18 18
19**Reset Key**: 19**Reset Key**:
20 20
21Hold down the key located at *K12*, commonly programmed as *8* while plugging in the keyboard USB cable. 21Hold down the key located at *K11*, commonly programmed as *8* while plugging in the keyboard USB cable.
22 22
23Key *K12* is in the above picture: 23Key *K11* is in the above picture:
24 24
25Row 2 from the top, Column 2 from the left, see the schematic below: 25Row 2 from the top, Column 2 from the left, see the schematic below:
26 26
27``` 27```
28 ,-----------------------. 28,-----------------------.
29 | | | | | 29| | | | |
30 |-----`-----`-----`-----| 30|-----`-----`-----`-----|
31 | | K12 | | | 31| | K11 | | |
32 |-----`-----`-----`-----| 32|-----`-----`-----`-----|
33 | | | | | 33| | | | |
34 |-----`-----`-----`-----| 34|-----`-----`-----`-----|
35 | | | | | 35| | | | |
36 `-----`-----`-----`-----' 36`-----`-----`-----`-----'
37``` 37```
38 38
39See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs). 39See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
diff --git a/keyboards/jj4x4/rules.mk b/keyboards/jj4x4/rules.mk
index 82e25e6a7..5ff5c3769 100644
--- a/keyboards/jj4x4/rules.mk
+++ b/keyboards/jj4x4/rules.mk
@@ -31,6 +31,6 @@ UNICODE_ENABLE = no # Unicode
31BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID 31BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
32AUDIO_ENABLE = no # Audio output on port C6 32AUDIO_ENABLE = no # Audio output on port C6
33FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches 33FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches
34HD44780_ENABLE = no # Enable support for HD44780 based LCDs 34HD44780_ENABLE = no # Enable support for HD44780 based LCDs
35 35
36LAYOUTS = ortho_4x4 36LAYOUTS = ortho_4x4