mirror of
https://github.com/qmk/qmk_userspace.git
synced 2025-04-30 04:34:17 -04:00
tap hold fixes
This commit is contained in:
parent
51d6d874e6
commit
568e2f86ad
6 changed files with 11 additions and 74 deletions
|
@ -1,48 +0,0 @@
|
||||||
/* Copyright 2015-2021 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
|
|
||||||
|
|
||||||
#ifdef AUDIO_ENABLE
|
|
||||||
# define STARTUP_SONG SONG(PREONIC_SOUND)
|
|
||||||
// #define STARTUP_SONG SONG(NO_SOUND)
|
|
||||||
|
|
||||||
# define DEFAULT_LAYER_SONGS \
|
|
||||||
{ SONG(QWERTY_SOUND), SONG(COLEMAK_SOUND), SONG(DVORAK_SOUND) }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MUSIC_MASK (keycode != KC_NO)
|
|
||||||
|
|
||||||
/*
|
|
||||||
* MIDI options
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* enable basic MIDI features:
|
|
||||||
- MIDI notes can be sent when in Music mode is on
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define MIDI_BASIC
|
|
||||||
|
|
||||||
/* enable advanced MIDI features:
|
|
||||||
- MIDI notes can be added to the keymap
|
|
||||||
- Octave shift and transpose
|
|
||||||
- Virtual sustain, portamento, and modulation wheel
|
|
||||||
- etc.
|
|
||||||
*/
|
|
||||||
//#define MIDI_ADVANCED
|
|
||||||
|
|
||||||
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
|
|
||||||
//#define MIDI_TONE_KEYCODE_OCTAVES 2
|
|
|
@ -13,10 +13,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
[_RAISE] = LAYOUT_wrapper(RAISE_LAYER),
|
[_RAISE] = LAYOUT_wrapper(RAISE_LAYER),
|
||||||
|
|
||||||
[_NUM] = LAYOUT_wrapper(NUM_LAYER),
|
[_NUM] = LAYOUT_wrapper(NUM_LAYER),
|
||||||
};
|
|
||||||
|
|
||||||
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
|
[_WOW] = LAYOUT_wrapper(WOW_LAYER),
|
||||||
return true;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void matrix_scan_keymap(void) {}
|
|
||||||
|
|
|
@ -10,7 +10,6 @@ AUDIO_ENABLE = no # Audio output on port C6
|
||||||
UNICODE_ENABLE = no # Unicode
|
UNICODE_ENABLE = no # Unicode
|
||||||
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
|
||||||
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight.
|
||||||
API_SYSEX_ENABLE = no
|
|
||||||
|
|
||||||
ENCODER_ENABLE = no
|
ENCODER_ENABLE = no
|
||||||
DIP_SWITCH_ENABLE = no
|
DIP_SWITCH_ENABLE = no
|
||||||
|
|
|
@ -1,20 +1,5 @@
|
||||||
#include "ncsibra.h"
|
#include "ncsibra.h"
|
||||||
|
|
||||||
// Add reconfigurable functions here, for keymap customization
|
|
||||||
// This allows for a global, userspace functions, and continued
|
|
||||||
// customization of the keymap. Use _keymap instead of _user
|
|
||||||
// functions in the keymaps
|
|
||||||
__attribute__ ((weak))
|
|
||||||
void matrix_init_keymap(void) {}
|
|
||||||
|
|
||||||
__attribute__ ((weak))
|
|
||||||
void matrix_scan_keymap(void) {}
|
|
||||||
|
|
||||||
__attribute__ ((weak))
|
|
||||||
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Tap hold keys
|
// Tap hold keys
|
||||||
static taphold_t th_events[] = {
|
static taphold_t th_events[] = {
|
||||||
{ .is_pressed = false, .is_double = false, .timer = 0, .kc_tap = KC_ESC, .kc_hold = KC_F11 },
|
{ .is_pressed = false, .is_double = false, .timer = 0, .kc_tap = KC_ESC, .kc_hold = KC_F11 },
|
||||||
|
@ -40,8 +25,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return process_record_user_taphold(keycode, record)
|
return process_record_user_taphold(keycode, record);
|
||||||
&& process_record_keymap(keycode, record);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static uint16_t prev_th_key = KC_NO;
|
static uint16_t prev_th_key = KC_NO;
|
||||||
|
@ -95,3 +79,8 @@ void matrix_scan_tap_hold(taphold_state state) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void matrix_scan_user(void) {
|
||||||
|
matrix_scan_tap_hold(HELD);
|
||||||
|
}
|
||||||
|
|
|
@ -79,7 +79,7 @@ enum keycodes {
|
||||||
_______, _______, _______, _______, _______, _______, _______, KC_LCTL, KC_LCTL, _______, _______, XXXXXXX
|
_______, _______, _______, _______, _______, _______, _______, KC_LCTL, KC_LCTL, _______, _______, XXXXXXX
|
||||||
|
|
||||||
#define RAISE_LAYER \
|
#define RAISE_LAYER \
|
||||||
QK_RBT, XXXXXXX, XXXXXXX, XXXXXXX, DF(_QWERTY), XXXXXXX, XXXXXXX, DF(_COLEMAK), XXXXXXX, XXXXXXX, XXXXXXX, TO(_WOW), \
|
QK_BOOT, XXXXXXX, XXXXXXX, XXXXXXX, DF(_QWERTY), XXXXXXX, XXXXXXX, DF(_COLEMAK), XXXXXXX, XXXXXXX, XXXXXXX, TO(_WOW), \
|
||||||
DB_TOGG, XXXXXXX, XXXXXXX, KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_UP, KC_END, XXXXXXX, KC_DEL, \
|
DB_TOGG, XXXXXXX, XXXXXXX, KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_UP, KC_END, XXXXXXX, KC_DEL, \
|
||||||
_______, KC_LGUI, KC_LALT, XXXXXXX, KC_LCTL, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RIGHT, XXXXXXX, _______, \
|
_______, KC_LGUI, KC_LALT, XXXXXXX, KC_LCTL, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RIGHT, XXXXXXX, _______, \
|
||||||
KC_CAPS, _______, _______, _______, _______, _______, XXXXXXX, KC_PGUP, XXXXXXX, KC_PGDN, XXXXXXX, _______, \
|
KC_CAPS, _______, _______, _______, _______, _______, XXXXXXX, KC_PGUP, XXXXXXX, KC_PGDN, XXXXXXX, _______, \
|
||||||
|
@ -99,7 +99,7 @@ enum keycodes {
|
||||||
KC_TAB, KC_H, KC_Q, KC_W, KC_E, KC_R, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT, \
|
KC_TAB, KC_H, KC_Q, KC_W, KC_E, KC_R, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT, \
|
||||||
KC_TAB, KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, \
|
KC_TAB, KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, \
|
||||||
KC_LSFT, KC_Z, KC_X, KC_N, KC_C, KC_V, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \
|
KC_LSFT, KC_Z, KC_X, KC_N, KC_C, KC_V, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \
|
||||||
KC_M, KC_Y, KC_LALT, KC_LCTL, KC_SPC, KC_P, KC_BSPC, KC_DEL, KC_DEL, KC_LGUI, KC_PSCREEN, TO(_COLEMAK)
|
KC_M, KC_Y, KC_LALT, KC_LCTL, KC_SPC, KC_P, KC_BSPC, KC_DEL, KC_DEL, KC_LGUI, KC_PSCR, TO(_COLEMAK)
|
||||||
|
|
||||||
// tap-hold settings
|
// tap-hold settings
|
||||||
#define TH_DELAY 300
|
#define TH_DELAY 300
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
SRC += ncsibra.c
|
SRC += ncsibra.c
|
||||||
|
|
||||||
|
CONSOLE_ENABLE = yes
|
||||||
NKRO_ENABLE = yes
|
NKRO_ENABLE = yes
|
||||||
LEADER_ENABLE = no
|
LEADER_ENABLE = no
|
||||||
COMBO_ENABLE = no
|
COMBO_ENABLE = no
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue