vial/combo: prototype
This commit is contained in:
parent
e0c7388e5d
commit
8ccef55b3e
@ -454,6 +454,7 @@ endif
|
|||||||
|
|
||||||
ifeq ($(strip $(VIAL_ENABLE)), yes)
|
ifeq ($(strip $(VIAL_ENABLE)), yes)
|
||||||
TAP_DANCE_ENABLE ?= yes
|
TAP_DANCE_ENABLE ?= yes
|
||||||
|
COMBO_ENABLE ?= yes
|
||||||
SRC += $(QUANTUM_DIR)/vial.c
|
SRC += $(QUANTUM_DIR)/vial.c
|
||||||
EXTRAINCDIRS += $(KEYMAP_OUTPUT)
|
EXTRAINCDIRS += $(KEYMAP_OUTPUT)
|
||||||
OPT_DEFS += -DVIAL_ENABLE -DNO_DEBUG
|
OPT_DEFS += -DVIAL_ENABLE -DNO_DEBUG
|
||||||
|
@ -126,6 +126,10 @@ bool process_combo(uint16_t keycode, keyrecord_t *record) {
|
|||||||
drop_buffer = false;
|
drop_buffer = false;
|
||||||
bool no_combo_keys_pressed = true;
|
bool no_combo_keys_pressed = true;
|
||||||
|
|
||||||
|
if (keycode == KC_NO) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (keycode == CMB_ON && record->event.pressed) {
|
if (keycode == CMB_ON && record->event.pressed) {
|
||||||
combo_enable();
|
combo_enable();
|
||||||
return true;
|
return true;
|
||||||
|
@ -16,6 +16,10 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#ifdef VIAL_ENABLE
|
||||||
|
#include "vial.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "progmem.h"
|
#include "progmem.h"
|
||||||
#include "quantum.h"
|
#include "quantum.h"
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
@ -200,6 +200,7 @@ void vial_handle_cmd(uint8_t *msg, uint8_t length) {
|
|||||||
case dynamic_vial_get_number_of_entries: {
|
case dynamic_vial_get_number_of_entries: {
|
||||||
memset(msg, 0, length);
|
memset(msg, 0, length);
|
||||||
msg[0] = VIAL_TAP_DANCE_ENTRIES;
|
msg[0] = VIAL_TAP_DANCE_ENTRIES;
|
||||||
|
msg[1] = VIAL_COMBO_ENTRIES;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case dynamic_vial_tap_dance_get: {
|
case dynamic_vial_tap_dance_get: {
|
||||||
@ -459,3 +460,17 @@ static void reload_tap_dance(void) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef VIAL_COMBO_ENABLE
|
||||||
|
const uint16_t PROGMEM test_combo[] = {KC_X, KC_Z, COMBO_END};
|
||||||
|
combo_t key_combos[COMBO_COUNT] = {COMBO_ACTION(test_combo)};
|
||||||
|
|
||||||
|
void process_combo_event(uint16_t combo_index, bool pressed) {
|
||||||
|
uprintf("combo event %d\n", combo_index);
|
||||||
|
if (pressed)
|
||||||
|
vial_keycode_down(0x5F12);
|
||||||
|
else
|
||||||
|
vial_keycode_up(0x5F12);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
@ -79,3 +79,19 @@ _Static_assert(sizeof(vial_tap_dance_entry_t) == 10, "Unexpected size of the via
|
|||||||
#undef VIAL_TAP_DANCE_ENTRIES
|
#undef VIAL_TAP_DANCE_ENTRIES
|
||||||
#define VIAL_TAP_DANCE_ENTRIES 0
|
#define VIAL_TAP_DANCE_ENTRIES 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef COMBO_ENABLE
|
||||||
|
#define VIAL_COMBO_ENABLE
|
||||||
|
|
||||||
|
#ifndef VIAL_COMBO_ENTRIES
|
||||||
|
#define VIAL_COMBO_ENTRIES 16
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* also to catch wrong include order in e.g. process_combo.h */
|
||||||
|
#ifdef COMBO_COUNT
|
||||||
|
#error COMBO_COUNT redefined - define VIAL_COMBO_ENTRIES instead
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define COMBO_COUNT VIAL_COMBO_ENTRIES
|
||||||
|
|
||||||
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user