mirror of
https://github.com/qmk/qmk_userspace.git
synced 2025-05-04 06:34:17 -04:00
Merge branch 'develop'
This commit is contained in:
commit
7671c90f21
187 changed files with 1009 additions and 2196 deletions
|
@ -1,17 +1,23 @@
|
|||
/* Copyright 2021 Kyle McCreery
|
||||
*
|
||||
* 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/>.
|
||||
/**
|
||||
* Copyright 2021 Charly Delay <charly@codesink.dev> (@0xcharly)
|
||||
* Copyright 2023 casuanoob <casuanoob@hotmail.com> (@casuanoob)
|
||||
*
|
||||
* 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
|
||||
|
||||
#define DYNAMIC_KEYMAP_LAYER_COUNT 8
|
||||
|
||||
#define SPLIT_LAYER_STATE_ENABLE
|
||||
#define SPLIT_LED_STATE_ENABLE
|
170
keyboards/bastardkb/dilemma/3x5_3/keymaps/via/keymap.c
Normal file
170
keyboards/bastardkb/dilemma/3x5_3/keymaps/via/keymap.c
Normal file
|
@ -0,0 +1,170 @@
|
|||
/**
|
||||
* Copyright 2022 Charly Delay <charly@codesink.dev> (@0xcharly)
|
||||
* Copyright 2023 casuanoob <casuanoob@hotmail.com> (@casuanoob)
|
||||
*
|
||||
* 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
|
||||
|
||||
enum dilemma_keymap_layers {
|
||||
LAYER_BASE = 0,
|
||||
LAYER_FUNCTION,
|
||||
LAYER_NAVIGATION,
|
||||
LAYER_MEDIA,
|
||||
LAYER_POINTER,
|
||||
LAYER_NUMERAL,
|
||||
LAYER_SYMBOLS,
|
||||
};
|
||||
|
||||
// Automatically enable sniping-mode on the pointer layer.
|
||||
// #define DILEMMA_AUTO_SNIPING_ON_LAYER LAYER_POINTER
|
||||
|
||||
#define ESC_MED LT(LAYER_MEDIA, KC_ESC)
|
||||
#define SPC_NAV LT(LAYER_NAVIGATION, KC_SPC)
|
||||
#define TAB_FUN LT(LAYER_FUNCTION, KC_TAB)
|
||||
#define ENT_SYM LT(LAYER_SYMBOLS, KC_ENT)
|
||||
#define BSP_NUM LT(LAYER_NUMERAL, KC_BSPC)
|
||||
#define PT_Z LT(LAYER_POINTER, KC_Z)
|
||||
#define PT_SLSH LT(LAYER_POINTER, KC_SLSH)
|
||||
|
||||
#ifndef POINTING_DEVICE_ENABLE
|
||||
# define DRGSCRL KC_NO
|
||||
# define DPI_MOD KC_NO
|
||||
# define S_D_MOD KC_NO
|
||||
# define SNIPING KC_NO
|
||||
#endif // !POINTING_DEVICE_ENABLE
|
||||
|
||||
// clang-format off
|
||||
/** \brief QWERTY layout (3 rows, 10 columns). */
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[LAYER_BASE] = LAYOUT_split_3x5_3(
|
||||
KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,
|
||||
LGUI_T(KC_A), LALT_T(KC_S), LCTL_T(KC_D), LSFT_T(KC_F), KC_G, KC_H, RSFT_T(KC_J), RCTL_T(KC_K), RALT_T(KC_L), RGUI_T(KC_QUOT),
|
||||
PT_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, PT_SLSH,
|
||||
ESC_MED, TAB_FUN, SPC_NAV, ENT_SYM, BSP_NUM, KC_MUTE
|
||||
),
|
||||
|
||||
/*
|
||||
* Layers used on the Dilemma.
|
||||
*
|
||||
* These layers started off heavily inspired by the Miryoku layout, but trimmed
|
||||
* down and tailored for a stock experience that is meant to be fundation for
|
||||
* further personalization.
|
||||
*
|
||||
* See https://github.com/manna-harbour/miryoku for the original layout.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \brief Function layer.
|
||||
*
|
||||
* Secondary right-hand layer has function keys mirroring the numerals on the
|
||||
* primary layer with extras on the pinkie column, plus system keys on the inner
|
||||
* column. App is on the tertiary thumb key and other thumb keys are duplicated
|
||||
* from the base layer to enable auto-repeat.
|
||||
*/
|
||||
[LAYER_FUNCTION] = LAYOUT_split_3x5_3(
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PSCR, KC_F7, KC_F8, KC_F9, KC_F12,
|
||||
KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, XXXXXXX, KC_SCRL, KC_F4, KC_F5, KC_F6, KC_F11,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PAUS, KC_F1, KC_F2, KC_F3, KC_F10,
|
||||
XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
|
||||
),
|
||||
|
||||
/**
|
||||
* \brief Navigation layer.
|
||||
*
|
||||
* Primary right-hand layer (left home thumb) is navigation and editing. Cursor
|
||||
* keys are on the home position, line and page movement below, clipboard above,
|
||||
* caps lock and insert on the inner column. Thumb keys are duplicated from the
|
||||
* base layer to avoid having to layer change mid edit and to enable auto-repeat.
|
||||
*/
|
||||
[LAYER_NAVIGATION] = LAYOUT_split_3x5_3(
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, XXXXXXX, KC_CAPS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_INS, KC_HOME, KC_PGDN, KC_PGUP, KC_END,
|
||||
XXXXXXX, XXXXXXX, _______, KC_ENT, KC_BSPC, KC_DEL
|
||||
),
|
||||
|
||||
/**
|
||||
* \brief Media layer.
|
||||
*
|
||||
* Tertiary left- and right-hand layer is media and RGB control. This layer is
|
||||
* symmetrical to accomodate the left- and right-hand trackball.
|
||||
*/
|
||||
[LAYER_MEDIA] = LAYOUT_split_3x5_3(
|
||||
XXXXXXX,RGB_RMOD, RGB_TOG, RGB_MOD, XXXXXXX, XXXXXXX,RGB_RMOD, RGB_TOG, RGB_MOD, XXXXXXX,
|
||||
KC_MPRV, KC_VOLD, KC_MUTE, KC_VOLU, KC_MNXT, KC_MPRV, KC_VOLD, KC_MUTE, KC_VOLU, KC_MNXT,
|
||||
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
_______, KC_MPLY, KC_MSTP, KC_MSTP, KC_MPLY, KC_MUTE
|
||||
),
|
||||
|
||||
/** \brief Mouse emulation and pointer functions. */
|
||||
[LAYER_POINTER] = LAYOUT_split_3x5_3(
|
||||
QK_BOOT, EE_CLR, XXXXXXX, DPI_MOD, S_D_MOD, S_D_MOD, DPI_MOD, XXXXXXX, EE_CLR, QK_BOOT,
|
||||
KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, XXXXXXX, XXXXXXX, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI,
|
||||
_______, DRGSCRL, SNIPING, KC_BTN3, XXXXXXX, XXXXXXX, KC_BTN3, SNIPING, DRGSCRL, _______,
|
||||
KC_BTN3, KC_BTN2, KC_BTN1, KC_BTN1, KC_BTN2, KC_BTN3
|
||||
),
|
||||
|
||||
/**
|
||||
* \brief Numeral layout.
|
||||
*
|
||||
* Primary left-hand layer (right home thumb) is numerals and symbols. Numerals
|
||||
* are in the standard numpad locations with symbols in the remaining positions.
|
||||
* `KC_DOT` is duplicated from the base layer.
|
||||
*/
|
||||
[LAYER_NUMERAL] = LAYOUT_split_3x5_3(
|
||||
KC_LBRC, KC_7, KC_8, KC_9, KC_RBRC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
KC_SCLN, KC_4, KC_5, KC_6, KC_EQL, XXXXXXX, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI,
|
||||
KC_DOT, KC_1, KC_2, KC_3, KC_BSLS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
KC_DOT, KC_MINS, KC_0, XXXXXXX, _______, XXXXXXX
|
||||
),
|
||||
|
||||
/**
|
||||
* \brief Symbols layer.
|
||||
*
|
||||
* Secondary left-hand layer has shifted symbols in the same locations to reduce
|
||||
* chording when using mods with shifted symbols. `KC_LPRN` is duplicated next to
|
||||
* `KC_RPRN`.
|
||||
*/
|
||||
[LAYER_SYMBOLS] = LAYOUT_split_3x5_3(
|
||||
KC_LCBR, KC_AMPR, KC_ASTR, KC_LPRN, KC_RCBR, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
KC_COLN, KC_DLR, KC_PERC, KC_CIRC, KC_PLUS, XXXXXXX, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI,
|
||||
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_PIPE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
|
||||
KC_LPRN, KC_GRV, KC_UNDS, _______, XXXXXXX, XXXXXXX
|
||||
),
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
#ifdef POINTING_DEVICE_ENABLE
|
||||
# ifdef DILEMMA_AUTO_SNIPING_ON_LAYER
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
dilemma_set_pointer_sniping_enabled(layer_state_cmp(state, DILEMMA_AUTO_SNIPING_ON_LAYER));
|
||||
return state;
|
||||
}
|
||||
# endif // DILEMMA_AUTO_SNIPING_ON_LAYER
|
||||
#endif // POINTING_DEVICE_ENABLE
|
||||
|
||||
#ifdef ENCODER_MAP_ENABLE
|
||||
// clang-format off
|
||||
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
|
||||
[LAYER_BASE] = {ENCODER_CCW_CW(KC_WH_D, KC_WH_U), ENCODER_CCW_CW(KC_VOLD, KC_VOLU)},
|
||||
[LAYER_FUNCTION] = {ENCODER_CCW_CW(KC_DOWN, KC_UP), ENCODER_CCW_CW(KC_LEFT, KC_RGHT)},
|
||||
[LAYER_NAVIGATION] = {ENCODER_CCW_CW(KC_PGDN, KC_PGUP), ENCODER_CCW_CW(KC_VOLU, KC_VOLD)},
|
||||
[LAYER_POINTER] = {ENCODER_CCW_CW(RGB_HUD, RGB_HUI), ENCODER_CCW_CW(RGB_SAD, RGB_SAI)},
|
||||
[LAYER_NUMERAL] = {ENCODER_CCW_CW(RGB_VAD, RGB_VAI), ENCODER_CCW_CW(RGB_SPD, RGB_SPI)},
|
||||
[LAYER_SYMBOLS] = {ENCODER_CCW_CW(RGB_RMOD, RGB_MOD), ENCODER_CCW_CW(KC_LEFT, KC_RGHT)},
|
||||
};
|
||||
// clang-format on
|
||||
#endif // ENCODER_MAP_ENABLE
|
47
keyboards/bastardkb/dilemma/3x5_3/keymaps/via/readme.md
Normal file
47
keyboards/bastardkb/dilemma/3x5_3/keymaps/via/readme.md
Normal file
|
@ -0,0 +1,47 @@
|
|||
# Dilemma `via` keymap
|
||||
|
||||
The Dilemma `via` keymap is based on a QWERTY layout with [home row mods](https://precondition.github.io/home-row-mods) and [Miryoku-inspired layers](https://github.com/manna-harbour/miryoku), and some features and changes specific to the Dilemma.
|
||||
|
||||
This layout also supports VIA.
|
||||
|
||||
## Customizing the keymap
|
||||
|
||||
### Dynamic DPI scaling
|
||||
|
||||
Use the following keycodes to change the default DPI:
|
||||
|
||||
- `POINTER_DEFAULT_DPI_FORWARD`: increases the DPI; decreases when shifted;
|
||||
- `POINTER_DEFAULT_DPI_REVERSE`: decreases the DPI; increases when shifted.
|
||||
|
||||
There's a maximum of 16 possible values for the sniping mode DPI. See the [Dilemma documentation](../../README.md) for more information.
|
||||
|
||||
Use the following keycodes to change the sniping mode DPI:
|
||||
|
||||
- `POINTER_SNIPING_DPI_FORWARD`: increases the DPI; decreases when shifted;
|
||||
- `POINTER_SNIPING_DPI_REVERSE`: decreases the DPI; increases when shifted.
|
||||
|
||||
There's a maximum of 4 possible values for the sniping mode DPI. See the [Dilemma documentation](../../README.md) for more information.
|
||||
|
||||
### Drag-scroll
|
||||
|
||||
Use the `DRAGSCROLL_MODE` keycode to enable drag-scroll on hold. Use the `DRAGSCROLL_TOGGLE` keycode to enable/disable drag-scroll on key press.
|
||||
|
||||
### Circular scroll
|
||||
|
||||
By default, the firmware is configured to enable the circular scroll feature on Cirque trackpad.
|
||||
|
||||
To disable this, add the following to your keymap:
|
||||
|
||||
```c
|
||||
#undef POINTING_DEVICE_GESTURES_SCROLL_ENABLE
|
||||
```
|
||||
|
||||
### Sniping
|
||||
|
||||
Use the `SNIPING_MODE` keycode to enable sniping mode on hold. Use the `SNIPING_TOGGLE` keycode to enable/disable sniping mode on key press.
|
||||
|
||||
Change the value of `DILEMMA_AUTO_SNIPING_ON_LAYER` to automatically enable sniping mode on layer change. By default, sniping mode is enabled on the pointer layer:
|
||||
|
||||
```c
|
||||
#define DILEMMA_AUTO_SNIPING_ON_LAYER LAYER_POINTER
|
||||
```
|
|
@ -16,5 +16,5 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#define DISABLE_RGB_MATRIX_PIXEL_FLOW
|
||||
#undef ENABLE_RGB_MATRIX_PIXEL_FLOW
|
||||
#define DYNAMIC_KEYMAP_LAYER_COUNT 5
|
||||
|
|
|
@ -1,19 +1,5 @@
|
|||
/*
|
||||
Copyright 2012,2013 Jun Wako <wakojun@gmail.com>
|
||||
|
||||
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/>.
|
||||
*/
|
||||
// Copyright 2023 Andrew Kannan (@awkannan)
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
// Copyright 2023 Andrew Kannan (@awkannan)
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
#include "satisfaction_keycodes.h"
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = LAYOUT_all(
|
||||
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_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_DEL, ENC_PRESS,
|
||||
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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENTER, KC_PGUP,
|
||||
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_RSFT, KC_UP, KC_PGDN,
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
|
||||
),
|
||||
[1] = LAYOUT_all(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, OLED_TOGG,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, CLOCK_SET,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
)
|
||||
};
|
23
keyboards/cannonkeys/satisfaction75_hs/keymaps/via/keymap.c
Normal file
23
keyboards/cannonkeys/satisfaction75_hs/keymaps/via/keymap.c
Normal file
|
@ -0,0 +1,23 @@
|
|||
// Copyright 2023 Andrew Kannan (@awkannan)
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = LAYOUT_all(
|
||||
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, ENC_PRESS,
|
||||
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_DEL,
|
||||
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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENTER, KC_PGUP,
|
||||
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_PGDN,
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
|
||||
),
|
||||
[1] = LAYOUT_all(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, OLED_TOGG,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, CLOCK_SET,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
)
|
||||
};
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
|
@ -16,5 +16,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
// This is the firmware version for VIA support to avoid conflicts on menu fetching
|
||||
#define VIA_FIRMWARE_VERSION 1
|
||||
// This is the size of the EEPROM for the custom VIA-specific data
|
||||
#define EECONFIG_USER_DATA_SIZE 4
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
|
@ -28,27 +28,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
|
||||
[1] = LAYOUT_all(
|
||||
RGB_TOG, RGB_VAD, RGB_VAI, _______,
|
||||
_______, _______, _______, NK_TOGG,
|
||||
_______, _______, _______, _______,
|
||||
_______, _______, _______, _______,
|
||||
_______, _______, _______, _______,
|
||||
_______, _______, _______, _______,
|
||||
_______, _______, QK_BOOT, _______),
|
||||
|
||||
|
||||
[2] = LAYOUT_all(
|
||||
_______, _______, _______, _______,
|
||||
_______, _______, _______, _______,
|
||||
_______, _______, _______, _______,
|
||||
_______, _______, _______, _______,
|
||||
_______, _______, _______, _______,
|
||||
_______, _______, _______, _______),
|
||||
|
||||
[3] = LAYOUT_all(
|
||||
_______, _______, _______, _______,
|
||||
_______, _______, _______, _______,
|
||||
_______, _______, _______, _______,
|
||||
_______, _______, _______, _______,
|
||||
_______, _______, _______, _______,
|
||||
_______, _______, _______, _______)
|
||||
_______, _______, QK_BOOT, _______)
|
||||
// clang-format on
|
||||
};
|
||||
|
|
|
@ -1,3 +1 @@
|
|||
VIA_ENABLE = yes
|
||||
|
||||
SRC += via_apc.c
|
||||
|
|
|
@ -1,156 +0,0 @@
|
|||
/* Copyright 2023 Cipulot
|
||||
*
|
||||
* 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 "ec_switch_matrix.h"
|
||||
#include "action.h"
|
||||
#include "via.h"
|
||||
|
||||
void apc_init_thresholds(void);
|
||||
void apc_set_threshold(bool is_for_actuation);
|
||||
|
||||
// Declaring an _apc_config_t struct that will store our data
|
||||
typedef struct _apc_config_t {
|
||||
uint16_t actuation_threshold;
|
||||
uint16_t release_threshold;
|
||||
} apc_config;
|
||||
|
||||
// Check if the size of the reserved persistent memory is the same as the size of struct apc_config
|
||||
_Static_assert(sizeof(apc_config) == EECONFIG_USER_DATA_SIZE, "Mismatch in keyboard EECONFIG stored data");
|
||||
|
||||
// Declaring a new variable apc of type apc_config
|
||||
apc_config apc;
|
||||
|
||||
// Declaring enums for VIA config menu
|
||||
enum via_apc_enums {
|
||||
// clang-format off
|
||||
id_apc_actuation_threshold = 1,
|
||||
id_apc_release_threshold = 2
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
// Initializing persistent memory configuration: default values are declared and stored in PMEM
|
||||
void eeconfig_init_user(void) {
|
||||
// Default values
|
||||
apc.actuation_threshold = DEFAULT_ACTUATION_LEVEL;
|
||||
apc.release_threshold = DEFAULT_RELEASE_LEVEL;
|
||||
// Write default value to EEPROM now
|
||||
eeconfig_update_user_datablock(&apc);
|
||||
}
|
||||
|
||||
// On Keyboard startup
|
||||
void keyboard_post_init_user(void) {
|
||||
// Read custom menu variables from memory
|
||||
eeconfig_read_user_datablock(&apc);
|
||||
apc_init_thresholds();
|
||||
}
|
||||
|
||||
// Handle the data received by the keyboard from the VIA menus
|
||||
void apc_config_set_value(uint8_t *data) {
|
||||
// data = [ value_id, value_data ]
|
||||
uint8_t *value_id = &(data[0]);
|
||||
uint8_t *value_data = &(data[1]);
|
||||
|
||||
switch (*value_id) {
|
||||
case id_apc_actuation_threshold: {
|
||||
apc.actuation_threshold = value_data[1] | (value_data[0] << 8);
|
||||
apc_set_threshold(true);
|
||||
break;
|
||||
}
|
||||
case id_apc_release_threshold: {
|
||||
apc.release_threshold = value_data[1] | (value_data[0] << 8);
|
||||
apc_set_threshold(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Handle the data sent by the keyboard to the VIA menus
|
||||
void apc_config_get_value(uint8_t *data) {
|
||||
// data = [ value_id, value_data ]
|
||||
uint8_t *value_id = &(data[0]);
|
||||
uint8_t *value_data = &(data[1]);
|
||||
|
||||
switch (*value_id) {
|
||||
case id_apc_actuation_threshold: {
|
||||
value_data[0] = apc.actuation_threshold >> 8;
|
||||
value_data[1] = apc.actuation_threshold & 0xFF;
|
||||
break;
|
||||
}
|
||||
case id_apc_release_threshold: {
|
||||
value_data[0] = apc.release_threshold >> 8;
|
||||
value_data[1] = apc.release_threshold & 0xFF;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Save the data to persistent memory after changes are made
|
||||
void apc_config_save(void) {
|
||||
eeconfig_update_user_datablock(&apc);
|
||||
}
|
||||
|
||||
void via_custom_value_command_kb(uint8_t *data, uint8_t length) {
|
||||
// data = [ command_id, channel_id, value_id, value_data ]
|
||||
uint8_t *command_id = &(data[0]);
|
||||
uint8_t *channel_id = &(data[1]);
|
||||
uint8_t *value_id_and_data = &(data[2]);
|
||||
|
||||
if (*channel_id == id_custom_channel) {
|
||||
switch (*command_id) {
|
||||
case id_custom_set_value: {
|
||||
apc_config_set_value(value_id_and_data);
|
||||
break;
|
||||
}
|
||||
case id_custom_get_value: {
|
||||
apc_config_get_value(value_id_and_data);
|
||||
break;
|
||||
}
|
||||
case id_custom_save: {
|
||||
apc_config_save();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
// Unhandled message.
|
||||
*command_id = id_unhandled;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
*command_id = id_unhandled;
|
||||
}
|
||||
|
||||
// Initialize the thresholds
|
||||
void apc_init_thresholds(void) {
|
||||
ecsm_config.ecsm_actuation_threshold = apc.actuation_threshold;
|
||||
ecsm_config.ecsm_release_threshold = apc.release_threshold;
|
||||
|
||||
// Update the ecsm_config
|
||||
ecsm_update(&ecsm_config);
|
||||
}
|
||||
|
||||
// Set the thresholds
|
||||
void apc_set_threshold(bool is_for_actuation) {
|
||||
if (is_for_actuation) {
|
||||
ecsm_config.ecsm_actuation_threshold = apc.actuation_threshold;
|
||||
|
||||
} else {
|
||||
ecsm_config.ecsm_release_threshold = apc.release_threshold;
|
||||
}
|
||||
// Update the ecsm_config
|
||||
ecsm_update(&ecsm_config);
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
|
@ -16,5 +16,5 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
// This is the size of the EEPROM for the custom VIA-specific data
|
||||
#define EECONFIG_USER_DATA_SIZE 4
|
||||
// This is the firmware version for VIA support to avoid conflicts on menu fetching
|
||||
#define VIA_FIRMWARE_VERSION 1
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
|
@ -34,14 +34,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
|
||||
|
||||
[2] = LAYOUT_all(
|
||||
QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
|
||||
|
||||
[3] = LAYOUT_all(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
QK_BOOT, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
|
|
|
@ -1,3 +1 @@
|
|||
VIA_ENABLE = yes
|
||||
|
||||
SRC += via_apc.c
|
||||
|
|
|
@ -1,156 +0,0 @@
|
|||
/* Copyright 2023 Cipulot
|
||||
*
|
||||
* 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 "ec_switch_matrix.h"
|
||||
#include "action.h"
|
||||
#include "via.h"
|
||||
|
||||
void apc_init_thresholds(void);
|
||||
void apc_set_threshold(bool is_for_actuation);
|
||||
|
||||
// Declaring an _apc_config_t struct that will store our data
|
||||
typedef struct _apc_config_t {
|
||||
uint16_t actuation_threshold;
|
||||
uint16_t release_threshold;
|
||||
} apc_config;
|
||||
|
||||
// Check if the size of the reserved persistent memory is the same as the size of struct apc_config
|
||||
_Static_assert(sizeof(apc_config) == EECONFIG_USER_DATA_SIZE, "Mismatch in keyboard EECONFIG stored data");
|
||||
|
||||
// Declaring a new variable apc of type apc_config
|
||||
apc_config apc;
|
||||
|
||||
// Declaring enums for VIA config menu
|
||||
enum via_apc_enums {
|
||||
// clang-format off
|
||||
id_apc_actuation_threshold = 1,
|
||||
id_apc_release_threshold = 2
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
// Initializing persistent memory configuration: default values are declared and stored in PMEM
|
||||
void eeconfig_init_user(void) {
|
||||
// Default values
|
||||
apc.actuation_threshold = DEFAULT_ACTUATION_LEVEL;
|
||||
apc.release_threshold = DEFAULT_RELEASE_LEVEL;
|
||||
// Write default value to EEPROM now
|
||||
eeconfig_update_user_datablock(&apc);
|
||||
}
|
||||
|
||||
// On Keyboard startup
|
||||
void keyboard_post_init_user(void) {
|
||||
// Read custom menu variables from memory
|
||||
eeconfig_read_user_datablock(&apc);
|
||||
apc_init_thresholds();
|
||||
}
|
||||
|
||||
// Handle the data received by the keyboard from the VIA menus
|
||||
void apc_config_set_value(uint8_t *data) {
|
||||
// data = [ value_id, value_data ]
|
||||
uint8_t *value_id = &(data[0]);
|
||||
uint8_t *value_data = &(data[1]);
|
||||
|
||||
switch (*value_id) {
|
||||
case id_apc_actuation_threshold: {
|
||||
apc.actuation_threshold = value_data[1] | (value_data[0] << 8);
|
||||
apc_set_threshold(true);
|
||||
break;
|
||||
}
|
||||
case id_apc_release_threshold: {
|
||||
apc.release_threshold = value_data[1] | (value_data[0] << 8);
|
||||
apc_set_threshold(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Handle the data sent by the keyboard to the VIA menus
|
||||
void apc_config_get_value(uint8_t *data) {
|
||||
// data = [ value_id, value_data ]
|
||||
uint8_t *value_id = &(data[0]);
|
||||
uint8_t *value_data = &(data[1]);
|
||||
|
||||
switch (*value_id) {
|
||||
case id_apc_actuation_threshold: {
|
||||
value_data[0] = apc.actuation_threshold >> 8;
|
||||
value_data[1] = apc.actuation_threshold & 0xFF;
|
||||
break;
|
||||
}
|
||||
case id_apc_release_threshold: {
|
||||
value_data[0] = apc.release_threshold >> 8;
|
||||
value_data[1] = apc.release_threshold & 0xFF;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Save the data to persistent memory after changes are made
|
||||
void apc_config_save(void) {
|
||||
eeconfig_update_user_datablock(&apc);
|
||||
}
|
||||
|
||||
void via_custom_value_command_kb(uint8_t *data, uint8_t length) {
|
||||
// data = [ command_id, channel_id, value_id, value_data ]
|
||||
uint8_t *command_id = &(data[0]);
|
||||
uint8_t *channel_id = &(data[1]);
|
||||
uint8_t *value_id_and_data = &(data[2]);
|
||||
|
||||
if (*channel_id == id_custom_channel) {
|
||||
switch (*command_id) {
|
||||
case id_custom_set_value: {
|
||||
apc_config_set_value(value_id_and_data);
|
||||
break;
|
||||
}
|
||||
case id_custom_get_value: {
|
||||
apc_config_get_value(value_id_and_data);
|
||||
break;
|
||||
}
|
||||
case id_custom_save: {
|
||||
apc_config_save();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
// Unhandled message.
|
||||
*command_id = id_unhandled;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
*command_id = id_unhandled;
|
||||
}
|
||||
|
||||
// Initialize the thresholds
|
||||
void apc_init_thresholds(void) {
|
||||
ecsm_config.ecsm_actuation_threshold = apc.actuation_threshold;
|
||||
ecsm_config.ecsm_release_threshold = apc.release_threshold;
|
||||
|
||||
// Update the ecsm_config
|
||||
ecsm_update(&ecsm_config);
|
||||
}
|
||||
|
||||
// Set the thresholds
|
||||
void apc_set_threshold(bool is_for_actuation) {
|
||||
if (is_for_actuation) {
|
||||
ecsm_config.ecsm_actuation_threshold = apc.actuation_threshold;
|
||||
|
||||
} else {
|
||||
ecsm_config.ecsm_release_threshold = apc.release_threshold;
|
||||
}
|
||||
// Update the ecsm_config
|
||||
ecsm_update(&ecsm_config);
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
|
@ -16,5 +16,5 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
// This is the size of the EEPROM for the custom VIA-specific data
|
||||
#define EECONFIG_USER_DATA_SIZE 4
|
||||
// This is the firmware version for VIA support to avoid conflicts on menu fetching
|
||||
#define VIA_FIRMWARE_VERSION 1
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
|
@ -33,14 +33,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
|
||||
|
||||
[2] = LAYOUT_all(
|
||||
QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
|
||||
|
||||
[3] = LAYOUT_all(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
QK_BOOT, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
|
|
|
@ -1,3 +1 @@
|
|||
VIA_ENABLE = yes
|
||||
|
||||
SRC += via_apc.c
|
||||
|
|
|
@ -1,156 +0,0 @@
|
|||
/* Copyright 2023 Cipulot
|
||||
*
|
||||
* 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 "ec_switch_matrix.h"
|
||||
#include "action.h"
|
||||
#include "via.h"
|
||||
|
||||
void apc_init_thresholds(void);
|
||||
void apc_set_threshold(bool is_for_actuation);
|
||||
|
||||
// Declaring an _apc_config_t struct that will store our data
|
||||
typedef struct _apc_config_t {
|
||||
uint16_t actuation_threshold;
|
||||
uint16_t release_threshold;
|
||||
} apc_config;
|
||||
|
||||
// Check if the size of the reserved persistent memory is the same as the size of struct apc_config
|
||||
_Static_assert(sizeof(apc_config) == EECONFIG_USER_DATA_SIZE, "Mismatch in keyboard EECONFIG stored data");
|
||||
|
||||
// Declaring a new variable apc of type apc_config
|
||||
apc_config apc;
|
||||
|
||||
// Declaring enums for VIA config menu
|
||||
enum via_apc_enums {
|
||||
// clang-format off
|
||||
id_apc_actuation_threshold = 1,
|
||||
id_apc_release_threshold = 2
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
// Initializing persistent memory configuration: default values are declared and stored in PMEM
|
||||
void eeconfig_init_user(void) {
|
||||
// Default values
|
||||
apc.actuation_threshold = DEFAULT_ACTUATION_LEVEL;
|
||||
apc.release_threshold = DEFAULT_RELEASE_LEVEL;
|
||||
// Write default value to EEPROM now
|
||||
eeconfig_update_user_datablock(&apc);
|
||||
}
|
||||
|
||||
// On Keyboard startup
|
||||
void keyboard_post_init_user(void) {
|
||||
// Read custom menu variables from memory
|
||||
eeconfig_read_user_datablock(&apc);
|
||||
apc_init_thresholds();
|
||||
}
|
||||
|
||||
// Handle the data received by the keyboard from the VIA menus
|
||||
void apc_config_set_value(uint8_t *data) {
|
||||
// data = [ value_id, value_data ]
|
||||
uint8_t *value_id = &(data[0]);
|
||||
uint8_t *value_data = &(data[1]);
|
||||
|
||||
switch (*value_id) {
|
||||
case id_apc_actuation_threshold: {
|
||||
apc.actuation_threshold = value_data[1] | (value_data[0] << 8);
|
||||
apc_set_threshold(true);
|
||||
break;
|
||||
}
|
||||
case id_apc_release_threshold: {
|
||||
apc.release_threshold = value_data[1] | (value_data[0] << 8);
|
||||
apc_set_threshold(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Handle the data sent by the keyboard to the VIA menus
|
||||
void apc_config_get_value(uint8_t *data) {
|
||||
// data = [ value_id, value_data ]
|
||||
uint8_t *value_id = &(data[0]);
|
||||
uint8_t *value_data = &(data[1]);
|
||||
|
||||
switch (*value_id) {
|
||||
case id_apc_actuation_threshold: {
|
||||
value_data[0] = apc.actuation_threshold >> 8;
|
||||
value_data[1] = apc.actuation_threshold & 0xFF;
|
||||
break;
|
||||
}
|
||||
case id_apc_release_threshold: {
|
||||
value_data[0] = apc.release_threshold >> 8;
|
||||
value_data[1] = apc.release_threshold & 0xFF;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Save the data to persistent memory after changes are made
|
||||
void apc_config_save(void) {
|
||||
eeconfig_update_user_datablock(&apc);
|
||||
}
|
||||
|
||||
void via_custom_value_command_kb(uint8_t *data, uint8_t length) {
|
||||
// data = [ command_id, channel_id, value_id, value_data ]
|
||||
uint8_t *command_id = &(data[0]);
|
||||
uint8_t *channel_id = &(data[1]);
|
||||
uint8_t *value_id_and_data = &(data[2]);
|
||||
|
||||
if (*channel_id == id_custom_channel) {
|
||||
switch (*command_id) {
|
||||
case id_custom_set_value: {
|
||||
apc_config_set_value(value_id_and_data);
|
||||
break;
|
||||
}
|
||||
case id_custom_get_value: {
|
||||
apc_config_get_value(value_id_and_data);
|
||||
break;
|
||||
}
|
||||
case id_custom_save: {
|
||||
apc_config_save();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
// Unhandled message.
|
||||
*command_id = id_unhandled;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
*command_id = id_unhandled;
|
||||
}
|
||||
|
||||
// Initialize the thresholds
|
||||
void apc_init_thresholds(void) {
|
||||
ecsm_config.ecsm_actuation_threshold = apc.actuation_threshold;
|
||||
ecsm_config.ecsm_release_threshold = apc.release_threshold;
|
||||
|
||||
// Update the ecsm_config
|
||||
ecsm_update(&ecsm_config);
|
||||
}
|
||||
|
||||
// Set the thresholds
|
||||
void apc_set_threshold(bool is_for_actuation) {
|
||||
if (is_for_actuation) {
|
||||
ecsm_config.ecsm_actuation_threshold = apc.actuation_threshold;
|
||||
|
||||
} else {
|
||||
ecsm_config.ecsm_release_threshold = apc.release_threshold;
|
||||
}
|
||||
// Update the ecsm_config
|
||||
ecsm_update(&ecsm_config);
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
|
@ -16,5 +16,5 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
// This is the size of the EEPROM for the custom VIA-specific data
|
||||
#define EECONFIG_USER_DATA_SIZE 4
|
||||
// This is the firmware version for VIA support to avoid conflicts on menu fetching
|
||||
#define VIA_FIRMWARE_VERSION 1
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
|
@ -33,14 +33,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
|
||||
|
||||
[2] = LAYOUT_all(
|
||||
QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
|
||||
|
||||
[3] = LAYOUT_all(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
QK_BOOT, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
|
|
|
@ -1,3 +1 @@
|
|||
VIA_ENABLE = yes
|
||||
|
||||
SRC += via_apc.c
|
||||
|
|
|
@ -1,156 +0,0 @@
|
|||
/* Copyright 2023 Cipulot
|
||||
*
|
||||
* 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 "ec_switch_matrix.h"
|
||||
#include "action.h"
|
||||
#include "via.h"
|
||||
|
||||
void apc_init_thresholds(void);
|
||||
void apc_set_threshold(bool is_for_actuation);
|
||||
|
||||
// Declaring an _apc_config_t struct that will store our data
|
||||
typedef struct _apc_config_t {
|
||||
uint16_t actuation_threshold;
|
||||
uint16_t release_threshold;
|
||||
} apc_config;
|
||||
|
||||
// Check if the size of the reserved persistent memory is the same as the size of struct apc_config
|
||||
_Static_assert(sizeof(apc_config) == EECONFIG_USER_DATA_SIZE, "Mismatch in keyboard EECONFIG stored data");
|
||||
|
||||
// Declaring a new variable apc of type apc_config
|
||||
apc_config apc;
|
||||
|
||||
// Declaring enums for VIA config menu
|
||||
enum via_apc_enums {
|
||||
// clang-format off
|
||||
id_apc_actuation_threshold = 1,
|
||||
id_apc_release_threshold = 2
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
// Initializing persistent memory configuration: default values are declared and stored in PMEM
|
||||
void eeconfig_init_user(void) {
|
||||
// Default values
|
||||
apc.actuation_threshold = DEFAULT_ACTUATION_LEVEL;
|
||||
apc.release_threshold = DEFAULT_RELEASE_LEVEL;
|
||||
// Write default value to EEPROM now
|
||||
eeconfig_update_user_datablock(&apc);
|
||||
}
|
||||
|
||||
// On Keyboard startup
|
||||
void keyboard_post_init_user(void) {
|
||||
// Read custom menu variables from memory
|
||||
eeconfig_read_user_datablock(&apc);
|
||||
apc_init_thresholds();
|
||||
}
|
||||
|
||||
// Handle the data received by the keyboard from the VIA menus
|
||||
void apc_config_set_value(uint8_t *data) {
|
||||
// data = [ value_id, value_data ]
|
||||
uint8_t *value_id = &(data[0]);
|
||||
uint8_t *value_data = &(data[1]);
|
||||
|
||||
switch (*value_id) {
|
||||
case id_apc_actuation_threshold: {
|
||||
apc.actuation_threshold = value_data[1] | (value_data[0] << 8);
|
||||
apc_set_threshold(true);
|
||||
break;
|
||||
}
|
||||
case id_apc_release_threshold: {
|
||||
apc.release_threshold = value_data[1] | (value_data[0] << 8);
|
||||
apc_set_threshold(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Handle the data sent by the keyboard to the VIA menus
|
||||
void apc_config_get_value(uint8_t *data) {
|
||||
// data = [ value_id, value_data ]
|
||||
uint8_t *value_id = &(data[0]);
|
||||
uint8_t *value_data = &(data[1]);
|
||||
|
||||
switch (*value_id) {
|
||||
case id_apc_actuation_threshold: {
|
||||
value_data[0] = apc.actuation_threshold >> 8;
|
||||
value_data[1] = apc.actuation_threshold & 0xFF;
|
||||
break;
|
||||
}
|
||||
case id_apc_release_threshold: {
|
||||
value_data[0] = apc.release_threshold >> 8;
|
||||
value_data[1] = apc.release_threshold & 0xFF;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Save the data to persistent memory after changes are made
|
||||
void apc_config_save(void) {
|
||||
eeconfig_update_user_datablock(&apc);
|
||||
}
|
||||
|
||||
void via_custom_value_command_kb(uint8_t *data, uint8_t length) {
|
||||
// data = [ command_id, channel_id, value_id, value_data ]
|
||||
uint8_t *command_id = &(data[0]);
|
||||
uint8_t *channel_id = &(data[1]);
|
||||
uint8_t *value_id_and_data = &(data[2]);
|
||||
|
||||
if (*channel_id == id_custom_channel) {
|
||||
switch (*command_id) {
|
||||
case id_custom_set_value: {
|
||||
apc_config_set_value(value_id_and_data);
|
||||
break;
|
||||
}
|
||||
case id_custom_get_value: {
|
||||
apc_config_get_value(value_id_and_data);
|
||||
break;
|
||||
}
|
||||
case id_custom_save: {
|
||||
apc_config_save();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
// Unhandled message.
|
||||
*command_id = id_unhandled;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
*command_id = id_unhandled;
|
||||
}
|
||||
|
||||
// Initialize the thresholds
|
||||
void apc_init_thresholds(void) {
|
||||
ecsm_config.ecsm_actuation_threshold = apc.actuation_threshold;
|
||||
ecsm_config.ecsm_release_threshold = apc.release_threshold;
|
||||
|
||||
// Update the ecsm_config
|
||||
ecsm_update(&ecsm_config);
|
||||
}
|
||||
|
||||
// Set the thresholds
|
||||
void apc_set_threshold(bool is_for_actuation) {
|
||||
if (is_for_actuation) {
|
||||
ecsm_config.ecsm_actuation_threshold = apc.actuation_threshold;
|
||||
|
||||
} else {
|
||||
ecsm_config.ecsm_release_threshold = apc.release_threshold;
|
||||
}
|
||||
// Update the ecsm_config
|
||||
ecsm_update(&ecsm_config);
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
|
@ -16,5 +16,5 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
// This is the size of the EEPROM for the custom VIA-specific data
|
||||
#define EECONFIG_USER_DATA_SIZE 4
|
||||
// This is the firmware version for VIA support to avoid conflicts on menu fetching
|
||||
#define VIA_FIRMWARE_VERSION 1
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
|
@ -23,7 +23,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
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_DEL,
|
||||
KC_LCTL, 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_ENTER,
|
||||
KC_LSFT, KC_BSLS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1),
|
||||
KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI),
|
||||
KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT),
|
||||
|
||||
[1] = LAYOUT_all(
|
||||
_______, 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_INS, KC_DEL,
|
||||
|
@ -33,13 +33,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
_______, _______, _______, _______, MO(2)),
|
||||
|
||||
[2] = LAYOUT_all(
|
||||
RGB_TOG, RGB_VAD, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, QK_BOOT,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______),
|
||||
[3] = LAYOUT_all(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
QK_BOOT, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
|
|
|
@ -1,3 +1 @@
|
|||
VIA_ENABLE = yes
|
||||
|
||||
SRC += via_apc.c
|
||||
|
|
|
@ -1,156 +0,0 @@
|
|||
/* Copyright 2023 Cipulot
|
||||
*
|
||||
* 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 "ec_switch_matrix.h"
|
||||
#include "action.h"
|
||||
#include "via.h"
|
||||
|
||||
void apc_init_thresholds(void);
|
||||
void apc_set_threshold(bool is_for_actuation);
|
||||
|
||||
// Declaring an _apc_config_t struct that will store our data
|
||||
typedef struct _apc_config_t {
|
||||
uint16_t actuation_threshold;
|
||||
uint16_t release_threshold;
|
||||
} apc_config;
|
||||
|
||||
// Check if the size of the reserved persistent memory is the same as the size of struct apc_config
|
||||
_Static_assert(sizeof(apc_config) == EECONFIG_USER_DATA_SIZE, "Mismatch in keyboard EECONFIG stored data");
|
||||
|
||||
// Declaring a new variable apc of type apc_config
|
||||
apc_config apc;
|
||||
|
||||
// Declaring enums for VIA config menu
|
||||
enum via_apc_enums {
|
||||
// clang-format off
|
||||
id_apc_actuation_threshold = 1,
|
||||
id_apc_release_threshold = 2
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
// Initializing persistent memory configuration: default values are declared and stored in PMEM
|
||||
void eeconfig_init_user(void) {
|
||||
// Default values
|
||||
apc.actuation_threshold = DEFAULT_ACTUATION_LEVEL;
|
||||
apc.release_threshold = DEFAULT_RELEASE_LEVEL;
|
||||
// Write default value to EEPROM now
|
||||
eeconfig_update_user_datablock(&apc);
|
||||
}
|
||||
|
||||
// On Keyboard startup
|
||||
void keyboard_post_init_user(void) {
|
||||
// Read custom menu variables from memory
|
||||
eeconfig_read_user_datablock(&apc);
|
||||
apc_init_thresholds();
|
||||
}
|
||||
|
||||
// Handle the data received by the keyboard from the VIA menus
|
||||
void apc_config_set_value(uint8_t *data) {
|
||||
// data = [ value_id, value_data ]
|
||||
uint8_t *value_id = &(data[0]);
|
||||
uint8_t *value_data = &(data[1]);
|
||||
|
||||
switch (*value_id) {
|
||||
case id_apc_actuation_threshold: {
|
||||
apc.actuation_threshold = value_data[1] | (value_data[0] << 8);
|
||||
apc_set_threshold(true);
|
||||
break;
|
||||
}
|
||||
case id_apc_release_threshold: {
|
||||
apc.release_threshold = value_data[1] | (value_data[0] << 8);
|
||||
apc_set_threshold(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Handle the data sent by the keyboard to the VIA menus
|
||||
void apc_config_get_value(uint8_t *data) {
|
||||
// data = [ value_id, value_data ]
|
||||
uint8_t *value_id = &(data[0]);
|
||||
uint8_t *value_data = &(data[1]);
|
||||
|
||||
switch (*value_id) {
|
||||
case id_apc_actuation_threshold: {
|
||||
value_data[0] = apc.actuation_threshold >> 8;
|
||||
value_data[1] = apc.actuation_threshold & 0xFF;
|
||||
break;
|
||||
}
|
||||
case id_apc_release_threshold: {
|
||||
value_data[0] = apc.release_threshold >> 8;
|
||||
value_data[1] = apc.release_threshold & 0xFF;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Save the data to persistent memory after changes are made
|
||||
void apc_config_save(void) {
|
||||
eeconfig_update_user_datablock(&apc);
|
||||
}
|
||||
|
||||
void via_custom_value_command_kb(uint8_t *data, uint8_t length) {
|
||||
// data = [ command_id, channel_id, value_id, value_data ]
|
||||
uint8_t *command_id = &(data[0]);
|
||||
uint8_t *channel_id = &(data[1]);
|
||||
uint8_t *value_id_and_data = &(data[2]);
|
||||
|
||||
if (*channel_id == id_custom_channel) {
|
||||
switch (*command_id) {
|
||||
case id_custom_set_value: {
|
||||
apc_config_set_value(value_id_and_data);
|
||||
break;
|
||||
}
|
||||
case id_custom_get_value: {
|
||||
apc_config_get_value(value_id_and_data);
|
||||
break;
|
||||
}
|
||||
case id_custom_save: {
|
||||
apc_config_save();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
// Unhandled message.
|
||||
*command_id = id_unhandled;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
*command_id = id_unhandled;
|
||||
}
|
||||
|
||||
// Initialize the thresholds
|
||||
void apc_init_thresholds(void) {
|
||||
ecsm_config.ecsm_actuation_threshold = apc.actuation_threshold;
|
||||
ecsm_config.ecsm_release_threshold = apc.release_threshold;
|
||||
|
||||
// Update the ecsm_config
|
||||
ecsm_update(&ecsm_config);
|
||||
}
|
||||
|
||||
// Set the thresholds
|
||||
void apc_set_threshold(bool is_for_actuation) {
|
||||
if (is_for_actuation) {
|
||||
ecsm_config.ecsm_actuation_threshold = apc.actuation_threshold;
|
||||
|
||||
} else {
|
||||
ecsm_config.ecsm_release_threshold = apc.release_threshold;
|
||||
}
|
||||
// Update the ecsm_config
|
||||
ecsm_update(&ecsm_config);
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
|
@ -16,5 +16,5 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
// This is the size of the EEPROM for the custom VIA-specific data
|
||||
#define EECONFIG_USER_DATA_SIZE 4
|
||||
// This is the firmware version for VIA support to avoid conflicts on menu fetching
|
||||
#define VIA_FIRMWARE_VERSION 1
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
|
@ -23,24 +23,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
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_DEL,
|
||||
KC_LCTL, 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_ENTER,
|
||||
KC_LSFT, KC_BSLS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1),
|
||||
KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI),
|
||||
KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT),
|
||||
|
||||
[1] = LAYOUT_all(
|
||||
_______, 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_INS, KC_DEL,
|
||||
KC_CAPS, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SCRL, KC_PAUSE, KC_UP, _______, KC_BSPC,
|
||||
_______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, S(KC_8), KC_SLSH, KC_HOME, KC_PGUP, KC_LEFT, KC_RIGHT, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, S(KC_EQL), KC_MINS, KC_END, KC_PGDN, KC_DOWN, _______, _______,
|
||||
_______, _______, _______, _______, _______),
|
||||
_______, _______, _______, _______, MO(2)),
|
||||
|
||||
[2] = LAYOUT_all(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______),
|
||||
|
||||
[3] = LAYOUT_all(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
QK_BOOT, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
|
|
|
@ -1,3 +1 @@
|
|||
VIA_ENABLE = yes
|
||||
|
||||
SRC += via_apc.c
|
||||
|
|
|
@ -1,156 +0,0 @@
|
|||
/* Copyright 2023 Cipulot
|
||||
*
|
||||
* 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 "ec_switch_matrix.h"
|
||||
#include "action.h"
|
||||
#include "via.h"
|
||||
|
||||
void apc_init_thresholds(void);
|
||||
void apc_set_threshold(bool is_for_actuation);
|
||||
|
||||
// Declaring an _apc_config_t struct that will store our data
|
||||
typedef struct _apc_config_t {
|
||||
uint16_t actuation_threshold;
|
||||
uint16_t release_threshold;
|
||||
} apc_config;
|
||||
|
||||
// Check if the size of the reserved persistent memory is the same as the size of struct apc_config
|
||||
_Static_assert(sizeof(apc_config) == EECONFIG_USER_DATA_SIZE, "Mismatch in keyboard EECONFIG stored data");
|
||||
|
||||
// Declaring a new variable apc of type apc_config
|
||||
apc_config apc;
|
||||
|
||||
// Declaring enums for VIA config menu
|
||||
enum via_apc_enums {
|
||||
// clang-format off
|
||||
id_apc_actuation_threshold = 1,
|
||||
id_apc_release_threshold = 2
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
// Initializing persistent memory configuration: default values are declared and stored in PMEM
|
||||
void eeconfig_init_user(void) {
|
||||
// Default values
|
||||
apc.actuation_threshold = DEFAULT_ACTUATION_LEVEL;
|
||||
apc.release_threshold = DEFAULT_RELEASE_LEVEL;
|
||||
// Write default value to EEPROM now
|
||||
eeconfig_update_user_datablock(&apc);
|
||||
}
|
||||
|
||||
// On Keyboard startup
|
||||
void keyboard_post_init_user(void) {
|
||||
// Read custom menu variables from memory
|
||||
eeconfig_read_user_datablock(&apc);
|
||||
apc_init_thresholds();
|
||||
}
|
||||
|
||||
// Handle the data received by the keyboard from the VIA menus
|
||||
void apc_config_set_value(uint8_t *data) {
|
||||
// data = [ value_id, value_data ]
|
||||
uint8_t *value_id = &(data[0]);
|
||||
uint8_t *value_data = &(data[1]);
|
||||
|
||||
switch (*value_id) {
|
||||
case id_apc_actuation_threshold: {
|
||||
apc.actuation_threshold = value_data[1] | (value_data[0] << 8);
|
||||
apc_set_threshold(true);
|
||||
break;
|
||||
}
|
||||
case id_apc_release_threshold: {
|
||||
apc.release_threshold = value_data[1] | (value_data[0] << 8);
|
||||
apc_set_threshold(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Handle the data sent by the keyboard to the VIA menus
|
||||
void apc_config_get_value(uint8_t *data) {
|
||||
// data = [ value_id, value_data ]
|
||||
uint8_t *value_id = &(data[0]);
|
||||
uint8_t *value_data = &(data[1]);
|
||||
|
||||
switch (*value_id) {
|
||||
case id_apc_actuation_threshold: {
|
||||
value_data[0] = apc.actuation_threshold >> 8;
|
||||
value_data[1] = apc.actuation_threshold & 0xFF;
|
||||
break;
|
||||
}
|
||||
case id_apc_release_threshold: {
|
||||
value_data[0] = apc.release_threshold >> 8;
|
||||
value_data[1] = apc.release_threshold & 0xFF;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Save the data to persistent memory after changes are made
|
||||
void apc_config_save(void) {
|
||||
eeconfig_update_user_datablock(&apc);
|
||||
}
|
||||
|
||||
void via_custom_value_command_kb(uint8_t *data, uint8_t length) {
|
||||
// data = [ command_id, channel_id, value_id, value_data ]
|
||||
uint8_t *command_id = &(data[0]);
|
||||
uint8_t *channel_id = &(data[1]);
|
||||
uint8_t *value_id_and_data = &(data[2]);
|
||||
|
||||
if (*channel_id == id_custom_channel) {
|
||||
switch (*command_id) {
|
||||
case id_custom_set_value: {
|
||||
apc_config_set_value(value_id_and_data);
|
||||
break;
|
||||
}
|
||||
case id_custom_get_value: {
|
||||
apc_config_get_value(value_id_and_data);
|
||||
break;
|
||||
}
|
||||
case id_custom_save: {
|
||||
apc_config_save();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
// Unhandled message.
|
||||
*command_id = id_unhandled;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
*command_id = id_unhandled;
|
||||
}
|
||||
|
||||
// Initialize the thresholds
|
||||
void apc_init_thresholds(void) {
|
||||
ecsm_config.ecsm_actuation_threshold = apc.actuation_threshold;
|
||||
ecsm_config.ecsm_release_threshold = apc.release_threshold;
|
||||
|
||||
// Update the ecsm_config
|
||||
ecsm_update(&ecsm_config);
|
||||
}
|
||||
|
||||
// Set the thresholds
|
||||
void apc_set_threshold(bool is_for_actuation) {
|
||||
if (is_for_actuation) {
|
||||
ecsm_config.ecsm_actuation_threshold = apc.actuation_threshold;
|
||||
|
||||
} else {
|
||||
ecsm_config.ecsm_release_threshold = apc.release_threshold;
|
||||
}
|
||||
// Update the ecsm_config
|
||||
ecsm_update(&ecsm_config);
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
|
@ -16,5 +16,5 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
// This is the size of the EEPROM for the custom VIA-specific data
|
||||
#define EECONFIG_USER_DATA_SIZE 4
|
||||
// This is the firmware version for VIA support to avoid conflicts on menu fetching
|
||||
#define VIA_FIRMWARE_VERSION 1
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
|
@ -21,31 +21,24 @@
|
|||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
// clang-format off
|
||||
[0] = LAYOUT_jp(
|
||||
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, JP_YEN, 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_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, KC_ENT,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, JP_UNDS, KC_UP, KC_RSFT,
|
||||
MO(1), JP_ZKHK, KC_LGUI, KC_LALT, JP_MHEN, KC_SPC, JP_HENK, JP_KANA, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT),
|
||||
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, JP_YEN, 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_ENT,
|
||||
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS,
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, JP_UNDS, KC_UP, KC_RSFT,
|
||||
MO(1), JP_ZKHK, KC_LGUI, KC_LALT, JP_MHEN, KC_SPC, JP_HENK, JP_KANA, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT),
|
||||
|
||||
[1] = LAYOUT_jp(
|
||||
_______, 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_INS, KC_DEL,
|
||||
KC_CAPS, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SCRL, KC_PAUS, KC_UP, _______,
|
||||
_______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, _______, KC_PENT,
|
||||
_______, 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_INS, KC_DEL,
|
||||
KC_CAPS, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SCRL, KC_PAUS, KC_UP, _______, KC_PENT,
|
||||
_______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, _______,
|
||||
_______, _______, _______, _______, _______, _______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, MO(2), _______, _______, _______, _______),
|
||||
|
||||
[2] = LAYOUT_jp(
|
||||
RGB_TOG, RGB_VAD, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, QK_BOOT,
|
||||
QK_BOOT, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
|
||||
|
||||
[3] = LAYOUT_jp(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______)
|
||||
// clang-format on
|
||||
};
|
||||
|
|
|
@ -1,3 +1 @@
|
|||
VIA_ENABLE = yes
|
||||
|
||||
SRC += via_apc.c
|
||||
|
|
|
@ -1,156 +0,0 @@
|
|||
/* Copyright 2023 Cipulot
|
||||
*
|
||||
* 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 "ec_switch_matrix.h"
|
||||
#include "action.h"
|
||||
#include "via.h"
|
||||
|
||||
void apc_init_thresholds(void);
|
||||
void apc_set_threshold(bool is_for_actuation);
|
||||
|
||||
// Declaring an _apc_config_t struct that will store our data
|
||||
typedef struct _apc_config_t {
|
||||
uint16_t actuation_threshold;
|
||||
uint16_t release_threshold;
|
||||
} apc_config;
|
||||
|
||||
// Check if the size of the reserved persistent memory is the same as the size of struct apc_config
|
||||
_Static_assert(sizeof(apc_config) == EECONFIG_USER_DATA_SIZE, "Mismatch in keyboard EECONFIG stored data");
|
||||
|
||||
// Declaring a new variable apc of type apc_config
|
||||
apc_config apc;
|
||||
|
||||
// Declaring enums for VIA config menu
|
||||
enum via_apc_enums {
|
||||
// clang-format off
|
||||
id_apc_actuation_threshold = 1,
|
||||
id_apc_release_threshold = 2
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
// Initializing persistent memory configuration: default values are declared and stored in PMEM
|
||||
void eeconfig_init_user(void) {
|
||||
// Default values
|
||||
apc.actuation_threshold = DEFAULT_ACTUATION_LEVEL;
|
||||
apc.release_threshold = DEFAULT_RELEASE_LEVEL;
|
||||
// Write default value to EEPROM now
|
||||
eeconfig_update_user_datablock(&apc);
|
||||
}
|
||||
|
||||
// On Keyboard startup
|
||||
void keyboard_post_init_user(void) {
|
||||
// Read custom menu variables from memory
|
||||
eeconfig_read_user_datablock(&apc);
|
||||
apc_init_thresholds();
|
||||
}
|
||||
|
||||
// Handle the data received by the keyboard from the VIA menus
|
||||
void apc_config_set_value(uint8_t *data) {
|
||||
// data = [ value_id, value_data ]
|
||||
uint8_t *value_id = &(data[0]);
|
||||
uint8_t *value_data = &(data[1]);
|
||||
|
||||
switch (*value_id) {
|
||||
case id_apc_actuation_threshold: {
|
||||
apc.actuation_threshold = value_data[1] | (value_data[0] << 8);
|
||||
apc_set_threshold(true);
|
||||
break;
|
||||
}
|
||||
case id_apc_release_threshold: {
|
||||
apc.release_threshold = value_data[1] | (value_data[0] << 8);
|
||||
apc_set_threshold(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Handle the data sent by the keyboard to the VIA menus
|
||||
void apc_config_get_value(uint8_t *data) {
|
||||
// data = [ value_id, value_data ]
|
||||
uint8_t *value_id = &(data[0]);
|
||||
uint8_t *value_data = &(data[1]);
|
||||
|
||||
switch (*value_id) {
|
||||
case id_apc_actuation_threshold: {
|
||||
value_data[0] = apc.actuation_threshold >> 8;
|
||||
value_data[1] = apc.actuation_threshold & 0xFF;
|
||||
break;
|
||||
}
|
||||
case id_apc_release_threshold: {
|
||||
value_data[0] = apc.release_threshold >> 8;
|
||||
value_data[1] = apc.release_threshold & 0xFF;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Save the data to persistent memory after changes are made
|
||||
void apc_config_save(void) {
|
||||
eeconfig_update_user_datablock(&apc);
|
||||
}
|
||||
|
||||
void via_custom_value_command_kb(uint8_t *data, uint8_t length) {
|
||||
// data = [ command_id, channel_id, value_id, value_data ]
|
||||
uint8_t *command_id = &(data[0]);
|
||||
uint8_t *channel_id = &(data[1]);
|
||||
uint8_t *value_id_and_data = &(data[2]);
|
||||
|
||||
if (*channel_id == id_custom_channel) {
|
||||
switch (*command_id) {
|
||||
case id_custom_set_value: {
|
||||
apc_config_set_value(value_id_and_data);
|
||||
break;
|
||||
}
|
||||
case id_custom_get_value: {
|
||||
apc_config_get_value(value_id_and_data);
|
||||
break;
|
||||
}
|
||||
case id_custom_save: {
|
||||
apc_config_save();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
// Unhandled message.
|
||||
*command_id = id_unhandled;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
*command_id = id_unhandled;
|
||||
}
|
||||
|
||||
// Initialize the thresholds
|
||||
void apc_init_thresholds(void) {
|
||||
ecsm_config.ecsm_actuation_threshold = apc.actuation_threshold;
|
||||
ecsm_config.ecsm_release_threshold = apc.release_threshold;
|
||||
|
||||
// Update the ecsm_config
|
||||
ecsm_update(&ecsm_config);
|
||||
}
|
||||
|
||||
// Set the thresholds
|
||||
void apc_set_threshold(bool is_for_actuation) {
|
||||
if (is_for_actuation) {
|
||||
ecsm_config.ecsm_actuation_threshold = apc.actuation_threshold;
|
||||
|
||||
} else {
|
||||
ecsm_config.ecsm_release_threshold = apc.release_threshold;
|
||||
}
|
||||
// Update the ecsm_config
|
||||
ecsm_update(&ecsm_config);
|
||||
}
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
|
@ -16,5 +16,5 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
// This is the size of the EEPROM for the custom VIA-specific data
|
||||
#define EECONFIG_USER_DATA_SIZE 4
|
||||
// This is the firmware version for VIA support to avoid conflicts on menu fetching
|
||||
#define VIA_FIRMWARE_VERSION 1
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
|
@ -27,7 +27,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT),
|
||||
|
||||
[1] = LAYOUT_all(
|
||||
QK_BOOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
QK_BOOT, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
|
|
|
@ -1,3 +1 @@
|
|||
VIA_ENABLE = yes
|
||||
|
||||
SRC += keyboards/cipulot/common/via_apc.c
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
|
@ -16,5 +16,5 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
// This is the size of the EEPROM for the custom VIA-specific data
|
||||
#define EECONFIG_USER_DATA_SIZE 4
|
||||
// This is the firmware version for VIA support to avoid conflicts on menu fetching
|
||||
#define VIA_FIRMWARE_VERSION 1
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
*
|
||||
* 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
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
|
@ -29,23 +29,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
KC_LCTL, KC_LGUI, KC_LALT, JP_MHEN, KC_SPC, JP_KANA, KC_RALT, KC_RGUI, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT),
|
||||
|
||||
[1] = LAYOUT_all(
|
||||
RGB_TOG, RGB_VAD, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, QK_BOOT,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
|
||||
|
||||
[2] = LAYOUT_all(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
|
||||
|
||||
[3] = LAYOUT_all(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
QK_BOOT, NK_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
|
|
|
@ -1,3 +1 @@
|
|||
VIA_ENABLE = yes
|
||||
|
||||
SRC += via_apc.c
|
||||
|
|
|
@ -1,156 +0,0 @@
|
|||
/* Copyright 2023 Cipulot
|
||||
*
|
||||
* 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 "ec_switch_matrix.h"
|
||||
#include "action.h"
|
||||
#include "via.h"
|
||||
|
||||
void apc_init_thresholds(void);
|
||||
void apc_set_threshold(bool is_for_actuation);
|
||||
|
||||
// Declaring an _apc_config_t struct that will store our data
|
||||
typedef struct _apc_config_t {
|
||||
uint16_t actuation_threshold;
|
||||
uint16_t release_threshold;
|
||||
} apc_config;
|
||||
|
||||
// Check if the size of the reserved persistent memory is the same as the size of struct apc_config
|
||||
_Static_assert(sizeof(apc_config) == EECONFIG_USER_DATA_SIZE, "Mismatch in keyboard EECONFIG stored data");
|
||||
|
||||
// Declaring a new variable apc of type apc_config
|
||||
apc_config apc;
|
||||
|
||||
// Declaring enums for VIA config menu
|
||||
enum via_apc_enums {
|
||||
// clang-format off
|
||||
id_apc_actuation_threshold = 1,
|
||||
id_apc_release_threshold = 2
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
// Initializing persistent memory configuration: default values are declared and stored in PMEM
|
||||
void eeconfig_init_user(void) {
|
||||
// Default values
|
||||
apc.actuation_threshold = DEFAULT_ACTUATION_LEVEL;
|
||||
apc.release_threshold = DEFAULT_RELEASE_LEVEL;
|
||||
// Write default value to EEPROM now
|
||||
eeconfig_update_user_datablock(&apc);
|
||||
}
|
||||
|
||||
// On Keyboard startup
|
||||
void keyboard_post_init_user(void) {
|
||||
// Read custom menu variables from memory
|
||||
eeconfig_read_user_datablock(&apc);
|
||||
apc_init_thresholds();
|
||||
}
|
||||
|
||||
// Handle the data received by the keyboard from the VIA menus
|
||||
void apc_config_set_value(uint8_t *data) {
|
||||
// data = [ value_id, value_data ]
|
||||
uint8_t *value_id = &(data[0]);
|
||||
uint8_t *value_data = &(data[1]);
|
||||
|
||||
switch (*value_id) {
|
||||
case id_apc_actuation_threshold: {
|
||||
apc.actuation_threshold = value_data[1] | (value_data[0] << 8);
|
||||
apc_set_threshold(true);
|
||||
break;
|
||||
}
|
||||
case id_apc_release_threshold: {
|
||||
apc.release_threshold = value_data[1] | (value_data[0] << 8);
|
||||
apc_set_threshold(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Handle the data sent by the keyboard to the VIA menus
|
||||
void apc_config_get_value(uint8_t *data) {
|
||||
// data = [ value_id, value_data ]
|
||||
uint8_t *value_id = &(data[0]);
|
||||
uint8_t *value_data = &(data[1]);
|
||||
|
||||
switch (*value_id) {
|
||||
case id_apc_actuation_threshold: {
|
||||
value_data[0] = apc.actuation_threshold >> 8;
|
||||
value_data[1] = apc.actuation_threshold & 0xFF;
|
||||
break;
|
||||
}
|
||||
case id_apc_release_threshold: {
|
||||
value_data[0] = apc.release_threshold >> 8;
|
||||
value_data[1] = apc.release_threshold & 0xFF;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Save the data to persistent memory after changes are made
|
||||
void apc_config_save(void) {
|
||||
eeconfig_update_user_datablock(&apc);
|
||||
}
|
||||
|
||||
void via_custom_value_command_kb(uint8_t *data, uint8_t length) {
|
||||
// data = [ command_id, channel_id, value_id, value_data ]
|
||||
uint8_t *command_id = &(data[0]);
|
||||
uint8_t *channel_id = &(data[1]);
|
||||
uint8_t *value_id_and_data = &(data[2]);
|
||||
|
||||
if (*channel_id == id_custom_channel) {
|
||||
switch (*command_id) {
|
||||
case id_custom_set_value: {
|
||||
apc_config_set_value(value_id_and_data);
|
||||
break;
|
||||
}
|
||||
case id_custom_get_value: {
|
||||
apc_config_get_value(value_id_and_data);
|
||||
break;
|
||||
}
|
||||
case id_custom_save: {
|
||||
apc_config_save();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
// Unhandled message.
|
||||
*command_id = id_unhandled;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
*command_id = id_unhandled;
|
||||
}
|
||||
|
||||
// Initialize the thresholds
|
||||
void apc_init_thresholds(void) {
|
||||
ecsm_config.ecsm_actuation_threshold = apc.actuation_threshold;
|
||||
ecsm_config.ecsm_release_threshold = apc.release_threshold;
|
||||
|
||||
// Update the ecsm_config
|
||||
ecsm_update(&ecsm_config);
|
||||
}
|
||||
|
||||
// Set the thresholds
|
||||
void apc_set_threshold(bool is_for_actuation) {
|
||||
if (is_for_actuation) {
|
||||
ecsm_config.ecsm_actuation_threshold = apc.actuation_threshold;
|
||||
|
||||
} else {
|
||||
ecsm_config.ecsm_release_threshold = apc.release_threshold;
|
||||
}
|
||||
// Update the ecsm_config
|
||||
ecsm_update(&ecsm_config);
|
||||
}
|
|
@ -21,7 +21,7 @@
|
|||
# define RGB_MATRIX_KEYPRESSES // reacts to keypresses
|
||||
// # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses)
|
||||
// # define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
|
||||
# define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
|
||||
# define RGB_MATRIX_SLEEP // turn off effects when suspended
|
||||
# define RGB_MATRIX_FRAMEBUFFER_EFFECTS
|
||||
// # define RGB_MATRIX_LED_PROCESS_LIMIT (RGB_MATRIX_LED_COUNT + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness)
|
||||
// # define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness)
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
# define RGB_MATRIX_KEYPRESSES // reacts to keypresses
|
||||
// # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (instead of keypresses)
|
||||
// # define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects
|
||||
# define RGB_DISABLE_WHEN_USB_SUSPENDED // turn off effects when suspended
|
||||
# define RGB_MATRIX_SLEEP // turn off effects when suspended
|
||||
# define RGB_MATRIX_FRAMEBUFFER_EFFECTS
|
||||
// # define RGB_MATRIX_LED_PROCESS_LIMIT (RGB_MATRIX_LED_COUNT + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness)
|
||||
// # define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness)
|
||||
|
|
|
@ -1,140 +0,0 @@
|
|||
/* Copyright 2022 DOIO
|
||||
* Copyright 2022 HorrorTroll <https://github.com/HorrorTroll>
|
||||
*
|
||||
* 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
|
||||
|
||||
// OLED animation
|
||||
#include "lib/layer_status/layer_status.h"
|
||||
|
||||
// Each layer gets a name for readability, which is then used in the keymap matrix below.
|
||||
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
|
||||
// Layer names don't all need to be of the same length, obviously, and you can also skip them
|
||||
// entirely and just use numbers.
|
||||
|
||||
enum layer_names {
|
||||
_BASE,
|
||||
_FN,
|
||||
_FN1,
|
||||
_FN2
|
||||
};
|
||||
|
||||
// enum layer_keycodes { };
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
/*
|
||||
┌───┬───┬───┬───┐ ┌───┐ ┌───┐
|
||||
│ 1 │ 2 │ 3 │ 4 │ │Ply│ │TO1│
|
||||
├───┼───┼───┼───┤ └───┘ └───┘
|
||||
│ 5 │ 6 │ 7 │ 8 │
|
||||
├───┼───┼───┼───┤
|
||||
│ 9 │ 0 │ ↑ │Ent│ ┌───┐
|
||||
├───┼───┼───┼───┤ │Mut│
|
||||
│Fn2│ ← │ ↓ │ → │ └───┘
|
||||
└───┴───┴───┴───┘
|
||||
┌───┬───┬───┬───┐ ┌───┐ ┌───┐
|
||||
│ ! │ @ │ # │ $ │ │ │ │ │
|
||||
├───┼───┼───┼───┤ └───┘ └───┘
|
||||
│ % │ ^ │ & │ * │
|
||||
├───┼───┼───┼───┤
|
||||
│ ( │ ) │ │ │ ┌───┐
|
||||
├───┼───┼───┼───┤ │ │
|
||||
│ │ │ │ │ └───┘
|
||||
└───┴───┴───┴───┘
|
||||
*/
|
||||
/* Row: 0 1 2 3 4 */
|
||||
[_BASE] = LAYOUT(
|
||||
KC_1, KC_2, KC_3, KC_4, KC_MPLY,
|
||||
KC_5, KC_6, KC_7, KC_8, TO(_FN),
|
||||
KC_9, KC_0, KC_UP, KC_ENT, KC_MUTE,
|
||||
MO(_FN2), KC_LEFT, KC_DOWN, KC_RIGHT
|
||||
),
|
||||
|
||||
/*
|
||||
┌───┬───┬───┬───┐ ┌───┐ ┌───┐
|
||||
│ │ │ │ │ │ │ │ │
|
||||
├───┼───┼───┼───┤ └───┘ └───┘
|
||||
│ │ │ │ │
|
||||
├───┼───┼───┼───┤
|
||||
│ │ │ │ │ ┌───┐
|
||||
├───┼───┼───┼───┤ │ │
|
||||
│ │ │ │ │ └───┘
|
||||
└───┴───┴───┴───┘
|
||||
*/
|
||||
/* Row: 0 1 2 3 4 */
|
||||
[_FN] = LAYOUT(
|
||||
_______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, TO(_FN1),
|
||||
_______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______
|
||||
),
|
||||
|
||||
/*
|
||||
┌───┬───┬───┬───┐ ┌───┐ ┌───┐
|
||||
│ │ │ │ │ │ │ │ │
|
||||
├───┼───┼───┼───┤ └───┘ └───┘
|
||||
│ │ │ │ │
|
||||
├───┼───┼───┼───┤
|
||||
│ │ │ │ │ ┌───┐
|
||||
├───┼───┼───┼───┤ │ │
|
||||
│ │ │ │ │ └───┘
|
||||
└───┴───┴───┴───┘
|
||||
*/
|
||||
/* Row: 0 1 2 3 4 */
|
||||
[_FN1] = LAYOUT(
|
||||
_______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, TO(_FN2),
|
||||
_______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______
|
||||
),
|
||||
|
||||
/*
|
||||
┌───┬───┬───┬───┐ ┌───┐ ┌───┐
|
||||
│Spi│Spd│ │ │ │ │ │TO0│
|
||||
├───┼───┼───┼───┤ └───┘ └───┘
|
||||
│Sai│Sad│ │ │
|
||||
├───┼───┼───┼───┤
|
||||
│Tog│Mod│Hui│ │ ┌───┐
|
||||
├───┼───┼───┼───┤ │ │
|
||||
│ │Vai│Hud│Vad│ └───┘
|
||||
└───┴───┴───┴───┘
|
||||
*/
|
||||
/* Row: 0 1 2 3 4 */
|
||||
[_FN2] = LAYOUT(
|
||||
RGB_SPI, RGB_SPD, _______, QK_BOOT, _______,
|
||||
RGB_SAI, RGB_SAD, _______, _______, TO(_BASE),
|
||||
RGB_TOG, RGB_MOD, RGB_HUI, _______, _______,
|
||||
_______, RGB_VAI, RGB_HUD, RGB_VAD
|
||||
),
|
||||
};
|
||||
|
||||
#ifdef OLED_ENABLE
|
||||
bool oled_task_user(void) {
|
||||
render_layer_status();
|
||||
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef ENCODER_MAP_ENABLE
|
||||
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
|
||||
[_BASE] = { ENCODER_CCW_CW(KC_MPRV, KC_MNXT), ENCODER_CCW_CW(KC_PGDN, KC_PGUP), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
|
||||
[_FN] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS) },
|
||||
[_FN1] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS) },
|
||||
[_FN2] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS) },
|
||||
};
|
||||
#endif
|
|
@ -1,23 +0,0 @@
|
|||
// Copyright 2018-2022 QMK (@qmk)
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[0] = LAYOUT(
|
||||
KC_ESC, 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_BSPC,
|
||||
KC_PGUP, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS,
|
||||
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_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1),
|
||||
KC_LCTL, KC_LALT, KC_SPC, MO(1), KC_SPC, KC_RALT, KC_LEFT, KC_DOWN, KC_RCTL
|
||||
),
|
||||
|
||||
[1] = LAYOUT(
|
||||
KC_TRNS, KC_TRNS, 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_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SCRL, KC_PAUS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
|
||||
)
|
||||
};
|
|
@ -23,8 +23,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
// #define MASTER_RIGHT
|
||||
// #define EE_HANDS
|
||||
|
||||
// #undef RGBLED_NUM
|
||||
// #define RGBLED_NUM 14
|
||||
// #undef RGBLIGHT_LED_COUNT
|
||||
// #define RGBLIGHT_LED_COUNT 14
|
||||
// #define RGBLIGHT_HUE_STEP 8
|
||||
// #define RGBLIGHT_SAT_STEP 8
|
||||
// #define RGBLIGHT_VAL_STEP 8
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
/*
|
||||
Copyright 2017 Danny Nguyen <danny@hexwire.com>
|
||||
|
||||
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
|
19
keyboards/fs_streampad/keymaps/via/keymap.c
Normal file
19
keyboards/fs_streampad/keymaps/via/keymap.c
Normal file
|
@ -0,0 +1,19 @@
|
|||
// Copyright 2023 Matthijs Muller
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[0] = LAYOUT(
|
||||
KC_1, KC_2, KC_3,
|
||||
KC_4, KC_5, KC_6,
|
||||
KC_7, KC_8, MO(1)
|
||||
),
|
||||
|
||||
[1] = LAYOUT(
|
||||
RGB_TOG, RGB_MOD, RGB_RMOD,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS
|
||||
)
|
||||
};
|
32
keyboards/geonworks/ee_at/keymaps/via/keymap.c
Normal file
32
keyboards/geonworks/ee_at/keymaps/via/keymap.c
Normal file
|
@ -0,0 +1,32 @@
|
|||
/* Copyright 2023 Yiancar-Designs
|
||||
*
|
||||
* 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] = {
|
||||
[0] = LAYOUT_all( /* Base */
|
||||
KC_F1, KC_F2, QK_GESC, 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_DEL, KC_NUM, KC_PMNS, KC_PSLS, KC_PAST,
|
||||
KC_F3, KC_F4, 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_P7, KC_P8, KC_P9, KC_PPLS,
|
||||
KC_F5, KC_F6, 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_P4, KC_P5, KC_P6,
|
||||
KC_F7, KC_F8, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), KC_P1, KC_P2, KC_P3, KC_PENT,
|
||||
KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, KC_P0, KC_PDOT),
|
||||
|
||||
[1] = LAYOUT_all( /* FN */
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS)
|
||||
};
|
|
@ -1,3 +1 @@
|
|||
VIA_ENABLE = yes
|
||||
MOUSEKEY_ENABLE = no
|
||||
LTO_ENABLE = yes
|
||||
|
|
|
@ -20,23 +20,22 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
* │Ctrl│GUI │Alt │ │ Fn │ GUI│Ctrl│ │ ← │ ↓ │ → │
|
||||
* └────┴────┴────┴─────────────────────────────┴────┴────┴────┘ └───┴───┴───┘
|
||||
*/
|
||||
[0] = 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_SCRL, KC_PAUS,
|
||||
[0] = LAYOUT_all(
|
||||
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_SCRL, KC_PAUS,
|
||||
|
||||
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_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_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, MO(1), KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
|
||||
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_TRNS, KC_UP,
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_MENU, MO(1), KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
|
||||
),
|
||||
[1] = LAYOUT(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
|
||||
)
|
||||
[1] = LAYOUT_all(
|
||||
QK_BOOT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, QK_BOOT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
|
||||
)
|
||||
|
||||
};
|
||||
|
|
|
@ -4,8 +4,7 @@
|
|||
"layout": "LAYOUT_tkl_ansi",
|
||||
"config": {
|
||||
"features": {
|
||||
"via": true,
|
||||
"lto": true
|
||||
"via": true
|
||||
}
|
||||
},
|
||||
"layers": [
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
/*
|
||||
This is the c configuration file for the keymap
|
||||
|
||||
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||
Copyright 2015 Jack Humbert
|
||||
|
||||
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
|
||||
|
|
@ -26,7 +26,7 @@
|
|||
# define RGB_MATRIX_DEFAULT_MODE RGB_MATRIX_RAINBOW_MOVING_CHEVRON
|
||||
|
||||
// Turns off RGB effects when there is no longer a USB connection
|
||||
# define RGB_DISABLE_WHEN_USB_SUSPENDED
|
||||
# define RGB_MATRIX_SLEEP
|
||||
|
||||
// Allow keypress reactive animations
|
||||
# define SPLIT_TRANSPORT_MIRROR // Necessary setting for key press animations on a split
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
// Copyright 2022 Alexander Lozyuk (@keyzog)
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
#pragma once
|
|
@ -29,12 +29,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
* |Ctrl|Win |Alt | Space |Alt| FN|Ctrl|Lef|Dow|Rig |
|
||||
* `----------------------------------------------------------------'
|
||||
*/
|
||||
[0] = LAYOUT_65_ansi(
|
||||
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_HOME,
|
||||
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_PGUP,
|
||||
KC_LCTL, 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_PGDN,
|
||||
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_END,
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
|
||||
[0] = LAYOUT_65_ansi(
|
||||
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_HOME,
|
||||
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_PGUP,
|
||||
KC_LCTL, 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_PGDN,
|
||||
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_END,
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
|
||||
),
|
||||
|
||||
/* Keymap Fn Layer
|
||||
* ,----------------------------------------------------------------.
|
||||
|
@ -49,27 +50,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
* | | | | | | | |Hom|PDn|End |
|
||||
* `----------------------------------------------------------------'
|
||||
*/
|
||||
[1] = LAYOUT_65_ansi(
|
||||
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,KC_INS,
|
||||
KC_CAPS,_______, KC_UP,_______,_______,_______,_______,_______,KC_PSCR,KC_SCRL,KC_PAUS, KC_UP,_______, _______,_______,
|
||||
_______,KC_LEFT,KC_DOWN,KC_RGHT,_______,_______,_______,_______,KC_HOME,KC_PGUP,KC_LEFT,KC_RGHT, _______,_______,
|
||||
_______,_______,_______,_______,_______,_______,_______,_______, KC_END,KC_PGDN,KC_DOWN, _______,KC_PGUP,_______,
|
||||
_______, _______, _______, _______, _______,_______,_______,KC_HOME,KC_PGDN, KC_END),
|
||||
|
||||
|
||||
[2] = LAYOUT_65_ansi(
|
||||
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,
|
||||
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,
|
||||
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,
|
||||
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______,
|
||||
_______, _______, _______, _______, _______,_______,_______,_______,_______,_______),
|
||||
|
||||
|
||||
[3] = LAYOUT_65_ansi(
|
||||
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,
|
||||
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,
|
||||
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,
|
||||
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______,
|
||||
_______, _______, _______, _______, _______,_______,_______,_______,_______,_______),
|
||||
|
||||
[1] = LAYOUT_65_ansi(
|
||||
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,KC_INS,
|
||||
KC_CAPS,_______, KC_UP,_______,_______,_______,_______,_______,KC_PSCR,KC_SCRL,KC_PAUS, KC_UP,_______, _______,_______,
|
||||
_______,KC_LEFT,KC_DOWN,KC_RGHT,_______,_______,_______,_______,KC_HOME,KC_PGUP,KC_LEFT,KC_RGHT, _______,_______,
|
||||
_______,_______,_______,_______,_______,_______,_______,_______, KC_END,KC_PGDN,KC_DOWN, _______,KC_PGUP,_______,
|
||||
_______, _______, _______, _______, _______,_______,_______,KC_HOME,KC_PGDN, KC_END
|
||||
)
|
||||
};
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
# The via keymap for kbd67
|
|
@ -1,2 +1 @@
|
|||
VIA_ENABLE = yes
|
||||
LTO_ENABLE = yes
|
||||
|
|
|
@ -27,26 +27,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
* | 0 | . | = | + |
|
||||
* `-----------------------'
|
||||
*/
|
||||
[0] = LAYOUT_ortho_4x4(
|
||||
LAYOUT_ortho_4x4(
|
||||
KC_P7, KC_P8, KC_P9, KC_PSLS,
|
||||
KC_P4, KC_P5, KC_P6, KC_PAST,
|
||||
KC_P1, KC_P2, KC_P3, KC_PMNS,
|
||||
KC_P0, KC_PDOT, KC_PEQL, KC_PPLS ),
|
||||
[1] = LAYOUT_ortho_4x4(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ),
|
||||
[2] = LAYOUT_ortho_4x4(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ),
|
||||
[3] = LAYOUT_ortho_4x4(
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ),
|
||||
KC_P0, KC_PDOT, KC_PEQL, KC_PPLS
|
||||
),
|
||||
};
|
||||
|
||||
|
||||
|
@ -69,8 +55,7 @@ bool oled_task_user(void) {
|
|||
#endif
|
||||
|
||||
|
||||
#ifdef ENCODER_ENABLE
|
||||
bool encoder_update_user(uint8_t index, bool clockwise) {
|
||||
#ifdef ENCODER_MAP_ENABLE
|
||||
/*
|
||||
Rev1.1 Rev1
|
||||
,-----------------------, ,-----------------------,
|
||||
|
@ -84,35 +69,11 @@ Rev1.1 Rev1
|
|||
`-----------------------' `-----------------------'
|
||||
*/
|
||||
|
||||
// First encoder (E1)
|
||||
if (index == 0) {
|
||||
if (clockwise) {
|
||||
tap_code(KC_F17);
|
||||
} else {
|
||||
tap_code(KC_F18);
|
||||
}
|
||||
// Second encoder (E2)
|
||||
} else if (index == 1) {
|
||||
if (clockwise) {
|
||||
tap_code(KC_F19);
|
||||
} else {
|
||||
tap_code(KC_F20);
|
||||
}
|
||||
// Third encoder (E3)
|
||||
} else if (index == 2) {
|
||||
if (clockwise) {
|
||||
tap_code(KC_F21);
|
||||
} else {
|
||||
tap_code(KC_F22);
|
||||
}
|
||||
// Forth encoder (E4)
|
||||
} else if (index == 3) {
|
||||
if (clockwise) {
|
||||
tap_code(KC_F23);
|
||||
} else {
|
||||
tap_code(KC_F24);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
|
||||
#ifdef KEYBOARD_keycapsss_plaid_pad_rev1
|
||||
{ ENCODER_CCW_CW(KC_F18, KC_F17), ENCODER_CCW_CW(KC_F20, KC_F19) }
|
||||
#else
|
||||
{ ENCODER_CCW_CW(KC_F18, KC_F17), ENCODER_CCW_CW(KC_F20, KC_F19), ENCODER_CCW_CW(KC_F22, KC_F21), ENCODER_CCW_CW(KC_F24, KC_F23) }
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
VIA_ENABLE = yes
|
||||
LTO_ENABLE = yes
|
||||
ENCODER_MAP_ENABLE = yes
|
||||
|
|
|
@ -16,10 +16,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
enum Layers {
|
||||
_BASE,
|
||||
_LOWER,
|
||||
_RAISE,
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[0] = LAYOUT_all(
|
||||
[_BASE] = LAYOUT_all(
|
||||
KC_DEL , 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_MPLY,
|
||||
KC_F13 , 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_F14 , 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 ,
|
||||
|
@ -27,7 +32,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
KC_F16 , 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_BSLS, KC_UP , KC_PGDN,
|
||||
KC_F17 , KC_LCTL, KC_LGUI, KC_LALT, KC_SPC , KC_SPC , KC_SPC , KC_SPC , KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT),
|
||||
|
||||
[1] = LAYOUT_all(
|
||||
[_LOWER] = LAYOUT_all(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
|
@ -35,7 +40,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
|
||||
|
||||
[2] = LAYOUT_all(
|
||||
[_RAISE] = LAYOUT_all(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
|
@ -44,22 +49,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
|
||||
};
|
||||
|
||||
bool encoder_update_user(uint8_t index, bool clockwise) {
|
||||
if (index == 0) { /* First encoder */
|
||||
if (clockwise) {
|
||||
tap_code(KC_WH_D);
|
||||
} else {
|
||||
tap_code(KC_WH_U);
|
||||
}
|
||||
} else if (index == 1) { /* Second encoder */
|
||||
if (clockwise) {
|
||||
tap_code(KC_VOLU);
|
||||
} else {
|
||||
tap_code(KC_VOLD);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
#if defined(ENCODER_MAP_ENABLE)
|
||||
const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = {
|
||||
[_BASE] = { ENCODER_CCW_CW(KC_MS_WH_UP, KC_MS_WH_DOWN), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) },
|
||||
[_LOWER] = { ENCODER_CCW_CW(RGB_HUD, RGB_HUI), ENCODER_CCW_CW(RGB_SAD, RGB_SAI) },
|
||||
[_RAISE] = { ENCODER_CCW_CW(RGB_VAD, RGB_VAI), ENCODER_CCW_CW(RGB_SPD, RGB_SPI) },
|
||||
};
|
||||
#endif
|
||||
|
||||
#ifdef OLED_ENABLE
|
||||
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
VIA_ENABLE = yes
|
||||
WPM_ENABLE = yes
|
||||
WPM_ENABLE = yes
|
||||
ENCODER_MAP_ENABLE = yes
|
|
@ -1,3 +1,6 @@
|
|||
// Copyright Kumao Kobo <kumaokobo@gmail.com>
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
// Each layer gets a name for readability, which is then used in the keymap matrix below.
|
||||
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
|
0
keyboards/mnk1800s/keymaps/via/rules.mk → keyboards/kumaokobo/kudox/columner/keymaps/via/rules.mk
Executable file → Normal file
0
keyboards/mnk1800s/keymaps/via/rules.mk → keyboards/kumaokobo/kudox/columner/keymaps/via/rules.mk
Executable file → Normal file
|
@ -1,3 +1,6 @@
|
|||
// Copyright Kumao Kobo <kumaokobo@gmail.com>
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
// Each layer gets a name for readability, which is then used in the keymap matrix below.
|
||||
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
|
0
keyboards/mnk50/keymaps/via/rules.mk → keyboards/kumaokobo/kudox/rev3/keymaps/via/rules.mk
Executable file → Normal file
0
keyboards/mnk50/keymaps/via/rules.mk → keyboards/kumaokobo/kudox/rev3/keymaps/via/rules.mk
Executable file → Normal file
|
@ -1,3 +1,6 @@
|
|||
// Copyright Kumao Kobo <kumaokobo@gmail.com>
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
|
||||
#include QMK_KEYBOARD_H
|
||||
// Each layer gets a name for readability, which is then used in the keymap matrix below.
|
||||
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
|
0
keyboards/mnk75/keymaps/via/rules.mk → keyboards/kumaokobo/kudox_game/keymaps/via/rules.mk
Executable file → Normal file
0
keyboards/mnk75/keymaps/via/rules.mk → keyboards/kumaokobo/kudox_game/keymaps/via/rules.mk
Executable file → Normal file
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue