Skip to content

Commit

Permalink
Keychron K*: restructure (#184)
Browse files Browse the repository at this point in the history
* Keychron K*: restructure

* move usb stuff to usb

* cleanup whitespaces

* bump debounce to 5 on all rgb keychron

* keychron: add via json

* cleanup via json + add missing
  • Loading branch information
dexter93 authored Jan 3, 2022
1 parent 36ca329 commit e9b934f
Show file tree
Hide file tree
Showing 160 changed files with 894 additions and 1,442 deletions.
30 changes: 24 additions & 6 deletions bin/build_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,39 @@
'keychron/c1/rgb',
'keychron/c1/white',
'keychron/c2/white',
'keychron/k2',
'keychron/k3',
'keychron/k2/rgb',
'keychron/k2/rgb/via',
'keychron/k2/rgb/optical',
'keychron/k2/rgb/optical_via',
'keychron/k3/rgb',
'keychron/k3/rgb/via',
'keychron/k3/rgb/optical',
'keychron/k3/rgb/optical_via',
'keychron/k4/rgb/v1',
'keychron/k4/rgb/v1/via',
'keychron/k4/rgb/v1/optical',
'keychron/k4/rgb/v1/optical_via',
'keychron/k4/rgb/v2',
'keychron/k4/rgb/v2/via',
'keychron/k4/rgb/v2/optical',
'keychron/k4/rgb/v2/optical_via',
'keychron/k6/rgb',
'keychron/k6/rgb/via',
'keychron/k6/rgb/optical',
'keychron/k6/rgb/optical_via',
'keychron/k6/white',
'keychron/k7/rgb',
'keychron/k7/rgb/via',
'keychron/k7/rgb/optical',
'keychron/k8',
'keychron/k8/via',
'keychron/k8/optical',
'keychron/k8/optical_via',
'keychron/k7/rgb/optical_via',
'keychron/k8/rgb',
'keychron/k8/rgb/via',
'keychron/k8/rgb/optical',
'keychron/k8/rgb/optical_via',
'keychron/k14/rgb',
'keychron/k14/rgb/via',
'keychron/k14/rgb/optical',
'keychron/k14/rgb/optical_via',
'ajazz/ak33/rev1',
'ajazz/ak33/rev2',
'smartduck/xs61',
Expand Down
4 changes: 4 additions & 0 deletions keyboards/keychron/k14/keymaps/ansi/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* USB Device descriptor parameter */
#define VENDOR_ID 0x3434
#define PRODUCT_ID 0xFE1A
#define DEVICE_VER 0x0001
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "K14 RGB",
"name": "Keychron K14 ANSI",
"vendorId": "0x3434",
"productId": "0xFE1A",
"lighting": "none",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,10 @@
#pragma once

#include "config_common.h"

/* USB Device descriptor parameter */
#define VENDOR_ID 0x3434
#define PRODUCT_ID 0xFE1A
#define DEVICE_VER 0x0001
#include "config_led.h"

#define MANUFACTURER Keychron
#define PRODUCT K14
#define DESCRIPTION K14 Gateron RGB
#define PRODUCT K14 RGB

/* key matrix size */
#define MATRIX_ROWS 5
Expand All @@ -41,10 +36,8 @@
#define DIP_SWITCH_PINS { D4, D5 }

/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 0
#define DEBOUNCE 5

/* LED Status indicators */
#define LED_CAPS_LOCK_PIN B9
#define LED_PIN_ON_STATE 1

#include "config_led.h"
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once
#include <config.h>

// Backlight configuration
#define BACKLIGHT_LEVELS 8
Expand Down
11 changes: 11 additions & 0 deletions keyboards/keychron/k14/rgb/optical/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Keychron K14

K14 Optical RGB

Make example for this keyboard (after setting up your build environment):

make keychron/k14/rgb/optical:ansi

* * *

See 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).
File renamed without changes.
11 changes: 11 additions & 0 deletions keyboards/keychron/k14/rgb/optical_via/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Keychron K14

K14 Optical RGB with VIA support

Make example for this keyboard (after setting up your build environment):

make keychron/k14/rgb/optical_via:ansi

* * *

See 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).
File renamed without changes.
2 changes: 1 addition & 1 deletion keyboards/keychron/k14/rgb/via/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ Hardware Supported: SN32F248BF

Make example for this keyboard (after setting up your build environment):

make keychron/k14/rgb/via
make keychron/k14/rgb/via:ansi

See 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).
4 changes: 4 additions & 0 deletions keyboards/keychron/k2/keymaps/default/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* USB Device descriptor parameter */
#define VENDOR_ID 0x3434
#define PRODUCT_ID 0xFE02
#define DEVICE_VER 0x0001
17 changes: 17 additions & 0 deletions keyboards/keychron/k2/keymaps/default/via_ansi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "Keychron K2 ANSI",
"vendorId": "0x3434",
"productId": "0xFE02",
"lighting": "none",
"matrix": {"rows": 6, "cols": 16},
"layouts": {
"keymap": [
[ "0,0","0,1","0,2","0,3","0,4","0,5","0,6","0,7","0,8","0,9","0,10","0,11","0,12","0,13","0,14","0,15" ],
[ "1,0","1,1","1,2","1,3","1,4","1,5","1,6","1,7","1,8","1,9","1,10","1,11","1,12",{"w": 2},"1,13","1,15" ],
[{"w": 1.5},"2,0","2,1","2,2","2,3","2,4","2,5","2,6","2,7","2,8","2,9","2,10","2,11","2,12",{"w": 1.5},"2,13","2,15" ],
[{"w": 1.75},"3,0","3,1","3,2","3,3","3,4","3,5","3,6","3,7","3,8","3,9","3,10","3,11",{"w": 2.25},"3,13","3,15" ],
[{"w": 2.25},"4,0","4,2","4,3","4,4","4,5","4,6","4,7","4,8","4,9","4,10","4,11",{"w": 1.75},"4,13","4,14","4,15" ],
[{"w": 1.25},"5,0",{"w": 1.25},"5,1",{"w": 1.25},"5,2",{"w": 6.25},"5,6","5,10","5,11","5,12","5,13","5,14","5,15" ]
]
}
}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,10 @@
#pragma once

#include "config_common.h"

/* USB Device descriptor parameter */
#define VENDOR_ID 0x05AC
#define PRODUCT_ID 0x024F
#define DEVICE_VER 0x0001
#include "config_led.h"

#define MANUFACTURER Keychron
#define PRODUCT K2
#define DESCRIPTION K2 Gateron RGB v2
#define PRODUCT K2 RGB

/* key matrix size */
#define MATRIX_ROWS 6
Expand All @@ -41,10 +36,8 @@
#define DIP_SWITCH_PINS { D4, D5 }

/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 0
#define DEBOUNCE 5

/* LED Status indicators */
#define LED_CAPS_LOCK_PIN B9
#define LED_PIN_ON_STATE 1

#include "config_led.h"
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once
#include <config.h>

// Backlight configuration
#define BACKLIGHT_LEVELS 8
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions keyboards/keychron/k2/rgb/optical/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Keychron K2

K2 Optical RGB

Make example for this keyboard (after setting up your build environment):

make keychron/k2/rgb/optical:default

* * *

See 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).
1 change: 1 addition & 0 deletions keyboards/keychron/k2/rgb/optical/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
OPT_DEFS += -DOPTICAL_MATRIX
11 changes: 11 additions & 0 deletions keyboards/keychron/k2/rgb/optical_via/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Keychron K2

K2 Optical RGB with VIA support

Make example for this keyboard (after setting up your build environment):

make keychron/k2/rgb/optical_via:default

* * *

See 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).
2 changes: 2 additions & 0 deletions keyboards/keychron/k2/rgb/optical_via/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
OPT_DEFS += -DOPTICAL_MATRIX
VIA_ENABLE = yes
File renamed without changes.
3 changes: 3 additions & 0 deletions keyboards/keychron/k2/rgb/rgb.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#pragma once

#include "quantum.h"
File renamed without changes.
11 changes: 11 additions & 0 deletions keyboards/keychron/k2/rgb/via/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Keychron K2

K2 Gateron RGB with VIA support

Make example for this keyboard (after setting up your build environment):

make keychron/k2/rgb/via:default

* * *

See 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).
File renamed without changes.
4 changes: 4 additions & 0 deletions keyboards/keychron/k3/keymaps/default/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/* USB Device descriptor parameter */
#define VENDOR_ID 0x3434
#define PRODUCT_ID 0xFE04
#define DEVICE_VER 0x0001
17 changes: 17 additions & 0 deletions keyboards/keychron/k3/keymaps/default/via_ansi.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "Keychron K3 ANSI",
"vendorId": "0x3434",
"productId": "0xFE04",
"lighting": "none",
"matrix": {"rows": 6, "cols": 16},
"layouts": {
"keymap": [
[ "0,0","0,1","0,2","0,3","0,4","0,5","0,6","0,7","0,8","0,9","0,10","0,11","0,12","0,13","0,14","0,15" ],
[ "1,0","1,1","1,2","1,3","1,4","1,5","1,6","1,7","1,8","1,9","1,10","1,11","1,12",{"w": 2},"1,13","1,15" ],
[{"w": 1.5},"2,0","2,1","2,2","2,3","2,4","2,5","2,6","2,7","2,8","2,9","2,10","2,11","2,12",{"w": 1.5},"2,13","2,15" ],
[{"w": 1.75},"3,0","3,1","3,2","3,3","3,4","3,5","3,6","3,7","3,8","3,9","3,10","3,11",{"w": 2.25},"3,13","3,15" ],
[{"w": 2.25},"4,0","4,2","4,3","4,4","4,5","4,6","4,7","4,8","4,9","4,10","4,11",{"w": 1.75},"4,13","4,14","4,15" ],
[{"w": 1.25},"5,0",{"w": 1.25},"5,1",{"w": 1.25},"5,2",{"w": 6.25},"5,6","5,10","5,11","5,12","5,13","5,14","5,15" ]
]
}
}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,10 @@
#pragma once

#include "config_common.h"

/* USB Device descriptor parameter */
#define VENDOR_ID 0x05AC
#define PRODUCT_ID 0x024F
#define DEVICE_VER 0x0001
#include "config_led.h"

#define MANUFACTURER Keychron
#define PRODUCT K3
#define DESCRIPTION K3 Gateron RGB Non Hotswap
#define PRODUCT K3 RGB

/* key matrix size */
#define MATRIX_ROWS 6
Expand All @@ -41,6 +36,4 @@
#define DIP_SWITCH_PINS { D4, D5 }

/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 0

#include "config_led.h"
#define DEBOUNCE 5
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once
#include <config.h>

// Backlight configuration
#define BACKLIGHT_LEVELS 8
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions keyboards/keychron/k3/rgb/optical/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Keychron K3

K3 Optical RGB

Make example for this keyboard (after setting up your build environment):

make keychron/k3/rgb/optical:default

* * *

See 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).
1 change: 1 addition & 0 deletions keyboards/keychron/k3/rgb/optical/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
OPT_DEFS += -DOPTICAL_MATRIX
11 changes: 11 additions & 0 deletions keyboards/keychron/k3/rgb/optical_via/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Keychron K3

K3 Optical RGB with VIA support

Make example for this keyboard (after setting up your build environment):

make keychron/k3/rgb/optical_via:default

* * *

See 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).
2 changes: 2 additions & 0 deletions keyboards/keychron/k3/rgb/optical_via/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
OPT_DEFS += -DOPTICAL_MATRIX
VIA_ENABLE = yes
File renamed without changes.
3 changes: 3 additions & 0 deletions keyboards/keychron/k3/rgb/rgb.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#pragma once

#include "quantum.h"
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# project specific files
SRC = ../../../drivers/sn32/matrix_sn32f24xx.c
SRC = ../../../drivers/sn32/matrix_sn32f24xx.c
SRC += config_led.c

## chip/board settings
Expand Down
11 changes: 11 additions & 0 deletions keyboards/keychron/k3/rgb/via/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Keychron K3

K3 Gateron RGB with VIA support

Make example for this keyboard (after setting up your build environment):

make keychron/k3/rgb/via:default

* * *

See 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).
1 change: 1 addition & 0 deletions keyboards/keychron/k3/rgb/via/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VIA_ENABLE = yes
5 changes: 2 additions & 3 deletions keyboards/keychron/k4/rgb/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#pragma once

#include "config_common.h"
#include "config_led.h"

/* key matrix size */
#define MATRIX_ROWS 6
Expand All @@ -32,6 +33,4 @@
#define DIP_SWITCH_PINS { D5, D6 }

/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 0

#include "config_led.h"
#define DEBOUNCE 5
Loading

0 comments on commit e9b934f

Please sign in to comment.