feat(qmk): use qmk userspace (#7)

* feat(qmk): use qmk userspace (1/?)

* feat(qmk): move tap dance to userspace

* chore: fix qmk c2json gh action
main
sudo pacman -Syu 2023-09-16 13:08:08 +07:00 committed by GitHub
parent c33213e464
commit a6e97bcd87
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 99 additions and 55 deletions

View File

@ -41,16 +41,23 @@ jobs:
path: haunt98_qmk_keymaps
- name: Copy keymaps
run: |
rm -rf keyboards/dztech/dz60rgb_wkl/keymaps/haunt98
cp -rf haunt98_qmk_keymaps/dztech_dz60rgb_wkl/keymaps/haunt98 keyboards/dztech/dz60rgb_wkl/keymaps/
rm -rf users/haunt98
cp -rf haunt98_qmk_keymaps/users/haunt98 users/
- name: Lint
run: |
qmk lint -kb dztech/dz60rgb_wkl/v2_1 -km haunt98
- name: Build firmware
run: |
qmk compile -j 8 -kb dztech/dz60rgb_wkl/v2_1 -km haunt98
make dztech/dz60rgb_wkl/v2_1:haunt98
- name: Convert keymaps JSON
run: |
qmk c2json -kb dztech/dz60rgb_wkl/v2_1 -km haunt98 -o dztech_dz60rgb_wkl_haunt98_keymap.json haunt98_qmk_keymaps/dztech_dz60rgb_wkl/keymaps/haunt98/keymap.c
qmk c2json -kb dztech/dz60rgb_wkl/v2_1 \
-km haunt98 \
-o dztech_dz60rgb_wkl_haunt98_keymap.json \
--no-cpp \
haunt98_qmk_keymaps/dztech_dz60rgb_wkl/keymaps/haunt98/keymap.c
- name: Extra
run: |
qmk info -m -l -kb dztech/dz60rgb_wkl/v2_1 -km haunt98

View File

@ -5,8 +5,15 @@ all:
$(MAKE) draw
format:
clang-format -i dztech_dz60rgb_wkl/keymaps/haunt98/*.c dztech_dz60rgb_wkl/keymaps/haunt98/*.h & \
clang-format-mp-15 -i dztech_dz60rgb_wkl/keymaps/haunt98/*.c dztech_dz60rgb_wkl/keymaps/haunt98/*.h
clang-format -i dztech_dz60rgb_wkl/keymaps/haunt98/*.c \
dztech_dz60rgb_wkl/keymaps/haunt98/*.h \
users/haunt98/*.c \
users/haunt98/*.h \
& \
clang-format-mp-15 -i dztech_dz60rgb_wkl/keymaps/haunt98/*.c \
dztech_dz60rgb_wkl/keymaps/haunt98/*.h \
users/haunt98/*.c \
users/haunt98/*.h
deno fmt dztech_dz60rgb_wkl/keymaps_json/haunt98/keymap.json
# From changeloguru

View File

@ -3,27 +3,6 @@
#pragma once
// https://github.com/qmk/qmk_firmware/blob/master/docs/config_options.md
// Optimize
// https://github.com/qmk/qmk_firmware/blob/master/docs/squeezing_avr.md
#define NO_ACTION_ONESHOT
#define LAYER_STATE_8BIT
// Feature
// https://github.com/qmk/qmk_firmware/blob/master/docs/tap_hold.md
#define TAPPING_TERM 200
#define QUICK_TAP_TERM 120
#define HOLD_ON_OTHER_KEY_PRESS
#define RETRO_TAPPING
// https://github.com/qmk/qmk_firmware/blob/master/docs/feature_debounce_type.md
#ifdef DEBOUNCE
# undef DEBOUNCE
#endif
#define DEBOUNCE 5
// https://github.com/qmk/qmk_firmware/blob/master/docs/feature_rgb_matrix.md
// https://www.youtube.com/watch?v=7f3usatOIKM
#ifdef RGB_MATRIX_ENABLE
@ -59,9 +38,3 @@
# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200
# define RGB_MATRIX_DEFAULT_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS
#endif
// https://github.com/qmk/qmk_firmware/blob/master/docs/config_options.md
// https://github.com/qmk/qmk_firmware/issues/17316
#define USB_SUSPEND_WAKEUP_DELAY 200
#define FORCE_NKRO

View File

@ -2,21 +2,7 @@
// SPDX-License-Identifier: MIT
#include QMK_KEYBOARD_H
// https://github.com/qmk/qmk_firmware/blob/master/docs/feature_tap_dance.md
enum custom_tap_dance {
TD_SAFE_BOOT,
};
void tap_dance_safe_boot(tap_dance_state_t* state, void* user_data) {
if (state->count >= 3) {
reset_keyboard();
}
}
tap_dance_action_t tap_dance_actions[] = {
[TD_SAFE_BOOT] = ACTION_TAP_DANCE_FN(tap_dance_safe_boot),
};
#include "haunt98.h"
enum layers {
LAYER_QWERTY,

31
users/haunt98/config.h Normal file
View File

@ -0,0 +1,31 @@
// Copyright 2023 haunt98 <hauvipapro@gmail.com>
// SPDX-License-Identifier: MIT
#pragma once
// https://github.com/qmk/qmk_firmware/blob/master/docs/config_options.md
// Optimize
// https://github.com/qmk/qmk_firmware/blob/master/docs/squeezing_avr.md
#define NO_ACTION_ONESHOT
#define LAYER_STATE_8BIT
// Feature
// https://github.com/qmk/qmk_firmware/blob/master/docs/tap_hold.md
#define TAPPING_TERM 200
#define QUICK_TAP_TERM 120
#define HOLD_ON_OTHER_KEY_PRESS
#define RETRO_TAPPING
// https://github.com/qmk/qmk_firmware/blob/master/docs/feature_debounce_type.md
#ifdef DEBOUNCE
# undef DEBOUNCE
#endif
#define DEBOUNCE 5
// https://github.com/qmk/qmk_firmware/blob/master/docs/config_options.md
// https://github.com/qmk/qmk_firmware/issues/17316
#define USB_SUSPEND_WAKEUP_DELAY 200
#define FORCE_NKRO

6
users/haunt98/haunt98.c Normal file
View File

@ -0,0 +1,6 @@
// Copyright 2023 haunt98 <hauvipapro@gmail.com>
// SPDX-License-Identifier: MIT
#include "haunt98.h"
// Placebo for the future me

9
users/haunt98/haunt98.h Normal file
View File

@ -0,0 +1,9 @@
// Copyright 2023 haunt98 <hauvipapro@gmail.com>
// SPDX-License-Identifier: MIT
#pragma once
// https://github.com/qmk/qmk_firmware/blob/master/docs/feature_userspace.md
#include QMK_KEYBOARD_H
#include "tap_dance.h"

View File

@ -1,9 +1,5 @@
# https://github.com/qmk/qmk_firmware/blob/master/docs/config_options.md
# VIA
# https://www.caniusevia.com/docs/configuring_qmk
VIA_ENABLE = no
# Optimize
# https://github.com/qmk/qmk_firmware/blob/master/docs/squeezing_avr.md
LTO_ENABLE = yes
@ -13,16 +9,20 @@ COMMAND_ENABLE = no
MOUSEKEY_ENABLE = no
EXTRAKEY_ENABLE = yes
MAGIC_ENABLE = no
# Feature
# https://github.com/qmk/qmk_firmware/blob/master/docs/feature_bootmagic.md
MAGIC_ENABLE = no
BOOTMAGIC_ENABLE = yes
# https://github.com/qmk/qmk_firmware/blob/master/docs/feature_debounce_type.md
DEBOUNCE_TYPE = sym_eager_pk
# https://github.com/qmk/qmk_firmware/blob/master/docs/feature_tap_dance.md
TAP_DANCE_ENABLE = yes
# Feature
# https://github.com/qmk/qmk_firmware/blob/master/docs/feature_debounce_type.md
DEBOUNCE_TYPE = sym_eager_pk
NKRO_ENABLE = yes
# Custom C
SRC += haunt98.c
SRC += tap_dance.c

14
users/haunt98/tap_dance.c Normal file
View File

@ -0,0 +1,14 @@
// Copyright 2023 haunt98 <hauvipapro@gmail.com>
// SPDX-License-Identifier: MIT
#include "tap_dance.h"
void tap_dance_safe_boot(tap_dance_state_t* state, void* user_data) {
if (state->count >= 3) {
reset_keyboard();
}
}
tap_dance_action_t tap_dance_actions[] = {
[TD_SAFE_BOOT] = ACTION_TAP_DANCE_FN(tap_dance_safe_boot),
};

11
users/haunt98/tap_dance.h Normal file
View File

@ -0,0 +1,11 @@
// Copyright 2023 haunt98 <hauvipapro@gmail.com>
// SPDX-License-Identifier: MIT
#pragma once
#include QMK_KEYBOARD_H
// https://github.com/qmk/qmk_firmware/blob/master/docs/feature_tap_dance.md
enum custom_tap_dance {
TD_SAFE_BOOT,
};