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

Added Skyloong/GK61 pro dual space keyboard. #22988

Open
wants to merge 31 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
55fcbd9
Create GK61 pro double space keyboard.
NaturalZh Jan 30, 2024
5f43527
Update keyboards/skyloong/gk61/pro_ds/config.h
NaturalZh Jan 31, 2024
d48b24b
Update keyboards/skyloong/gk61/pro_ds/pro_ds.c
NaturalZh Jan 31, 2024
f438b2f
Update keyboards/skyloong/gk61/pro_ds/pro_ds.c
NaturalZh Jan 31, 2024
a62a526
deleted keyboards/skyloong/gk61/pro_ds/keymaps/default/rules.mk.
NaturalZh Jan 31, 2024
400a12f
Update keyboards/skyloong/gk61/pro_ds/config.h
NaturalZh Feb 1, 2024
3267ca3
Update keyboards/skyloong/gk61/pro_ds/info.json
NaturalZh Feb 1, 2024
6fa88f2
modified tapping term setting
NaturalZh Feb 19, 2024
8bd44df
Merge branch 'develop' into gk61_pro_ds
NaturalZh Feb 28, 2024
606e72f
corrected rgb matrix driver
NaturalZh Feb 28, 2024
c654459
Update keyboards/skyloong/gk61/pro_ds/config.h
NaturalZh Mar 29, 2024
6d2b47b
Update keyboards/skyloong/gk61/pro_ds/pro_ds.c
NaturalZh Mar 29, 2024
0ef44f6
Update keyboards/skyloong/gk61/pro_ds/pro_ds.c
NaturalZh Mar 29, 2024
4f2e5d8
update skyloong/gk61/pro_ds/config.h
NaturalZh Mar 29, 2024
51e2f09
update skyloong/gk61/pro_ds/pro_ds.c
NaturalZh Jun 11, 2024
60b4958
Update keyboards/skyloong/gk61/pro_ds/keymaps/via/keymap.c
NaturalZh Aug 19, 2024
26c3222
update skyloong/gk61/pro_ds/keymaps/via/keymap.c
NaturalZh Aug 19, 2024
4e017fa
Update keyboards/skyloong/gk61/pro_ds/keymaps/via/keymap.c
NaturalZh Aug 21, 2024
2258442
Update keyboards/skyloong/gk61/pro_ds/keymaps/via/keymap.c
NaturalZh Aug 21, 2024
3b5b40d
Update keyboards/skyloong/gk61/pro_ds/keymaps/via/keymap.c
NaturalZh Aug 21, 2024
65d95ef
Update keyboards/skyloong/gk61/pro_ds/keymaps/via/keymap.c
NaturalZh Aug 21, 2024
3bae631
Update keyboards/skyloong/gk61/pro_ds/keymaps/via/keymap.c
NaturalZh Aug 21, 2024
fb452c7
Update keyboards/skyloong/gk61/pro_ds/keymaps/via/keymap.c
NaturalZh Aug 21, 2024
0bfdaa5
update skyloong/gk61/pro_ds/keymaps/via/keymap.c
NaturalZh Aug 21, 2024
10ebb19
Update keyboards/skyloong/gk61/pro_ds/info.json
NaturalZh Aug 26, 2024
e9a5309
Update keyboards/skyloong/gk61/pro_ds/info.json
NaturalZh Aug 26, 2024
cc4629b
Update keyboards/skyloong/gk61/pro_ds/info.json
NaturalZh Aug 26, 2024
ca1bbe7
rename skyloong/gk61/pro_ds/info.json keyboard.json;
NaturalZh Aug 26, 2024
6967ba2
Merge branch 'develop' into gk61_pro_ds
NaturalZh Aug 26, 2024
a3e0e52
Delete skyloong/gk61/pro_ds/keymaps/via keymap files
NaturalZh Aug 27, 2024
3603918
Update keyboards/skyloong/gk61/pro_ds/config.h
NaturalZh Aug 29, 2024
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
19 changes: 19 additions & 0 deletions keyboards/skyloong/gk61/pro_ds/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Copyright 2023 linlin012 (@linlin012)
// SPDX-License-Identifier: GPL-2.0-or-later

#pragma once

#ifdef RGB_MATRIX_ENABLE
# define RGB_MATRIX_LED_COUNT 64
# define CAPS_LOCK_INDEX 28
# define WIN_MOD_INDEX 16
# define MAC_MOD_INDEX 17
# define SDB A4

# define RGB_DISABLE_WHEN_USB_SUSPENDED
# define RGB_MATRIX_KEYPRESSES
# define RGB_MATRIX_FRAMEBUFFER_EFFECTS

# define AW20216S_CS_PIN_1 B12
# define AW20216S_EN_PIN_1 SDB
#endif // RGB_MATRIX_ENABLE
NaturalZh marked this conversation as resolved.
Show resolved Hide resolved
9 changes: 9 additions & 0 deletions keyboards/skyloong/gk61/pro_ds/halconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Copyright 2023 linlin012 (@linlin012)
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once

#define HAL_USE_SPI TRUE
#define SPI_USE_WAIT TRUE
#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD

#include_next <halconf.h>
330 changes: 330 additions & 0 deletions keyboards/skyloong/gk61/pro_ds/info.json
NaturalZh marked this conversation as resolved.
Show resolved Hide resolved

Large diffs are not rendered by default.

37 changes: 37 additions & 0 deletions keyboards/skyloong/gk61/pro_ds/keymaps/default/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Copyright 2021 JZ-Skyloong (@JZ-Skyloong)
// SPDX-License-Identifier: GPL-2.0-or-later

#include QMK_KEYBOARD_H

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
* │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │Bsp│
* ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
* │Tab│ Q │ W │ E | R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │
* ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
* │Cap│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ |Ent│
* ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
* │Sft│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ |Sft| │
* ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
* │Ctl│GUI│Alt│ │Spc│Mut│ │ |Spc|Alt│App│Ctl│ │Mo1|
* └───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┘
*/
[0] = LAYOUT_all(
KC_ESC, 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_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_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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_APP, KC_RCTL, MO(1)
),

[1] = LAYOUT_all(
KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______,
_______, RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
)

};

1 change: 1 addition & 0 deletions keyboards/skyloong/gk61/pro_ds/keymaps/default/rules.mk
NaturalZh marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# File intentionally blank
237 changes: 237 additions & 0 deletions keyboards/skyloong/gk61/pro_ds/keymaps/via/keymap.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,237 @@
// Copyright 2023 NaturalZh (@NaturalZh)
// SPDX-License-Identifier: GPL-2.0-or-later

#include QMK_KEYBOARD_H
_Bool FN_WIN = 0;
_Bool FN_MAC = 0;
_Bool L_WIN = 0;
_Bool L_MAC = 0;

enum layer_names {
_WIN,
_MAC,
_WIN_INDEX,
_MAC_INDEX,
};

enum tap_hold_keys {
_DN_MU //Tap--KC_DOWN and Hold--KC_APP
};


const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/*
* ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐
* │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │Bsp│
* ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
* │Tab│ Q │ W │ E | R │ T │ Y │ U │ I │ O │ P │ [ │ ] │ \ │
* ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
* │Cap│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ |Ent│
* ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
* │Sft│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │ |Sft| │
* ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤
* │Ctl│GUI│Alt│ │Spc│Spc│Mut│ |Spc|Alt│App│Ctl│ │Mox|
* └───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┴───┘
*/
[_WIN] = LAYOUT_all(
KC_ESC, 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_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_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, RSFT_T(KC_UP),
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, LT(_WIN_INDEX, KC_LEFT), TD(_DN_MU), RCTL_T(KC_RIGHT)
),

[_MAC] = LAYOUT_all(
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RSFT_T(KC_UP),
_______, KC_LALT, KC_LGUI, _______, _______, _______, KC_RGUI, LT(_MAC_INDEX, KC_LEFT), RALT_T(KC_DOWN), RCTL_T(KC_RIGHT)
),

[_WIN_INDEX] = LAYOUT_all(
KC_GRV , 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_DEL,
_______, _______, TO(0), TO(1), _______, _______, _______, _______, _______, _______, RGB_M_P, RGB_RMOD, RGB_RMOD, RGB_TOG,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_SPI, _______,
_______, _______, _______, _______, _______, _______, _______, _______, RGB_VAD, RGB_VAI, KC_UP, _______,
_______, _______, _______, _______, _______, _______, KC_LEFT, _______, KC_DOWN, KC_RIGHT
),

[_MAC_INDEX] = LAYOUT_all(
KC_GRV , KC_F14, KC_F15, C(KC_UP), G(KC_D), G(KC_SPC), LAG(KC_EJCT), KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, KC_DEL,
_______, _______, TO(0), TO(1), _______, _______, _______, _______, _______, _______, RGB_M_P, RGB_RMOD, RGB_RMOD, RGB_TOG,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SPD, RGB_SPI, _______,
_______, _______, _______, _______, _______, _______, _______, _______, RGB_VAD, RGB_VAI, KC_UP, _______,
_______, _______, _______, _______, _______, _______, KC_LEFT, _______, KC_DOWN, KC_RIGHT
)
};


typedef struct {
uint16_t tap;
uint16_t hold;
uint16_t held;
} tap_dance_tap_hold_t;

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
tap_dance_action_t *action;

switch (keycode) {
case TD(_DN_MU):
action = &tap_dance_actions[TD_INDEX(keycode)];
if (!record->event.pressed && action->state.count && !action->state.finished) {
tap_dance_tap_hold_t *tap_hold = (tap_dance_tap_hold_t *)action->user_data;
tap_code16(tap_hold->tap);
}
}
return true;
}

void tap_dance_tap_hold_finished(tap_dance_state_t *state, void *user_data) {
tap_dance_tap_hold_t *tap_hold = (tap_dance_tap_hold_t *)user_data;

if (state->pressed) {
if (state->count == 1
#ifndef PERMISSIVE_HOLD
&& !state->interrupted
#endif
) {
register_code16(tap_hold->hold);
tap_hold->held = tap_hold->hold;
} else {
register_code16(tap_hold->tap);
tap_hold->held = tap_hold->tap;
}
}
}

void tap_dance_tap_hold_reset(tap_dance_state_t *state, void *user_data) {
tap_dance_tap_hold_t *tap_hold = (tap_dance_tap_hold_t *)user_data;

if (tap_hold->held) {
unregister_code16(tap_hold->held);
tap_hold->held = 0;
}
}

#define ACTION_TAP_DANCE_TAP_HOLD(tap, hold) \
{ .fn = {NULL, tap_dance_tap_hold_finished, tap_dance_tap_hold_reset}, .user_data = (void *)&((tap_dance_tap_hold_t){tap, hold, 0}), }

tap_dance_action_t tap_dance_actions[] = {
[_DN_MU] = ACTION_TAP_DANCE_TAP_HOLD(KC_DOWN, KC_APP),
};


bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {

switch (get_highest_layer(layer_state)) {
case 2:{
NaturalZh marked this conversation as resolved.
Show resolved Hide resolved
RGB_MATRIX_INDICATOR_SET_COLOR(WIN_MOD_INDEX, 255, 255, 255);
if (!rgb_matrix_get_flags()) {
RGB_MATRIX_INDICATOR_SET_COLOR(MAC_MOD_INDEX, 0, 0, 0);
}
} break;
case 3:{
NaturalZh marked this conversation as resolved.
Show resolved Hide resolved
RGB_MATRIX_INDICATOR_SET_COLOR(MAC_MOD_INDEX, 255, 255, 255);
if (!rgb_matrix_get_flags()) {
RGB_MATRIX_INDICATOR_SET_COLOR(WIN_MOD_INDEX, 0, 0, 0);
}
} break;

case 0:{
NaturalZh marked this conversation as resolved.
Show resolved Hide resolved
if (L_WIN) {
RGB_MATRIX_INDICATOR_SET_COLOR(WIN_MOD_INDEX, 255, 255, 255);
if (!rgb_matrix_get_flags()) {
RGB_MATRIX_INDICATOR_SET_COLOR(MAC_MOD_INDEX, 0, 0, 0);
}
}else{
if (!rgb_matrix_get_flags()) {
RGB_MATRIX_INDICATOR_SET_COLOR(WIN_MOD_INDEX, 0, 0, 0);
}
}
} break;

case 1:{
NaturalZh marked this conversation as resolved.
Show resolved Hide resolved
if (L_MAC) {
RGB_MATRIX_INDICATOR_SET_COLOR(MAC_MOD_INDEX, 255, 255, 255);
if (!rgb_matrix_get_flags()) {
RGB_MATRIX_INDICATOR_SET_COLOR(WIN_MOD_INDEX, 0, 0, 0);
}
}else{
if (!rgb_matrix_get_flags()) {
RGB_MATRIX_INDICATOR_SET_COLOR(MAC_MOD_INDEX, 0, 0, 0);
}
}
} break;

default:{
if (!rgb_matrix_get_flags()) {
RGB_MATRIX_INDICATOR_SET_COLOR(WIN_MOD_INDEX, 0, 0, 0);
RGB_MATRIX_INDICATOR_SET_COLOR(MAC_MOD_INDEX, 0, 0, 0);
}
}
}
return true;
}


bool process_record_kb(uint16_t keycode, keyrecord_t *record) {
if (!process_record_user(keycode, record)) {
return false;
}
switch (keycode) {
# ifdef RGB_MATRIX_ENABLE
case RGB_TOG:
if (record->event.pressed) {
switch (rgb_matrix_get_flags()) {
case LED_FLAG_ALL: {
rgb_matrix_set_flags(LED_FLAG_NONE);
rgb_matrix_set_color_all(0, 0, 0);
} break;
default: {
rgb_matrix_set_flags(LED_FLAG_ALL);
} break;
}
}
return false;
case RGB_VAI:
rgb_matrix_set_flags(LED_FLAG_ALL);
return true;
# endif
case TO(0):
if (record->event.pressed) {
L_WIN = 1;
set_single_persistent_default_layer(0); // Save default layer 0 to eeprom
} else {
L_WIN = 0;
}
return true; // continue all further processing of this key

case MO(2):
if (record->event.pressed) {
FN_WIN = 1;
} else {
FN_WIN = 0;
}
return true; // continue all further processing of this key
NaturalZh marked this conversation as resolved.
Show resolved Hide resolved

case TO(1):
if (record->event.pressed) {
L_MAC = 1;
set_single_persistent_default_layer(1); //Save default layer 1 to eeprom
} else {
L_MAC = 0;
}
return true; // continue all further processing of this key

case MO(3):
if (record->event.pressed) {
FN_MAC = 1;
} else {
FN_MAC = 0;
}
return true; // continue all further processing of this key
default:
return true;
}
}
2 changes: 2 additions & 0 deletions keyboards/skyloong/gk61/pro_ds/keymaps/via/rules.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VIA_ENABLE = yes
TAP_DANCE_ENABLE = yes
12 changes: 12 additions & 0 deletions keyboards/skyloong/gk61/pro_ds/mcuconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright 2023 NaturalZh (@NaturalZh)
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once

#include_next <mcuconf.h>

#undef STM32_SPI_USE_SPI2
#define STM32_SPI_USE_SPI2 TRUE

#undef STM32_SPI_USE_DMA
#define STM32_SPI_USE_DMA TRUE

Loading
Loading