Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Keychron C1] Migrate folder structure #227

Draft
wants to merge 47 commits into
base: sn32_master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
0826e4f
[Keychron C1 Series] Initial step to restructure
vjdato21 Feb 7, 2022
33a7ebc
[Keychron C1 Series] C1 White Restructure
vjdato21 Feb 7, 2022
c3d0f00
[Keychron C1 Series] Restructure C1 RGB
vjdato21 Feb 7, 2022
b217366
[Keychron C1 Series] Update
vjdato21 Feb 7, 2022
312e0c6
[Keychron C1 Series] Some fixes again
vjdato21 Feb 7, 2022
84d2802
[Keychron C1 Series] Reduce the amount of keymaps
vjdato21 Feb 7, 2022
2aadf8e
[Keychron C1 Series] Update readme.md
vjdato21 Feb 7, 2022
b0564ac
[Keychron C1 Series] Update readme.md
vjdato21 Feb 7, 2022
46709e8
Update config.h
vjdato21 Feb 8, 2022
4fa75df
Minor cleanups for C1 plain
edlf Feb 8, 2022
8a0150f
[Keychron C1 Series] Reorganizing keymaps
vjdato21 Feb 9, 2022
a9e431f
Update readme.md
vjdato21 Feb 9, 2022
b232cc1
Update config.h
vjdato21 Feb 10, 2022
ad29736
Update config.h
vjdato21 Feb 10, 2022
cb8ff37
Update c1.c
vjdato21 Feb 10, 2022
143cc2a
Merge branch 'sn32_master' into c1-restructure
vjdato21 Feb 10, 2022
bbc4546
[Keychron C1 Series] More agnostic keymap
vjdato21 Feb 10, 2022
f4253f6
[Keychron C1 Series] Fix keymap
vjdato21 Feb 10, 2022
46360a7
[Keychron C1 Series] Better keycode names XD
vjdato21 Feb 10, 2022
abf033e
Some Keychron C1 White...
vjdato21 Feb 10, 2022
05ab03b
[Keychron C1 White & Plain] Some fixes and new stuff yes
vjdato21 Feb 10, 2022
5f7b9e1
Update white.c
vjdato21 Feb 10, 2022
c875b37
[Keychron C1 Series] Update readme.md
vjdato21 Feb 10, 2022
6a484e3
Merge branch 'SonixQMK:sn32_master' into c1-restructure
vjdato21 Feb 10, 2022
6f7572a
[Keychron C1 RGB] Fix VIA
vjdato21 Feb 11, 2022
c81d103
[Keychron C1 Series] Tweaks to keymap
vjdato21 Feb 11, 2022
b601392
[Keychron C1 Series] Tweak keymap.c
vjdato21 Feb 11, 2022
0bb2794
Merge branch 'SonixQMK:sn32_master' into c1-restructure
vjdato21 Feb 12, 2022
78bb5aa
[Keychron C1 Series] Update `keymap.c`
vjdato21 Feb 12, 2022
43eaf19
Update keymap.c
vjdato21 Feb 14, 2022
d94bd9b
[Keychron C1 Series] Disable `WAIT_FOR_USB`
vjdato21 Feb 22, 2022
6184745
Merge branch 'SonixQMK:sn32_master' into c1-restructure
vjdato21 Mar 1, 2022
3f36522
Merge branch 'SonixQMK:sn32_master' into c1-restructure
vjdato21 Mar 3, 2022
8406cd4
Merge branch 'SonixQMK:sn32_master' into c1-restructure
vjdato21 Mar 7, 2022
41f8b42
[Keychron C1] Removed Launchpad Virtual Keycode
vjdato21 Mar 10, 2022
32a661c
uhm yes
vjdato21 Mar 10, 2022
f7e27c0
Merge branch 'SonixQMK:sn32_master' into c1-restructure
vjdato21 Mar 17, 2022
362174c
Merge branch 'SonixQMK:sn32_master' into c1-restructure
vjdato21 May 5, 2022
8337973
[Keychron C1] Set debounce for all
vjdato21 Jun 11, 2022
c2b7b38
Update config.h
vjdato21 Jun 11, 2022
2594262
[Keychron C1 RGB] Fixed an oversight
vjdato21 Sep 2, 2022
da6c705
Merge branch 'SonixQMK:sn32_master' into c1-restructure
vjdato21 Nov 13, 2022
86e6f32
[Keychron C1] Reduce debounce
vjdato21 Nov 15, 2022
bbb431f
Merge branch 'SonixQMK:sn32_master' into c1-restructure
vjdato21 Nov 19, 2022
9d394dd
Merge branch 'SonixQMK:sn32_master' into c1-restructure
vjdato21 Nov 25, 2022
16d68cf
Merge branch 'SonixQMK:sn32_master' into c1-restructure
vjdato21 Dec 9, 2022
0769b19
Merge branch 'SonixQMK:sn32_master' into c1-restructure
vjdato21 Jun 4, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions keyboards/keychron/c1/c1.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* Copyright 2020 Adam Honse <[email protected]>
* Copyright 2020 Dimitris Mantzouranis <[email protected]>
* Copyright 2021 IsaacDynamo
* Copyright 2021 Harrison Chan (Xelus)
*
* 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 "c1.h"
57 changes: 57 additions & 0 deletions keyboards/keychron/c1/c1.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
/* Copyright 2020 Adam Honse <[email protected]>
* Copyright 2020 Dimitris Mantzouranis <[email protected]>
* Copyright 2021 IsaacDynamo
* Copyright 2022 Harrison Chan (Xelus)
*
* 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/>.
*/

#pragma once

#include "quantum.h"

// Readability
#define XXX KC_NO

#define LAYOUT_tkl_ansi_240B( \
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0e, k0f, k0g, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, k1f, k1g, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, k2f, k2g, \
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, \
k40, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4d, k4f, \
k50, k51, k52, k56, k5a, k5b, k5c, k5d, k5e, k5f, k5g \
) { \
{ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, XXX, k0e, k0f, k0g }, \
{ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, k1f, k1g }, \
{ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, k2f, k2g }, \
{ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, XXX, k3d, XXX, XXX, XXX }, \
{ k40, XXX, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, XXX, k4d, XXX, k4f, XXX }, \
{ k50, k51, k52, XXX, XXX, XXX, k56, XXX, XXX, XXX, k5a, k5b, k5c, k5d, k5e, k5f, k5g } \
}

#define LAYOUT_tkl_ansi_260( \
k00, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, k0f, k0g, \
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, k1f, k1g, \
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, k2f, k2g, \
k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, \
k40, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4d, k4f, \
k50, k51, k52, k56, k5a, k5b, k5c, k5d, k5e, k5f, k5g \
) { \
{k00, XXX, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, k0f, k0g}, \
{k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, k1f, k1g}, \
{k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, k2f, k2g}, \
{k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, XXX, k3d, XXX, XXX, XXX}, \
{k40, XXX, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, XXX, k4d, XXX, k4f, XXX}, \
{k50, k51, k52, XXX, XXX, XXX, k56, XXX, XXX, XXX, k5a, k5b, k5c, k5d, k5e, k5f, k5g} \
}
36 changes: 36 additions & 0 deletions keyboards/keychron/c1/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/* Copyright 2020 Adam Honse <[email protected]>
* Copyright 2020 Dimitris Mantzouranis <[email protected]>
* Copyright 2021 IsaacDynamo
* Copyright 2022 Harrison Chan (Xelus)
*
* 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/>.
*/

#pragma once

#include "config_common.h"

/* USB Device descriptor parameter */
#define VENDOR_ID 0x3434
#define PRODUCT_ID 0xFE20
#define DEVICE_VER 0x0001

#define MANUFACTURER Keychron
#define PRODUCT Keychron \x43\x31

/* Polling Rate */
#define USB_POLLING_INTERVAL_MS 1

/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */
#define DEBOUNCE 1
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,73 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include QMK_KEYBOARD_H

#define KC_TASK LGUI(KC_TAB) // Task viewer
#define KC_FLXP LGUI(KC_E) // Windows file explorer
#define KC_CORT LGUI(KC_C) // Cortana
#define KC_SNIP LGUI(LSFT(KC_S)) // Windows snip tool
#define KC_W_FN MO(WIN_FN) // Windows Fn

#define KC_MSSN LGUI(KC_F3) // Mission Control
#define KC_FIND LALT(LGUI(KC_SPC)) // Finder
#define KC_SIRI LGUI(KC_SPC) // Siri
#define KC_MSCR LSFT(LGUI(KC_3)) // Mac screenshot
#define KC_MSNP LSFT(LGUI(KC_4)) // Mac snip tool
#define KC_M_FN MO(MAC_FN) // Mac Fn
enum layers{
MAC_BASE,
MAC_FN,
WIN_BASE,
WIN_FN
};

/* Keychron Fn */

#define KC_TASK LGUI(KC_TAB) // Task viewer
#define KC_FLXP LGUI(KC_E) // Windows file explorer
#define KC_CORT LGUI(KC_C) // Cortana
#define KC_SNIP LGUI(LSFT(KC_S)) // Windows snip tool
#define KC_W_FN MO(WIN_FN) // Windows Fn

#define KC_MCTL LGUI(KC_UP) // Mission Control
#define KC_SIRI LGUI(KC_SPC) // Siri
#define KC_MSCR LSFT(LGUI(KC_3)) // Mac screenshot
#define KC_MSNP LSFT(LGUI(KC_4)) // Mac snip tool
#define KC_M_FN MO(MAC_FN) // Mac Fn

/* Variant-tailored Defines */

#if defined(LED_MATRIX_ENABLE)
#define LAYOUT_tkl_ansi LAYOUT_tkl_ansi_260
#define LGT_VAD BL_DEC // Decrease KB Brightness
#define LGT_VAI BL_INC // Increase KB Brightness
#define XTR_AA BL_STEP // Cycle LED Modes
#define XTR_AB BL_TOGG // Toggle BL
#define XTR_BA BL_STEP // Cycle LED Modes
#define XTR_BB BL_TOGG // Toggle BL
#define LGT_HUI KC_TRNS // None
#define LGT_HUD KC_TRNS // None
#define LGT_SAI KC_TRNS // None
#define LGT_SAD KC_TRNS // None
#elif defined(RGB_MATRIX_ENABLE)
#define LAYOUT_tkl_ansi LAYOUT_tkl_ansi_240B
#define LGT_VAD RGB_VAD // Decrease KB Brightness
#define LGT_VAI RGB_VAI // Increase KB Brightness
#define XTR_AA RGB_MOD // Cycle RGB Modes
#define XTR_AB RGB_TOG // Toggle RGB
#define XTR_BA RGB_MOD // Cycle RGB Modes
#define XTR_BB RGB_TOG // Toggle RGB
#define LGT_HUI RGB_HUI // Increase RGB Hue
#define LGT_HUD RGB_HUD // Decrease RGB Hue
#define LGT_SAI RGB_SAI // Increase RGB Saturation
#define LGT_SAD RGB_SAD // Decrease RGB Saturation
#else
#define LAYOUT_tkl_ansi LAYOUT_tkl_ansi_260
#define LGT_VAD KC_TRNS // None
#define LGT_VAI KC_TRNS // None
#define XTR_AA LGUI(LCTL(KC_Q)) // Mac Lock
#define XTR_AB KC_TRNS // None
#define XTR_BA LGUI(KC_L) // Windows Lock
#define XTR_BB KC_TRNS // None
#define LGT_HUI KC_TRNS // None
#define LGT_HUD KC_TRNS // None
#define LGT_SAI KC_TRNS // None
#define LGT_SAD KC_TRNS // None
#endif


const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Windows layout

/* Mac layout
+-------------------------------------------------------------------------------------------+
| ESC | | F1 | F2 | F3 | F4 | | F5 | F6 | F7 | F8 | | F9| F10| F11| F12| | |PSCR|CORT| BL |
| ESC | | F1 | F2 | F3 | F4 | | F5 | F6 | F7 | F8 | | F9| F10| F11| F12| | |PSCR|SIRI| BL |
+--------------------------------------------------------------------------+ +--------------+
| ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BACKSP | |INS |HOME|PGUP|
+--------------------------------------------------------------------------+ +--------------+
Expand All @@ -42,31 +92,31 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+--------------------------------------------------------------------------+ +----+ |
| LSHIFT | Z | X | C | V | B | N | M | , | . | / | RSHIFT | | UP | |
+--------------------------------------------------------------------------+ +--------------+
|LCTRL| LGUI| LALT | SPACE | RALT| RGUI | FN | RCTRL | |LFT |DWN |RGT |
|LCTRL| LALT| LGUI | SPACE | RGUI| RALT | FN | RCTRL | |LFT |DWN |RGT |
+-------------------------------------------------------------------------------------------+
*/

[WIN_BASE] = LAYOUT( \
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_PSCR, KC_CORT, RGB_TOG, \
[MAC_BASE] = LAYOUT_tkl_ansi( \
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_MSCR, KC_SIRI, XTR_AA, \
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_ENT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_W_FN, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \
KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_M_FN, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \
),

[WIN_FN] = LAYOUT( \
RESET, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_SNIP, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
[MAC_FN] = LAYOUT_tkl_ansi( \
RESET, KC_BRID, KC_BRIU, KC_MCTL, _______, LGT_VAD, LGT_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_MSNP, _______, XTR_AB, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, NK_TOGG, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPI, \
_______, _______, _______, _______, _______, _______, _______, _______, RGB_RMOD, RGB_SPD, RGB_MOD \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, LGT_HUI, \
_______, _______, GUI_TOG, _______, GUI_TOG, _______, _______, _______, LGT_SAD, LGT_HUD, LGT_SAI \
),

/* Mac layout
/* Windows layout
+-------------------------------------------------------------------------------------------+
| ESC | | F1 | F2 | F3 | F4 | | F5 | F6 | F7 | F8 | | F9| F10| F11| F12| | |PSCR|SIRI| BL |
| ESC | | F1 | F2 | F3 | F4 | | F5 | F6 | F7 | F8 | | F9| F10| F11| F12| | |PSCR|CORT| BL |
+--------------------------------------------------------------------------+ +--------------+
| ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | BACKSP | |INS |HOME|PGUP|
+--------------------------------------------------------------------------+ +--------------+
Expand All @@ -76,25 +126,61 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+--------------------------------------------------------------------------+ +----+ |
| LSHIFT | Z | X | C | V | B | N | M | , | . | / | RSHIFT | | UP | |
+--------------------------------------------------------------------------+ +--------------+
|LCTRL| LALT| LGUI | SPACE | RGUI| RALT | FN | RCTRL | |LFT |DWN |RGT |
|LCTRL| LGUI| LALT | SPACE | RALT| RGUI | FN | RCTRL | |LFT |DWN |RGT |
+-------------------------------------------------------------------------------------------+
*/

[MAC_BASE] = LAYOUT( \
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_MSCR, KC_SIRI, RGB_TOG, \
[WIN_BASE] = LAYOUT_tkl_ansi( \
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_PSCR, KC_CORT, XTR_BA, \
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_ENT, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \
KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_M_FN, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_W_FN, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \
),

[MAC_FN] = LAYOUT( \
RESET, KC_BRID, KC_BRIU, KC_MSSN, KC_FIND, RGB_VAD, RGB_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_MSNP, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
[WIN_FN] = LAYOUT_tkl_ansi( \
RESET, KC_BRID, KC_BRIU, KC_TASK, KC_FLXP, LGT_VAD, LGT_VAI, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_SNIP, _______, XTR_BB, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, NK_TOGG, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPI, \
_______, _______, _______, _______, _______, _______, _______, _______, RGB_RMOD, RGB_SPD, RGB_MOD \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, LGT_HUI, \
_______, GUI_TOG, _______, _______, _______, GUI_TOG, _______, _______, LGT_SAD, LGT_HUD, LGT_SAI \
)
};

// Manage Windows and Mac LEDs
// - Show status of mode switch
// - Turn LEDs off durring USB suspend
static bool mode_leds_show = true;
static bool mode_leds_windows;

static void mode_leds_update(void){
writePin(LED_WIN_PIN, mode_leds_show && mode_leds_windows);
writePin(LED_MAC_PIN, mode_leds_show && !mode_leds_windows);
}

bool dip_switch_update_kb(uint8_t index, bool active){
if(index == 0) {
if(active) { // Mac mode
layer_move(MAC_BASE);
} else { // Windows mode
layer_move(WIN_BASE);
}

// Update mode and update leds
mode_leds_windows = !active;
mode_leds_update();
}

dip_switch_update_user(index, active);
return true;
}

void keyboard_pre_init_kb(void) {
// Setup Win & Mac LED Pins as output
setPinOutput(LED_WIN_PIN);
setPinOutput(LED_MAC_PIN);

keyboard_pre_init_user();
}
Loading