Skip to content

Commit

Permalink
[Keychron K8 RGB] Update keychron k8 keymaps, and add via json file f…
Browse files Browse the repository at this point in the history
…or k8 iso. (qmk#164)

* Keychron k8 cleanup for via

* Update device descriptors for k8

* update k8 descriptions

* Rearrange files, and add readme

* Match keychron original iso keymap

* F4 is explorer open on keychron layout

Co-authored-by: Thomas Bowman Mørch <[email protected]>
  • Loading branch information
tbowmo and Thomas Bowman Mørch authored Dec 5, 2021
1 parent cefac8e commit 3711823
Show file tree
Hide file tree
Showing 16 changed files with 165 additions and 101 deletions.
1 change: 1 addition & 0 deletions bin/build_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
'keychron/k6/rgb/via',
'keychron/k6/white',
'keychron/k8',
'keychron/k8/via',
'ajazz/ak33/rev1',
'ajazz/ak33/rev2',
'smartduck/xs61',
Expand Down
17 changes: 17 additions & 0 deletions keyboards/keychron/k8/k8_iso.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "Keychron K8",
"vendorId": "0x3434",
"productId": "0xfe2f",
"lighting": "none",
"matrix": {"rows": 6, "cols": 17},
"layouts": {
"keymap": [
["0,0", {"x": 1}, "0,1", "0,2", "0,3", "0,4", {"x": 0.5}, "0,5", "0,6", "0,7", "0,8", {"x": 0.5}, "0,9", "0,10", "0,11", "0,12", {"x": 0.25}, "0,14", "0,15", "0,16"],
[{"y": 0.25}, "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", {"x": 0.25 }, "1,14", "1,15", "1,16"],
[{"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", {"x":0.25,"w":1.25,"h":2,"w2":1.5,"h2":1,"x2":-0.25}, "3,13", { "x": 0.25 }, "2,14", "2,15", "2,16"],
[{"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", "3,12"],
[{"w": 1.25 }, "4,0", "4,1", "4,2", "4,3", "4,4", "4,5", "4,6", "4,7", "4,8", "4,9", "4,10", "4,11", {"w": 2.75 }, "4,13", {"x": 1.25 }, "4,15"],
[{"w": 1.25 }, "5,0", {"w": 1.25 }, "5,1", {"w": 1.25 }, "5,2", {"w": 6.25 }, "5,6", {"w": 1.25 }, "5,10", {"w": 1.25 }, "5,11", {"w": 1.25 }, "5,12", {"w": 1.25 }, "5,13", {"x": 0.25 }, "5,14", "5,15", "5,16"]
]
}
}
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ EXTRAKEY_ENABLE = yes # Audio control and System control
# MAGIC_ENABLE = yes
# MAGIC_KEYCODE_ENABLE = yes

VIA_ENABLE = no
# BOOTMAGIC_ENABLE = no # https://beta.docs.qmk.fm/using-qmk/hardware-features/feature_bootmagic
# NKRO_ENABLE = no

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
#include "config_common.h"

/* USB Device descriptor parameter */
#define VENDOR_ID 0x05AC
#define PRODUCT_ID 0x0250
#define VENDOR_ID 0x3434
#define PRODUCT_ID 0xFE2F
#define DEVICE_VER 0x0001

#define MANUFACTURER Keychron
#define PRODUCT K8 iso uk
#define DESCRIPTION K8 ISO UK RGB Hotswap
#define PRODUCT K8 ISO
#define DESCRIPTION K8 ISO RGB Hotswap

/* key matrix size */
#define MATRIX_ROWS 6
Expand All @@ -49,4 +49,8 @@

//#define FORCE_NKRO

#define RGB_MATRIX_FRAMEBUFFER_EFFECTS
#define RGB_MATRIX_KEYPRESSES
#define RGB_MATRIX_KEYRELEASES

#include "config_led.h"
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS
#define RGB_MATRIX_STARTUP_SPD 0
#define RGB_MATRIX_LED_FLUSH_LIMIT 32
#define RGB_MATRIX_FRAMEBUFFER_EFFECTS
#define RGB_MATRIX_KEYPRESSES
#define RGB_MATRIX_KEYRELEASES
97 changes: 97 additions & 0 deletions keyboards/keychron/k8/keymaps/iso/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/*
Copyright 2020 Dimitris Mantzouranis
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 <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {


/* +--------------------------------------------------------------------------+----------------+
| ESC | | F1 | F2 | F3 | F4 | | F5 | F6 | F7 | F8 | | F9| F10| F11| F12| | |PSCR|????|PAUS|
+--------------------------------------------------------------------------+------|----|----|
| ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BACKSP | |INS |SCRL|PGUP|
+--------------------------------------------------------------------------+------|----|----|
| TAB | Q | W | E | R | T | Y | U | I | O | P | [ | ] | | |DEL |END |PGDN|
+-------------------------------------------------------------------- RET |------|----|----|
| CAPSLCK | A | S | D | F | G | H | J | K | L | ; | ' | # | | |
+--------------------------------------------------------------------------+ |----| |
| LSHIFT | \ | Z | X | C | V | B | N | M | , | . | / | RSHIFT | | UP | |
+--------------------------------------------------------------------------+------|----|----|
|LCTRL| LGUI| LALT | SPACE | RALT| RGUI | FN | RCTRL | |LFT |DWN |RGT |
+--------------------------------------------------------------------------+----------------+
*/
/* Row: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 */
[0] = { { KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_PSCR, KC_SLCK, KC__MUTE},
{ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP},
{ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN},
{ KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_NO, KC_NO, KC_NO},
{ KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_NO, KC_RSFT, KC_NO, KC_UP, KC_NO},
{ KC_LCTL, KC_LGUI, KC_LALT, KC_NO, KC_NO, KC_NO, KC_SPC, KC_NO, KC_NO, KC_NO, KC_RALT, KC_RGUI, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT}
},

/* Row: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 */
[1] = { { RESET, KC_BRIGHTNESS_DOWN, KC_BRIGHTNESS_UP, KC_APP, KC_MY_COMPUTER, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC__MUTE, KC_VOLU, KC_VOLD, KC_NO, KC_PSCR, KC_SLEP, RGB_TOG },
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAI, RGB_SAI, RGB_HUI },
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_SAD, RGB_HUD },
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_NO, KC_NO, KC_NO },
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_NO, _______, KC_NO, KC_VOLU, KC_NO },
{ _______, _______, _______, KC_NO, KC_NO, KC_NO, _______, KC_NO, KC_NO, KC_NO, _______, _______, _______, _______, RGB_MODE_REVERSE, KC_VOLD, RGB_MODE_FORWARD }
},
/* Row: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 */
[2] = { { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_NO, _______, _______, _______ },
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_NO, _______, KC_NO, _______, KC_NO },
{ _______, _______, _______, KC_NO, KC_NO, KC_NO, _______, KC_NO, KC_NO, KC_NO, _______, _______, _______, _______, _______, _______, _______ }
},

/* Row: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 */
[3] = { { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_NO, _______, _______, _______ },
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ },
{ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_NO, _______, KC_NO, _______, KC_NO },
{ _______, _______, _______, KC_NO, KC_NO, KC_NO, _______, KC_NO, KC_NO, KC_NO, _______, _______, _______, _______, _______, _______, _______ }
}
};
void dip_switch_update_user(uint8_t index, bool active){
switch(index){
case 0:
if(active){ //BT mode
// do stuff
}
else{ //Cable mode
// do stuff
}
break;
case 1:
if(active){ // Win/Android mode
// do stuff
}
else{ // Mac/iOS mode
// do stuff
}
break;
}
}
void keyboard_post_init_user(void) {
// Customise these values to desired behaviour
// debug_enable=true;
// debug_matrix=true;
// debug_keyboard=true;
// debug_mouse=true;
}
14 changes: 14 additions & 0 deletions keyboards/keychron/k8/keymaps/iso/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# https://beta.docs.qmk.fm/developing-qmk/qmk-reference/getting_started_make_guide#rules-mk-options

# AUTO_SHIFT_ENABLE = yes
# MOUSEKEY_ENABLE = yes
EXTRAKEY_ENABLE = yes # Audio control and System control
# MAGIC_ENABLE = yes
# MAGIC_KEYCODE_ENABLE = yes

# BOOTMAGIC_ENABLE = no # https://beta.docs.qmk.fm/using-qmk/hardware-features/feature_bootmagic
# NKRO_ENABLE = no




92 changes: 0 additions & 92 deletions keyboards/keychron/k8/keymaps/iso_uk/keymap.c

This file was deleted.

8 changes: 4 additions & 4 deletions keyboards/keychron/k8/readme.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Keychron K8

K8 Gateron Hotswap RGB ANSI
K8 Gateron Hotswap RGB

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

make keychron/k8:default
make keychron/k8:ansi

For default ISO UK:
For default ISO:

make keychron/k8:iso_uk
make keychron/k8:iso

* * *
For more info and detailed flashing instructions, please visit https://github.com/alex-dinh/keychron-k8
Expand Down
16 changes: 16 additions & 0 deletions keyboards/keychron/k8/via/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Keychron K8

K8 Gateron Hotswap RGB with VIA support

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

make keychron/k8/via:ansi

For default ISO:

make keychron/k8/via:iso

* * *
For more info and detailed flashing instructions, please visit https://github.com/alex-dinh/keychron-k8

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).
5 changes: 5 additions & 0 deletions keyboards/keychron/k8/via/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
VIA_ENABLE = yes




0 comments on commit 3711823

Please sign in to comment.