Merge remote-tracking branch 'origin/master' into develop
This commit is contained in:
153
keyboards/bastardkb/dilemma/3x5_2/keymaps/bstiq/config.h
Normal file
153
keyboards/bastardkb/dilemma/3x5_2/keymaps/bstiq/config.h
Normal file
@@ -0,0 +1,153 @@
|
||||
/**
|
||||
* Copyright 2021 Quentin LEBASTARD <qlebastard@gmail.com>
|
||||
* Copyright 2022 Charly Delay <charly@codesink.dev> (@0xcharly)
|
||||
*
|
||||
* 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
|
||||
|
||||
#ifdef VIA_ENABLE
|
||||
/* Via configuration. */
|
||||
# define DYNAMIC_KEYMAP_LAYER_COUNT 8
|
||||
#endif // VIA_ENABLE
|
||||
|
||||
/**
|
||||
* Configure the global tapping term (default: 200ms).
|
||||
* If you have a lot of accidental mod activations, crank up the tapping term.
|
||||
*
|
||||
* See docs.qmk.fm/using-qmk/software-features/tap_hold#tapping-term
|
||||
*/
|
||||
#ifndef TAPPING_TERM
|
||||
# define TAPPING_TERM 160
|
||||
#endif // TAPPING_TERM
|
||||
|
||||
// disable trackpad taps
|
||||
// #define CIRQUE_PINNACLE_TAPPING_TERM 0
|
||||
|
||||
/**
|
||||
* Enable rapid switch from tap to hold. Disable auto-repeat when pressing key
|
||||
* twice, except for one-shot keys.
|
||||
*
|
||||
* See docs.qmk.fm/using-qmk/software-features/tap_hold#tapping-force-hold
|
||||
*/
|
||||
#define TAPPING_FORCE_HOLD
|
||||
|
||||
/*
|
||||
* Tap-or-Hold decision modes.
|
||||
*
|
||||
* Note that the following flags behave differently when combined (ie. when 2 or
|
||||
* more are enabled).
|
||||
*
|
||||
* See bit.ly/tap-or-hold for a visual explanation of the following tap-or-hold
|
||||
* decision modes.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Faster tap-hold trigger.
|
||||
*
|
||||
* Without `PERMISSIVE_HOLD`, within `TAPPING_TERM`:
|
||||
* Mod(a)🠗 e🠗 e🠕 Mod(a)🠕 ➞ ae
|
||||
* With `PERMISSIVE_HOLD`, within `TAPPING_TERM`:
|
||||
* Mod(a)🠗 e🠗 e🠕 Mod(a)🠕 ➞ Mod+e
|
||||
*
|
||||
* See docs.qmk.fm/using-qmk/software-features/tap_hold#permissive-hold
|
||||
*/
|
||||
#define PERMISSIVE_HOLD
|
||||
|
||||
/**
|
||||
* Prevent normal rollover on alphas from accidentally triggering mods.
|
||||
*
|
||||
* Ignores key presses that interrupt a mod-tap. Must-have for Home Row mod.
|
||||
*
|
||||
* Without `IGNORE_MOD_TAP_INTERRUPT`, within `TAPPING_TERM`:
|
||||
* Mod(a)🠗 e🠗 Mod(a)🠕 e🠕 ➞ Mod+e
|
||||
* With `IGNORE_MOD_TAP_INTERRUPT`, within `TAPPING_TERM`:
|
||||
* Mod(a)🠗 e🠗 Mod(a)🠕 e🠕 ➞ ae
|
||||
*
|
||||
* See docs.qmk.fm/using-qmk/software-features/tap_hold#ignore-mod-tap-interrupt
|
||||
*/
|
||||
#define IGNORE_MOD_TAP_INTERRUPT
|
||||
|
||||
/** Dilemma-specific features. */
|
||||
|
||||
#ifdef POINTING_DEVICE_ENABLE
|
||||
// Flip horizontal direction for drag-scroll.
|
||||
# define DILEMMA_DRAGSCROLL_REVERSE_X
|
||||
// #define DILEMMA_DRAGSCROLL_REVERSE_Y
|
||||
#endif // POINTING_DEVICE_ENABLE
|
||||
|
||||
/** RGB Matrix. */
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
// Enable all animations on ARM boards since they have plenty of memory
|
||||
// available for it.
|
||||
# define ENABLE_RGB_MATRIX_ALPHAS_MODS
|
||||
# define ENABLE_RGB_MATRIX_GRADIENT_UP_DOWN
|
||||
# define ENABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT
|
||||
# define ENABLE_RGB_MATRIX_BREATHING
|
||||
# define ENABLE_RGB_MATRIX_BAND_SAT
|
||||
# define ENABLE_RGB_MATRIX_BAND_VAL
|
||||
# define ENABLE_RGB_MATRIX_BAND_PINWHEEL_SAT
|
||||
# define ENABLE_RGB_MATRIX_BAND_PINWHEEL_VAL
|
||||
# define ENABLE_RGB_MATRIX_BAND_SPIRAL_SAT
|
||||
# define ENABLE_RGB_MATRIX_BAND_SPIRAL_VAL
|
||||
# define ENABLE_RGB_MATRIX_CYCLE_ALL
|
||||
# define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
|
||||
# define ENABLE_RGB_MATRIX_CYCLE_UP_DOWN
|
||||
# define ENABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON
|
||||
# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN
|
||||
# define ENABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL
|
||||
# define ENABLE_RGB_MATRIX_CYCLE_PINWHEEL
|
||||
# define ENABLE_RGB_MATRIX_CYCLE_SPIRAL
|
||||
# define ENABLE_RGB_MATRIX_DUAL_BEACON
|
||||
# define ENABLE_RGB_MATRIX_RAINBOW_BEACON
|
||||
# define ENABLE_RGB_MATRIX_RAINBOW_PINWHEELS
|
||||
# define ENABLE_RGB_MATRIX_RAINDROPS
|
||||
# define ENABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS
|
||||
# define ENABLE_RGB_MATRIX_HUE_BREATHING
|
||||
# define ENABLE_RGB_MATRIX_HUE_PENDULUM
|
||||
# define ENABLE_RGB_MATRIX_HUE_WAVE
|
||||
# define ENABLE_RGB_MATRIX_TYPING_HEATMAP
|
||||
# define ENABLE_RGB_MATRIX_DIGITAL_RAIN
|
||||
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE
|
||||
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE
|
||||
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE
|
||||
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE
|
||||
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS
|
||||
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS
|
||||
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS
|
||||
# define ENABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS
|
||||
# define ENABLE_RGB_MATRIX_SPLASH
|
||||
# define ENABLE_RGB_MATRIX_MULTISPLASH
|
||||
# define ENABLE_RGB_MATRIX_SOLID_SPLASH
|
||||
# define ENABLE_RGB_MATRIX_SOLID_MULTISPLASH
|
||||
|
||||
// Limit maximum brightness to keep power consumption reasonable, and avoid
|
||||
// disconnects.
|
||||
# undef RGB_MATRIX_MAXIMUM_BRIGHTNESS
|
||||
# define RGB_MATRIX_MAXIMUM_BRIGHTNESS 64
|
||||
|
||||
// Rainbow swirl as startup mode.
|
||||
# define ENABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT
|
||||
# define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_CYCLE_LEFT_RIGHT
|
||||
|
||||
// Slow swirl at startup.
|
||||
# define RGB_MATRIX_STARTUP_SPD 32
|
||||
|
||||
// Startup values.
|
||||
# define RGB_MATRIX_STARTUP_HUE 0
|
||||
# define RGB_MATRIX_STARTUP_SAT 255
|
||||
# define RGB_MATRIX_STARTUP_VAL RGB_MATRIX_MAXIMUM_BRIGHTNESS
|
||||
# define RGB_MATRIX_STARTUP_HSV RGB_MATRIX_STARTUP_HUE, RGB_MATRIX_STARTUP_SAT, RGB_MATRIX_STARTUP_VAL
|
||||
#endif // RGB_MATRIX_ENABLE
|
224
keyboards/bastardkb/dilemma/3x5_2/keymaps/bstiq/keymap.c
Normal file
224
keyboards/bastardkb/dilemma/3x5_2/keymaps/bstiq/keymap.c
Normal file
@@ -0,0 +1,224 @@
|
||||
/**
|
||||
* Copyright 2021 Quentin LEBASTARD <qlebastard@gmail.com>
|
||||
* Copyright 2022 Charly Delay <charly@codesink.dev> (@0xcharly)
|
||||
*
|
||||
* 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 bstiq_layers {
|
||||
LAYER_BASE = 0,
|
||||
LAYER_MBO,
|
||||
LAYER_MEDIA,
|
||||
LAYER_NAV,
|
||||
LAYER_MOUSE,
|
||||
LAYER_SYM,
|
||||
LAYER_NUM,
|
||||
LAYER_FUN,
|
||||
};
|
||||
|
||||
// Automatically enable sniping when the mouse layer is on.
|
||||
#define DILEMMA_AUTO_SNIPING_ON_LAYER LAYER_MOUSE
|
||||
|
||||
#define BSP_NAV LT(LAYER_NAV, KC_BSPC)
|
||||
#define ENT_MBO LT(LAYER_MBO, KC_ENT)
|
||||
#define TAB_MED LT(LAYER_MEDIA, KC_TAB)
|
||||
#define ESC_SYM LT(LAYER_SYM, KC_ESC)
|
||||
#define SPC_NUM LT(LAYER_NUM, KC_SPC)
|
||||
#define SPC_MBO LT(LAYER_MBO, KC_SPC)
|
||||
#define MOUSE(KC) LT(LAYER_MOUSE, KC)
|
||||
|
||||
#define USR_RDO KC_AGAIN
|
||||
#define USR_PST S(KC_INS)
|
||||
#define USR_CPY C(KC_INS)
|
||||
#define USR_CUT S(KC_DEL)
|
||||
#define USR_UND KC_UNDO
|
||||
|
||||
#define MS_L KC_MS_LEFT
|
||||
#define MS_R KC_MS_RIGHT
|
||||
#define MS_D KC_MS_DOWN
|
||||
#define MS_U KC_MS_UP
|
||||
|
||||
#define WH_L KC_MS_WH_LEFT
|
||||
#define WH_R KC_MS_WH_RIGHT
|
||||
#define WH_D KC_MS_WH_DOWN
|
||||
#define WH_U KC_MS_WH_UP
|
||||
|
||||
// clang-format off
|
||||
/** Convenience macro. */
|
||||
#define _KC_LAYOUT_wrapper( \
|
||||
k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, \
|
||||
k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, \
|
||||
k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, \
|
||||
...) \
|
||||
KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, KC_##k07, KC_##k08, KC_##k09, \
|
||||
KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, KC_##k17, KC_##k18, KC_##k19, \
|
||||
KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##k26, KC_##k27, KC_##k28, KC_##k29, \
|
||||
__VA_ARGS__
|
||||
#define KC_LAYOUT_wrapper(...) _KC_LAYOUT_wrapper(__VA_ARGS__)
|
||||
|
||||
/** Base layer with BÉPO layout. */
|
||||
#define LAYOUT_LAYER_BASE_BEPO KC_LAYOUT_wrapper( \
|
||||
B, W, P, O, QUOT, DOT, V, D, L, J, \
|
||||
A, U, I, E, COMM, C, T, S, R, N, \
|
||||
Z, Y, X, SLSH, K, M, Q, G, H, F, \
|
||||
SPC_MBO, TAB_MED, ESC_SYM, SPC_NUM)
|
||||
|
||||
/** Convenience key shorthands. */
|
||||
#define U_NA KC_NO // Present but not available for use.
|
||||
#define U_NU KC_NO // Available but not used.
|
||||
|
||||
/** Convenience row shorthands. */
|
||||
#define ________________HOME_ROW_NA________________ U_NA, U_NA, U_NA, U_NA, U_NA
|
||||
#define ______________HOME_ROW_GASC_L______________ KC_LGUI, KC_LALT, KC_LSFT, KC_LCTL, U_NA
|
||||
#define ______________HOME_ROW_ALGR_L______________ U_NA, KC_ALGR, U_NA, U_NA, U_NA
|
||||
#define ______________HOME_ROW_GASC_R______________ U_NA, KC_LCTL, KC_LSFT, KC_LALT, KC_LGUI
|
||||
#define ______________HOME_ROW_ALGR_R______________ U_NA, U_NA, U_NA, KC_ALGR, U_NA
|
||||
|
||||
/** Layers. */
|
||||
|
||||
// Buttons.
|
||||
#define LAYOUT_LAYER_MBO \
|
||||
________________HOME_ROW_NA________________, USR_RDO, USR_PST, USR_CPY, USR_CUT, USR_UND, \
|
||||
______________HOME_ROW_GASC_L______________, KC_BSPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, \
|
||||
KC_BTN3, KC_ALGR, KC_BTN2, KC_BTN1, U_NA, KC_DEL, KC_HOME, KC_PGDN, KC_PGUP, KC_END, \
|
||||
U_NA, U_NA, KC_ENT, KC_ENT
|
||||
|
||||
// Media.
|
||||
#define LAYOUT_LAYER_MEDIA \
|
||||
________________HOME_ROW_NA________________, USR_RDO, USR_PST, USR_CPY, USR_CUT, USR_UND, \
|
||||
______________HOME_ROW_GASC_L______________, U_NU, MS_L, MS_D, MS_U, MS_R, \
|
||||
______________HOME_ROW_ALGR_L______________, U_NU, WH_L, WH_D, WH_U, WH_R, \
|
||||
U_NA, U_NA, KC_BTN1, KC_BTN3
|
||||
|
||||
// Navigation.
|
||||
#define LAYOUT_LAYER_NAV \
|
||||
________________HOME_ROW_NA________________, RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, \
|
||||
______________HOME_ROW_GASC_L______________, U_NU, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT, \
|
||||
______________HOME_ROW_ALGR_L______________, U_NU, U_NU, U_NU, U_NU, U_NU, \
|
||||
U_NA, U_NA, KC_MSTP, KC_MPLY
|
||||
|
||||
// Mouse.
|
||||
#define LAYOUT_LAYER_MOUSE \
|
||||
S_D_MOD, USR_PST, USR_CPY, USR_CUT, USR_UND, USR_RDO, USR_PST, USR_CPY, USR_CUT, USR_UND, \
|
||||
DPI_MOD, DRGSCRL, KC_LSFT, DRGSCRL, _______, U_NU, MS_L, MS_D, MS_U, MS_R, \
|
||||
USR_RDO, USR_PST, USR_CPY, KC_BTN3, USR_UND, U_NU, WH_L, WH_D, WH_U, WH_R, \
|
||||
KC_BTN1, KC_BTN2, KC_BTN1, KC_BTN3
|
||||
|
||||
// Symbols.
|
||||
#define LAYOUT_LAYER_SYM \
|
||||
KC_LCBR, KC_AMPR, KC_ASTR, KC_LPRN, KC_RCBR, ________________HOME_ROW_NA________________, \
|
||||
KC_COLN, KC_DLR, KC_PERC, KC_CIRC, KC_PLUS, ______________HOME_ROW_GASC_R______________, \
|
||||
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_MINS, ______________HOME_ROW_ALGR_R______________, \
|
||||
KC_RPRN, KC_LPRN, U_NA, U_NA
|
||||
|
||||
// Numerals.
|
||||
#define LAYOUT_LAYER_NUM \
|
||||
KC_LBRC, KC_7, KC_8, KC_9, KC_RBRC, ________________HOME_ROW_NA________________, \
|
||||
KC_SCLN, KC_4, KC_5, KC_6, KC_EQL, ______________HOME_ROW_GASC_R______________, \
|
||||
KC_GRV, KC_1, KC_2, KC_3, KC_UNDS, ______________HOME_ROW_ALGR_R______________, \
|
||||
KC_0, KC_MINS, U_NA, U_NA
|
||||
|
||||
// Function keys.
|
||||
#define LAYOUT_LAYER_FUN \
|
||||
KC_F12, KC_F7, KC_F8, KC_F9, KC_PSCR, ________________HOME_ROW_NA________________, \
|
||||
KC_F11, KC_F4, KC_F5, KC_F6, KC_SCRL, ______________HOME_ROW_GASC_R______________, \
|
||||
KC_F10, KC_F1, KC_F2, KC_F3, KC_PAUS, ______________HOME_ROW_ALGR_R______________,\
|
||||
KC_APP, KC_TAB, U_NA, U_NA
|
||||
|
||||
/**
|
||||
* Add Home Row mod to a layout.
|
||||
*
|
||||
* Expects a 10-key per row layout. Adds support for GASC (Gui, Alt, Shift, Ctl)
|
||||
* home row. The layout passed in parameter must contain at least 20 keycodes.
|
||||
*
|
||||
* This is meant to be used with `LAYOUT_LAYER_BASE_BEPO` defined above, eg.:
|
||||
*
|
||||
* HOME_ROW_MOD_GASC(LAYOUT_LAYER_BASE_BEPO)
|
||||
*/
|
||||
#define _HOME_ROW_MOD_GASC( \
|
||||
L00, L01, L02, L03, L04, R05, R06, R07, R08, R09, \
|
||||
L10, L11, L12, L13, L14, R15, R16, R17, R18, R19, \
|
||||
...) \
|
||||
L00, L01, L02, L03, L04, \
|
||||
R05, R06, R07, R08, R09, \
|
||||
LGUI_T(L10), LALT_T(L11), LSFT_T(L12), LCTL_T(L13), L14, \
|
||||
R15, RCTL_T(R16), RSFT_T(R17), LALT_T(R18), RGUI_T(R19), \
|
||||
__VA_ARGS__
|
||||
#define HOME_ROW_MOD_GASC(...) _HOME_ROW_MOD_GASC(__VA_ARGS__)
|
||||
|
||||
/**
|
||||
* Add mouse layer keys to a layout.
|
||||
*
|
||||
* Expects a 10-key per row layout. The layout passed in parameter must contain
|
||||
* at least 30 keycodes.
|
||||
*
|
||||
* This is meant to be used with `LAYOUT_LAYER_BASE_BEPO` defined above, eg.:
|
||||
*
|
||||
* MOUSE_MOD(LAYOUT_LAYER_BASE_BEPO)
|
||||
*/
|
||||
#define _MOUSE_MOD( \
|
||||
L00, L01, L02, L03, L04, R05, R06, R07, R08, R09, \
|
||||
L10, L11, L12, L13, L14, R15, R16, R17, R18, R19, \
|
||||
L20, L21, L22, L23, L24, R25, R26, R27, R28, R29, \
|
||||
...) \
|
||||
L00, L01, L02, L03, L04, \
|
||||
R05, R06, R07, R08, R09, \
|
||||
L10, L11, L12, L13, L14, \
|
||||
R15, R16, R17, R18, R19, \
|
||||
L20, MOUSE(L21), L22, L23, L24, \
|
||||
R25, R26, R27, R28, MOUSE(R29), \
|
||||
__VA_ARGS__
|
||||
#define MOUSE_MOD(...) _MOUSE_MOD(__VA_ARGS__)
|
||||
|
||||
#define LAYOUT_wrapper(...) LAYOUT_split_3x5_2(__VA_ARGS__)
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[LAYER_BASE] = LAYOUT_wrapper(
|
||||
MOUSE_MOD(HOME_ROW_MOD_GASC(LAYOUT_LAYER_BASE_BEPO))
|
||||
),
|
||||
[LAYER_MBO] = LAYOUT_wrapper(LAYOUT_LAYER_MBO),
|
||||
[LAYER_MEDIA] = LAYOUT_wrapper(LAYOUT_LAYER_MEDIA),
|
||||
[LAYER_NAV] = LAYOUT_wrapper(LAYOUT_LAYER_NAV),
|
||||
[LAYER_MOUSE] = LAYOUT_wrapper(LAYOUT_LAYER_MOUSE),
|
||||
[LAYER_SYM] = LAYOUT_wrapper(LAYOUT_LAYER_SYM),
|
||||
[LAYER_NUM] = LAYOUT_wrapper(LAYOUT_LAYER_NUM),
|
||||
[LAYER_FUN] = LAYOUT_wrapper(LAYOUT_LAYER_FUN),
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
#if defined(POINTING_DEVICE_ENABLE) && defined(DILEMMA_AUTO_SNIPING_ON_LAYER)
|
||||
layer_state_t layer_state_set_kb(layer_state_t state) {
|
||||
state = layer_state_set_user(state);
|
||||
dilemma_set_pointer_sniping_enabled(layer_state_cmp(state, DILEMMA_AUTO_SNIPING_ON_LAYER));
|
||||
return state;
|
||||
}
|
||||
#endif // POINTING_DEVICE_ENABLE && DILEMMA_AUTO_SNIPING_ON_LAYER
|
||||
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
// Forward-declare this helper function since it is defined in rgb_matrix.c.
|
||||
void rgb_matrix_update_pwm_buffers(void);
|
||||
#endif
|
||||
|
||||
void shutdown_user(void) {
|
||||
#ifdef RGBLIGHT_ENABLE
|
||||
rgblight_enable_noeeprom();
|
||||
rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
|
||||
rgblight_setrgb(RGB_RED);
|
||||
#endif // RGBLIGHT_ENABLE
|
||||
#ifdef RGB_MATRIX_ENABLE
|
||||
rgb_matrix_set_color_all(RGB_RED);
|
||||
rgb_matrix_update_pwm_buffers();
|
||||
#endif // RGB_MATRIX_ENABLE
|
||||
}
|
@@ -0,0 +1,3 @@
|
||||
# Dilemma @bstiq keymap
|
||||
|
||||
Inspired from Miryoku, using home-rows.
|
84
keyboards/bastardkb/dilemma/3x5_2/keymaps/default/keymap.c
Normal file
84
keyboards/bastardkb/dilemma/3x5_2/keymaps/default/keymap.c
Normal file
@@ -0,0 +1,84 @@
|
||||
/**
|
||||
* Copyright 2022 Charly Delay <charly@codesink.dev> (@0xcharly)
|
||||
*
|
||||
* 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 charybdis_keymap_layers {
|
||||
LAYER_BASE = 0,
|
||||
LAYER_NAV,
|
||||
LAYER_SYM,
|
||||
LAYER_NUM,
|
||||
};
|
||||
|
||||
#define NAV MO(LAYER_NAV)
|
||||
#define SYM MO(LAYER_SYM)
|
||||
|
||||
// clang-format off
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[LAYER_BASE] = LAYOUT_split_3x5_2(
|
||||
// ╭─────────────────────────────────────────────╮ ╭─────────────────────────────────────────────╮
|
||||
KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P,
|
||||
// ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤
|
||||
KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,
|
||||
// ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤
|
||||
KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH,
|
||||
// ╰─────────────────────────────────────────────┤ ├─────────────────────────────────────────────╯
|
||||
NAV, CW_TOGG, KC_SPC, SYM
|
||||
// ╰──────────────────╯ ╰──────────────────╯
|
||||
),
|
||||
|
||||
[LAYER_NAV] = LAYOUT_split_3x5_2(
|
||||
// ╭─────────────────────────────────────────────╮ ╭─────────────────────────────────────────────╮
|
||||
KC_TAB, XXXXXXX, XXXXXXX, XXXXXXX, KC_VOLU, XXXXXXX, KC_HOME, KC_UP, KC_END, KC_DEL,
|
||||
// ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤
|
||||
KC_LSFT, KC_LCTL, KC_LALT, KC_RGUI, KC_VOLD, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_BSPC,
|
||||
// ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤
|
||||
QK_BOOT, EE_CLR, KC_MPRV, KC_MNXT, KC_MPLY, XXXXXXX, KC_PGDN, KC_PGUP, XXXXXXX, KC_ENT,
|
||||
// ╰─────────────────────────────────────────────┤ ├─────────────────────────────────────────────╯
|
||||
_______, KC_LSFT, KC_SPC, _______
|
||||
// ╰──────────────────╯ ╰──────────────────╯
|
||||
),
|
||||
|
||||
[LAYER_SYM] = LAYOUT_split_3x5_2(
|
||||
// ╭─────────────────────────────────────────────╮ ╭─────────────────────────────────────────────╮
|
||||
KC_ESC, KC_LBRC, KC_LCBR, KC_LPRN, KC_TILD, KC_CIRC, KC_RPRN, KC_RCBR, KC_RBRC, KC_GRV,
|
||||
// ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤
|
||||
KC_MINS, KC_ASTR, KC_EQL, KC_UNDS, KC_DLR, KC_HASH, KC_RGUI, KC_RALT, KC_RCTL, KC_RSFT,
|
||||
// ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤
|
||||
KC_PLUS, KC_PIPE, KC_AT, KC_SLSH, KC_PERC, _______, KC_BSLS, KC_AMPR, KC_QUES, KC_EXLM,
|
||||
// ╰─────────────────────────────────────────────┤ ├─────────────────────────────────────────────╯
|
||||
_______, KC_LSFT, KC_SPC, _______
|
||||
// ╰──────────────────╯ ╰──────────────────╯
|
||||
),
|
||||
|
||||
[LAYER_NUM] = LAYOUT_split_3x5_2(
|
||||
// ╭─────────────────────────────────────────────╮ ╭─────────────────────────────────────────────╮
|
||||
KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,
|
||||
// ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤
|
||||
KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI, KC_F11, KC_F12, KC_RGUI, KC_RALT, KC_RCTL, KC_RSFT,
|
||||
// ├─────────────────────────────────────────────┤ ├─────────────────────────────────────────────┤
|
||||
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10,
|
||||
// ╰─────────────────────────────────────────────┤ ├─────────────────────────────────────────────╯
|
||||
_______, KC_LSFT, KC_SPC, _______
|
||||
// ╰──────────────────╯ ╰──────────────────╯
|
||||
),
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||
return update_tri_layer_state(state, LAYER_NAV, LAYER_SYM, LAYER_NUM);
|
||||
}
|
@@ -0,0 +1,8 @@
|
||||
// Copyright 2020 Christopher Courtney, aka Drashna Jael're (@drashna) <drashna@live.com>
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#define CIRQUE_PINNACLE_TAP_ENABLE
|
||||
#define POINTING_DEVICE_GESTURES_CURSOR_GLIDE_ENABLE
|
||||
#define POINTING_DEVICE_GESTURES_SCROLL_ENABLE
|
160
keyboards/bastardkb/dilemma/3x5_2/keymaps/drashna/keymap.c
Normal file
160
keyboards/bastardkb/dilemma/3x5_2/keymaps/drashna/keymap.c
Normal file
@@ -0,0 +1,160 @@
|
||||
/**
|
||||
* Copyright 2022 Charly Delay <charly@codesink.dev> (@0xcharly)
|
||||
*
|
||||
* 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 "drashna.h"
|
||||
|
||||
// clang-format off
|
||||
#define LAYOUT_split_3x5_2_wrapper(...) LAYOUT_split_3x5_2(__VA_ARGS__)
|
||||
#define LAYOUT_split_3x5_2_base( \
|
||||
K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \
|
||||
K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \
|
||||
K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \
|
||||
) \
|
||||
LAYOUT_split_3x5_2 ( \
|
||||
K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \
|
||||
ALT_T(K11), K12, K13, K14, GUI_T(K15), LGUI_T(K16), K17, K18, K19, LALT_T(K1A), \
|
||||
CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, RCTL_T(K2A), \
|
||||
KC_SPC, BK_LWER, DL_RAIS, RSFT_T(KC_ENT) \
|
||||
)
|
||||
|
||||
#define LAYOUT_split_3x5_2_base_wrapper(...) LAYOUT_split_3x5_2_base(__VA_ARGS__)
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
[_DEFAULT_LAYER_1] = LAYOUT_split_3x5_2_base_wrapper(
|
||||
_________________QWERTY_L1_________________, _________________QWERTY_R1_________________,
|
||||
_________________QWERTY_L2_________________, _________________QWERTY_R2_________________,
|
||||
_________________QWERTY_L3_________________, _________________QWERTY_R3_________________
|
||||
),
|
||||
|
||||
[_DEFAULT_LAYER_2] = LAYOUT_split_3x5_2_base_wrapper(
|
||||
______________COLEMAK_MOD_DH_L1____________, ______________COLEMAK_MOD_DH_R1____________,
|
||||
______________COLEMAK_MOD_DH_L2____________, ______________COLEMAK_MOD_DH_R2____________,
|
||||
______________COLEMAK_MOD_DH_L3____________, ______________COLEMAK_MOD_DH_R3____________
|
||||
),
|
||||
[_DEFAULT_LAYER_3] = LAYOUT_split_3x5_2_base_wrapper(
|
||||
_________________COLEMAK_L1________________, _________________COLEMAK_R1________________,
|
||||
_________________COLEMAK_L2________________, _________________COLEMAK_R2________________,
|
||||
_________________COLEMAK_L3________________, _________________COLEMAK_R3________________
|
||||
),
|
||||
|
||||
[_DEFAULT_LAYER_4] = LAYOUT_split_3x5_2_base_wrapper(
|
||||
_________________DVORAK_L1_________________, _________________DVORAK_R1_________________,
|
||||
_________________DVORAK_L2_________________, _________________DVORAK_R2_________________,
|
||||
_________________DVORAK_L3_________________, _________________DVORAK_R3_________________
|
||||
),
|
||||
|
||||
[_MOUSE] = LAYOUT_split_3x5_2(
|
||||
_______, _______, _______, _______, _______, KC_WH_U, DPI_RMOD,DPI_MOD, S_D_RMOD,S_D_MOD,
|
||||
_______, _______, _______, _______, _______, KC_WH_D, KC_BTN1, KC_BTN3, KC_BTN2, KC_BTN6,
|
||||
_______, _______, _______, _______, _______, KC_BTN7, KC_BTN4, KC_BTN5, KC_BTN8, _______,
|
||||
SNIPING, _______, _______, _______
|
||||
),
|
||||
[_LOWER] = LAYOUT_split_3x5_2_wrapper(
|
||||
_________________LOWER_L1__________________, _________________LOWER_R1__________________,
|
||||
_________________LOWER_L2__________________, _________________LOWER_R2__________________,
|
||||
_________________LOWER_L3__________________, _________________LOWER_R3__________________,
|
||||
_______, _______, _______, AUTO_CTN
|
||||
),
|
||||
[_RAISE] = LAYOUT_split_3x5_2_wrapper(
|
||||
_________________RAISE_L1__________________, _________________RAISE_R1__________________,
|
||||
_________________RAISE_L2__________________, _________________RAISE_R2__________________,
|
||||
_________________RAISE_L3__________________, _________________RAISE_R3__________________,
|
||||
_______, _______, _______, _______
|
||||
),
|
||||
[_ADJUST] = LAYOUT_split_3x5_2_wrapper(
|
||||
_________________ADJUST_L1_________________, _________________ADJUST_R1_________________,
|
||||
_________________ADJUST_L2_________________, _________________ADJUST_R2_________________,
|
||||
_________________ADJUST_L3_________________, _________________ADJUST_R3_________________,
|
||||
KC_NUKE, _______, _______, QK_BOOT
|
||||
),
|
||||
};
|
||||
|
||||
|
||||
void matrix_output_unselect_delay(uint8_t line, bool key_pressed) {
|
||||
for (int32_t i = 0; i < 40; i++) {
|
||||
__asm__ volatile("nop" ::: "memory");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#if defined(OLED_ENABLE) && defined(OLED_DISPLAY_128X128)
|
||||
# ifdef UNICODE_COMMON_ENABLE
|
||||
# include "process_unicode_common.h"
|
||||
# include "keyrecords/unicode.h"
|
||||
# endif
|
||||
|
||||
extern const char PROGMEM display_border[3];
|
||||
|
||||
|
||||
extern uint32_t oled_timer;
|
||||
extern bool is_oled_enabled;
|
||||
|
||||
|
||||
bool oled_task_keymap(void) {
|
||||
static const char PROGMEM header_image[] = {
|
||||
0, 192, 32, 16, 8, 4, 2, 1, 1, 1, 1, 1, 1, 1, 1, 3, 7, 15, 31, 63, 127, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 127, 63, 31, 15, 7, 3, 1, 1, 1, 1, 1, 1, 1, 1, 2, 4, 8, 16, 32, 192, 0,
|
||||
// 0,255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 7, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 7, 3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,255, 0
|
||||
};
|
||||
oled_write_raw_P(header_image, sizeof(header_image));
|
||||
oled_set_cursor(7, 0);
|
||||
oled_write_P(PSTR("Rock On"), true);
|
||||
|
||||
render_default_layer_state(1, 1);
|
||||
render_layer_state(1, 2);
|
||||
render_kitty(0, 5);
|
||||
render_wpm(1, 7, 5);
|
||||
# if defined(POINTING_DEVICE_ENABLE)
|
||||
render_pointing_dpi_status(dilemma_get_pointer_sniping_enabled() ? dilemma_get_pointer_sniping_dpi() : dilemma_get_pointer_default_dpi(), 1, 7, 6);
|
||||
render_mouse_mode(17, 6);
|
||||
# elif defined(WPM_ENABLE) && defined(DEBUG_MATRIX_SCAN_RATE)
|
||||
render_matrix_scan_rate(1, 7, 6);
|
||||
# endif
|
||||
render_bootmagic_status(7, 7);
|
||||
render_user_status(1, 9);
|
||||
|
||||
render_mod_status(get_mods() | get_oneshot_mods(), 1, 10);
|
||||
render_keylock_status(host_keyboard_led_state(), 1, 11);
|
||||
render_unicode_mode(1, 12);
|
||||
|
||||
// render_rgb_hsv(1, 13);
|
||||
oled_set_cursor(1, 13);
|
||||
// oled_write_P(PSTR("Timer:"), false);
|
||||
// oled_write(get_u8_str((uint8_t)(timer_elapsed32(oled_timer) / 1000), ' '), false);
|
||||
oled_write_P(PSTR("Status: "), false);
|
||||
if (is_oled_enabled) {
|
||||
oled_write_P(PSTR("on "), false);
|
||||
} else {
|
||||
oled_write_P(PSTR("off"), false);
|
||||
}
|
||||
|
||||
render_keylogger_status(1, 14);
|
||||
|
||||
for (uint8_t i = 1; i < 15; i++) {
|
||||
oled_set_cursor(0, i);
|
||||
oled_write_raw_P(display_border, sizeof(display_border));
|
||||
oled_set_cursor(21, i);
|
||||
oled_write_raw_P(display_border, sizeof(display_border));
|
||||
}
|
||||
|
||||
static const char PROGMEM footer_image[] = {0, 3, 4, 8, 16, 32, 64, 128, 128, 128, 128, 128, 128, 128, 192, 224, 240, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 248, 240, 224, 192, 128, 128, 128, 128, 128, 128, 128, 64, 32, 16, 8, 4, 3, 0};
|
||||
oled_set_cursor(0, 15);
|
||||
oled_write_raw_P(footer_image, sizeof(footer_image));
|
||||
|
||||
return false;
|
||||
}
|
||||
#endif
|
@@ -0,0 +1,8 @@
|
||||
SWAP_HANDS_ENABLE = no
|
||||
AUTOCORRECT_ENABLE = yes
|
||||
CAPS_WORD_ENABLE = yes
|
||||
CONSOLE_ENABLE = yes
|
||||
KEYLOGGER_ENABLE = no
|
||||
WPM_ENABLE = yes
|
||||
OLED_ENABLE = yes
|
||||
OLED_DRIVER = custom
|
91
keyboards/bastardkb/dilemma/3x5_2/keymaps/via/config.h
Normal file
91
keyboards/bastardkb/dilemma/3x5_2/keymaps/via/config.h
Normal file
@@ -0,0 +1,91 @@
|
||||
/**
|
||||
* Copyright 2021 Charly Delay <charly@codesink.dev> (@0xcharly)
|
||||
*
|
||||
* 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
|
||||
|
||||
#ifdef VIA_ENABLE
|
||||
/* VIA configuration. */
|
||||
# define DYNAMIC_KEYMAP_LAYER_COUNT 6
|
||||
#endif // VIA_ENABLE
|
||||
|
||||
/* Disable unused features. */
|
||||
#define NO_ACTION_ONESHOT
|
||||
|
||||
#ifndef TAPPING_TERM
|
||||
/**
|
||||
* \brief Configure the global tapping term (default: 200ms).
|
||||
*
|
||||
* If you have a lot of accidental mod activations, crank up the tapping term.
|
||||
*
|
||||
* See docs.qmk.fm/using-qmk/software-features/tap_hold#tapping-term
|
||||
*/
|
||||
# define TAPPING_TERM 200
|
||||
#endif // TAPPING_TERM
|
||||
|
||||
/**
|
||||
* \brief Enable rapid switch from tap to hold.
|
||||
*
|
||||
* Note that a side-effect of this setting is to disable auto-repeat when
|
||||
* pressing key twice, except for one-shot keys.
|
||||
*
|
||||
* See docs.qmk.fm/using-qmk/software-features/tap_hold#tapping-force-hold
|
||||
*/
|
||||
#define TAPPING_FORCE_HOLD
|
||||
|
||||
/*
|
||||
* Tap-or-Hold decision modes.
|
||||
*
|
||||
* Note that the following flags behave differently when combined (ie. when 2 or
|
||||
* more are enabled).
|
||||
*
|
||||
* See bit.ly/tap-or-hold for a visual explanation of the following tap-or-hold
|
||||
* decision modes.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \brief Faster tap-hold trigger.
|
||||
*
|
||||
* Without `PERMISSIVE_HOLD`, within `TAPPING_TERM`:
|
||||
* Mod(a)🠗 e🠗 e🠕 Mod(a)🠕 ➞ ae
|
||||
* With `PERMISSIVE_HOLD`, within `TAPPING_TERM`:
|
||||
* Mod(a)🠗 e🠗 e🠕 Mod(a)🠕 ➞ Mod+e
|
||||
*
|
||||
* See docs.qmk.fm/using-qmk/software-features/tap_hold#permissive-hold
|
||||
*/
|
||||
#define PERMISSIVE_HOLD
|
||||
|
||||
/**
|
||||
* \brief Prevent normal rollover on alphas from accidentally triggering mods.
|
||||
*
|
||||
* Ignores key presses that interrupt a mod-tap. Must-have for Home Row mod.
|
||||
*
|
||||
* Without `IGNORE_MOD_TAP_INTERRUPT`, within `TAPPING_TERM`:
|
||||
* Mod(a)🠗 e🠗 Mod(a)🠕 e🠕 ➞ Mod+e
|
||||
* With `IGNORE_MOD_TAP_INTERRUPT`, within `TAPPING_TERM`:
|
||||
* Mod(a)🠗 e🠗 Mod(a)🠕 e🠕 ➞ ae
|
||||
*
|
||||
* See docs.qmk.fm/using-qmk/software-features/tap_hold#ignore-mod-tap-interrupt
|
||||
*/
|
||||
#define IGNORE_MOD_TAP_INTERRUPT
|
||||
|
||||
/* Charybdis-specific features. */
|
||||
|
||||
#ifdef POINTING_DEVICE_ENABLE
|
||||
// Automatically enable the pointer layer when moving the trackball. See also:
|
||||
// - `DILEMMA_AUTO_POINTER_LAYER_TRIGGER_TIMEOUT_MS`
|
||||
// - `DILEMMA_AUTO_POINTER_LAYER_TRIGGER_THRESHOLD`
|
||||
// #define DILEMMA_AUTO_POINTER_LAYER_TRIGGER_ENABLE
|
||||
#endif // POINTING_DEVICE_ENABLE
|
229
keyboards/bastardkb/dilemma/3x5_2/keymaps/via/keymap.c
Normal file
229
keyboards/bastardkb/dilemma/3x5_2/keymaps/via/keymap.c
Normal file
@@ -0,0 +1,229 @@
|
||||
/**
|
||||
* Copyright 2022 Charly Delay <charly@codesink.dev> (@0xcharly)
|
||||
*
|
||||
* 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
|
||||
|
||||
#ifdef DILEMMA_AUTO_POINTER_LAYER_TRIGGER_ENABLE
|
||||
# include "timer.h"
|
||||
#endif // DILEMMA_AUTO_POINTER_LAYER_TRIGGER_ENABLE
|
||||
|
||||
enum dilemma_keymap_layers {
|
||||
LAYER_BASE = 0,
|
||||
LAYER_FUNCTION,
|
||||
LAYER_NAVIGATION,
|
||||
LAYER_POINTER,
|
||||
LAYER_NUMERAL,
|
||||
LAYER_SYMBOLS,
|
||||
};
|
||||
|
||||
// Automatically enable sniping-mode on the pointer layer.
|
||||
#define DILEMMA_AUTO_SNIPING_ON_LAYER LAYER_POINTER
|
||||
|
||||
#ifdef DILEMMA_AUTO_POINTER_LAYER_TRIGGER_ENABLE
|
||||
static uint16_t auto_pointer_layer_timer = 0;
|
||||
|
||||
# ifndef DILEMMA_AUTO_POINTER_LAYER_TRIGGER_TIMEOUT_MS
|
||||
# define DILEMMA_AUTO_POINTER_LAYER_TRIGGER_TIMEOUT_MS 1000
|
||||
# endif // DILEMMA_AUTO_POINTER_LAYER_TRIGGER_TIMEOUT_MS
|
||||
|
||||
# ifndef DILEMMA_AUTO_POINTER_LAYER_TRIGGER_THRESHOLD
|
||||
# define DILEMMA_AUTO_POINTER_LAYER_TRIGGER_THRESHOLD 8
|
||||
# endif // DILEMMA_AUTO_POINTER_LAYER_TRIGGER_THRESHOLD
|
||||
#endif // DILEMMA_AUTO_POINTER_LAYER_TRIGGER_ENABLE
|
||||
|
||||
#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 _L_PTR(KC) LT(LAYER_POINTER, KC)
|
||||
|
||||
#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). */
|
||||
#define LAYOUT_LAYER_BASE \
|
||||
KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, \
|
||||
KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, \
|
||||
KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, \
|
||||
TAB_FUN, SPC_NAV, ENT_SYM, BSP_NUM
|
||||
|
||||
/** Convenience row shorthands. */
|
||||
#define _______________DEAD_HALF_ROW_______________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX
|
||||
#define ______________HOME_ROW_GACS_L______________ KC_LGUI, KC_LALT, KC_LCTL, KC_LSFT, XXXXXXX
|
||||
#define ______________HOME_ROW_GACS_R______________ XXXXXXX, KC_LSFT, KC_LCTL, KC_LALT, KC_LGUI
|
||||
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
#define LAYOUT_LAYER_FUNCTION \
|
||||
_______________DEAD_HALF_ROW_______________, KC_PSCR, KC_F7, KC_F8, KC_F9, KC_F12, \
|
||||
______________HOME_ROW_GACS_L______________, KC_SLCK, KC_F4, KC_F5, KC_F6, KC_F11, \
|
||||
_______________DEAD_HALF_ROW_______________, KC_PAUS, KC_F1, KC_F2, KC_F3, KC_F10, \
|
||||
_______, XXXXXXX, XXXXXXX, XXXXXXX
|
||||
|
||||
/** \brief Mouse emulation and pointer functions. */
|
||||
#define LAYOUT_LAYER_POINTER \
|
||||
QK_BOOT, XXXXXXX, XXXXXXX, DPI_MOD, S_D_MOD, S_D_MOD, DPI_MOD, XXXXXXX, XXXXXXX, QK_BOOT, \
|
||||
______________HOME_ROW_GACS_L______________, ______________HOME_ROW_GACS_R______________, \
|
||||
_______, DRGSCRL, SNIPING, KC_BTN3, XXXXXXX, XXXXXXX, KC_BTN3, SNIPING, DRGSCRL, _______, \
|
||||
KC_BTN2, KC_BTN1, KC_BTN1, KC_BTN2
|
||||
|
||||
/**
|
||||
* \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.
|
||||
*/
|
||||
#define LAYOUT_LAYER_NAVIGATION \
|
||||
_______________DEAD_HALF_ROW_______________, _______________DEAD_HALF_ROW_______________, \
|
||||
______________HOME_ROW_GACS_L______________, KC_CLCK, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, \
|
||||
_______________DEAD_HALF_ROW_______________, KC_INS, KC_HOME, KC_PGDN, KC_PGUP, KC_END, \
|
||||
XXXXXXX, _______, KC_ENT, KC_BSPC
|
||||
|
||||
/**
|
||||
* \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.
|
||||
*/
|
||||
#define LAYOUT_LAYER_NUMERAL \
|
||||
KC_LBRC, KC_7, KC_8, KC_9, KC_RBRC, _______________DEAD_HALF_ROW_______________, \
|
||||
KC_SCLN, KC_4, KC_5, KC_6, KC_EQL, ______________HOME_ROW_GACS_R______________, \
|
||||
KC_DOT, KC_1, KC_2, KC_3, KC_BSLS, _______________DEAD_HALF_ROW_______________, \
|
||||
KC_MINS, KC_0, 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`.
|
||||
*/
|
||||
#define LAYOUT_LAYER_SYMBOLS \
|
||||
KC_LCBR, KC_AMPR, KC_ASTR, KC_LPRN, KC_RCBR, _______________DEAD_HALF_ROW_______________, \
|
||||
KC_COLN, KC_DLR, KC_PERC, KC_CIRC, KC_PLUS, ______________HOME_ROW_GACS_R______________, \
|
||||
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_PIPE, _______________DEAD_HALF_ROW_______________, \
|
||||
KC_GRV, KC_UNDS, _______, XXXXXXX
|
||||
|
||||
/**
|
||||
* \brief Add Home Row mod to a layout.
|
||||
*
|
||||
* Expects a 10-key per row layout. Adds support for GACS (Gui, Alt, Ctl, Shift)
|
||||
* home row. The layout passed in parameter must contain at least 20 keycodes.
|
||||
*
|
||||
* This is meant to be used with `LAYER_ALPHAS_QWERTY` defined above, eg.:
|
||||
*
|
||||
* HOME_ROW_MOD_GACS(LAYER_ALPHAS_QWERTY)
|
||||
*/
|
||||
#define _HOME_ROW_MOD_GACS( \
|
||||
L00, L01, L02, L03, L04, R05, R06, R07, R08, R09, \
|
||||
L10, L11, L12, L13, L14, R15, R16, R17, R18, R19, \
|
||||
...) \
|
||||
L00, L01, L02, L03, L04, \
|
||||
R05, R06, R07, R08, R09, \
|
||||
LGUI_T(L10), LALT_T(L11), LCTL_T(L12), LSFT_T(L13), L14, \
|
||||
R15, RSFT_T(R16), RCTL_T(R17), LALT_T(R18), RGUI_T(R19), \
|
||||
__VA_ARGS__
|
||||
#define HOME_ROW_MOD_GACS(...) _HOME_ROW_MOD_GACS(__VA_ARGS__)
|
||||
|
||||
/**
|
||||
* \brief Add pointer layer keys to a layout.
|
||||
*
|
||||
* Expects a 10-key per row layout. The layout passed in parameter must contain
|
||||
* at least 30 keycodes.
|
||||
*
|
||||
* This is meant to be used with `LAYER_ALPHAS_QWERTY` defined above, eg.:
|
||||
*
|
||||
* POINTER_MOD(LAYER_ALPHAS_QWERTY)
|
||||
*/
|
||||
#define _POINTER_MOD( \
|
||||
L00, L01, L02, L03, L04, R05, R06, R07, R08, R09, \
|
||||
L10, L11, L12, L13, L14, R15, R16, R17, R18, R19, \
|
||||
L20, L21, L22, L23, L24, R25, R26, R27, R28, R29, \
|
||||
...) \
|
||||
L00, L01, L02, L03, L04, \
|
||||
R05, R06, R07, R08, R09, \
|
||||
L10, L11, L12, L13, L14, \
|
||||
R15, R16, R17, R18, R19, \
|
||||
_L_PTR(L20), L21, L22, L23, L24, \
|
||||
R25, R26, R27, R28, _L_PTR(R29), \
|
||||
__VA_ARGS__
|
||||
#define POINTER_MOD(...) _POINTER_MOD(__VA_ARGS__)
|
||||
|
||||
#define LAYOUT_wrapper(...) LAYOUT_split_3x5_2(__VA_ARGS__)
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[LAYER_BASE] = LAYOUT_wrapper(
|
||||
POINTER_MOD(HOME_ROW_MOD_GACS(LAYOUT_LAYER_BASE))
|
||||
),
|
||||
[LAYER_FUNCTION] = LAYOUT_wrapper(LAYOUT_LAYER_FUNCTION),
|
||||
[LAYER_NAVIGATION] = LAYOUT_wrapper(LAYOUT_LAYER_NAVIGATION),
|
||||
[LAYER_NUMERAL] = LAYOUT_wrapper(LAYOUT_LAYER_NUMERAL),
|
||||
[LAYER_POINTER] = LAYOUT_wrapper(LAYOUT_LAYER_POINTER),
|
||||
[LAYER_SYMBOLS] = LAYOUT_wrapper(LAYOUT_LAYER_SYMBOLS),
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
#ifdef POINTING_DEVICE_ENABLE
|
||||
# ifdef DILEMMA_AUTO_POINTER_LAYER_TRIGGER_ENABLE
|
||||
report_mouse_t pointing_device_task_user(report_mouse_t mouse_report) {
|
||||
if (abs(mouse_report.x) > DILEMMA_AUTO_POINTER_LAYER_TRIGGER_THRESHOLD || abs(mouse_report.y) > DILEMMA_AUTO_POINTER_LAYER_TRIGGER_THRESHOLD) {
|
||||
if (auto_pointer_layer_timer == 0) {
|
||||
layer_on(LAYER_POINTER);
|
||||
}
|
||||
auto_pointer_layer_timer = timer_read();
|
||||
}
|
||||
return mouse_report;
|
||||
}
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
if (auto_pointer_layer_timer != 0 && TIMER_DIFF_16(timer_read(), auto_pointer_layer_timer) >= DILEMMA_AUTO_POINTER_LAYER_TRIGGER_TIMEOUT_MS) {
|
||||
auto_pointer_layer_timer = 0;
|
||||
layer_off(LAYER_POINTER);
|
||||
}
|
||||
}
|
||||
# endif // DILEMMA_AUTO_POINTER_LAYER_TRIGGER_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
|
67
keyboards/bastardkb/dilemma/3x5_2/keymaps/via/readme.md
Normal file
67
keyboards/bastardkb/dilemma/3x5_2/keymaps/via/readme.md
Normal file
@@ -0,0 +1,67 @@
|
||||
# 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
|
||||
```
|
||||
|
||||
### Auto pointer layer
|
||||
|
||||
The pointer layer can be automatically enabled when moving the trackball. To enable or disable this behavior, add or remove the following define:
|
||||
|
||||
```c
|
||||
#define DILEMMA_AUTO_POINTER_LAYER_TRIGGER_ENABLE
|
||||
```
|
||||
|
||||
By default, the layer is turned off 1 second after the last registered trackball movement:
|
||||
|
||||
```c
|
||||
#define DILEMMA_AUTO_POINTER_LAYER_TRIGGER_TIMEOUT_MS 1000
|
||||
```
|
||||
|
||||
The trigger sensibility can also be tuned. The lower the value, the more sensible the trigger:
|
||||
|
||||
```c
|
||||
#define DILEMMA_AUTO_POINTER_LAYER_TRIGGER_THRESHOLD 8
|
||||
```
|
1
keyboards/bastardkb/dilemma/3x5_2/keymaps/via/rules.mk
Normal file
1
keyboards/bastardkb/dilemma/3x5_2/keymaps/via/rules.mk
Normal file
@@ -0,0 +1 @@
|
||||
VIA_ENABLE = yes
|
Reference in New Issue
Block a user