This is not complete, but it does test the two basic cases of a double-tap and a tap-then-hold (to produce a single primary key value hold in output) on all three types of qukeys (Generic, DualUse, SpaceCadet). Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>pull/1024/head
parent
20cb771dbf
commit
8b1bf403c3
@ -0,0 +1,62 @@
|
||||
/* -*- mode: c++ -*-
|
||||
* Copyright (C) 2020 Keyboard.io, Inc.
|
||||
*
|
||||
* 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, version 3.
|
||||
*
|
||||
* 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 <Kaleidoscope.h>
|
||||
#include <Kaleidoscope-Qukeys.h>
|
||||
|
||||
#include "./common.h"
|
||||
|
||||
// *INDENT-OFF*
|
||||
KEYMAPS(
|
||||
[0] = KEYMAP_STACKED
|
||||
(
|
||||
Key_A, Key_LeftAlt, ___, ___, ___, ___, ___,
|
||||
SFT_T(J), ___, ___, ___, ___, ___, ___,
|
||||
___, ___, ___, ___, ___, ___,
|
||||
___, ___, ___, ___, ___, ___, ___,
|
||||
___, ___, ___, ___,
|
||||
___,
|
||||
|
||||
___, ___, ___, ___, ___, ___, ___,
|
||||
___, ___, ___, ___, ___, ___, ___,
|
||||
___, ___, ___, ___, ___, ___,
|
||||
___, ___, ___, ___, ___, ___, ___,
|
||||
___, ___, ___, ___,
|
||||
___
|
||||
),
|
||||
)
|
||||
// *INDENT-ON*
|
||||
|
||||
// Use Qukeys
|
||||
KALEIDOSCOPE_INIT_PLUGINS(Qukeys);
|
||||
|
||||
void setup() {
|
||||
QUKEYS(
|
||||
kaleidoscope::plugin::Qukey(0, KeyAddr(0, 0), Key_LeftGui),
|
||||
kaleidoscope::plugin::Qukey(0, KeyAddr(0, 1), Key_B)
|
||||
)
|
||||
Qukeys.setHoldTimeout(kaleidoscope::testing::QUKEYS_HOLD_TIMEOUT);
|
||||
Qukeys.setOverlapThreshold(kaleidoscope::testing::QUKEYS_OVERLAP_THRESHOLD);
|
||||
Qukeys.setMinimumHoldTime(kaleidoscope::testing::QUKEYS_MINIMUM_HOLD_TIME);
|
||||
Qukeys.setMinimumPriorInterval(kaleidoscope::testing::QUKEYS_MIN_PRIOR_INTERVAL);
|
||||
Qukeys.setMaxIntervalForTapRepeat(kaleidoscope::testing::QUKEYS_MAX_TAP_REPEAT_INTERVAL);
|
||||
|
||||
Kaleidoscope.setup();
|
||||
}
|
||||
|
||||
void loop() {
|
||||
Kaleidoscope.loop();
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
// -*- mode: c++ -*-
|
||||
|
||||
/* Kaleidoscope - Firmware for computer input devices
|
||||
* Copyright (C) 2020 Keyboard.io, Inc.
|
||||
*
|
||||
* 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, version 3.
|
||||
*
|
||||
* 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
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace kaleidoscope {
|
||||
namespace testing {
|
||||
|
||||
constexpr uint16_t QUKEYS_HOLD_TIMEOUT = 200;
|
||||
constexpr uint8_t QUKEYS_OVERLAP_THRESHOLD = 0;
|
||||
constexpr uint8_t QUKEYS_MINIMUM_HOLD_TIME = 0;
|
||||
constexpr uint8_t QUKEYS_MIN_PRIOR_INTERVAL = 0;
|
||||
constexpr uint8_t QUKEYS_MAX_TAP_REPEAT_INTERVAL = 20;
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"cpu": {
|
||||
"fqbn": "keyboardio:virtual:model01",
|
||||
"port": ""
|
||||
}
|
||||
}
|
@ -0,0 +1,134 @@
|
||||
VERSION 1
|
||||
|
||||
KEYSWITCH A 0 0
|
||||
KEYSWITCH B 0 1
|
||||
KEYSWITCH J 1 0
|
||||
|
||||
# ==============================================================================
|
||||
# Qukey tap-repeat test
|
||||
NAME TapRepeat Generic Qukey
|
||||
|
||||
RUN 10 ms
|
||||
|
||||
PRESS A
|
||||
RUN 5 ms
|
||||
|
||||
RELEASE A
|
||||
RUN 1 cycle
|
||||
EXPECT keyboard-report Key_A # Report should contain only A
|
||||
RUN 5 ms
|
||||
|
||||
PRESS A
|
||||
RUN 5 ms
|
||||
|
||||
RELEASE A
|
||||
RUN 2 cycles
|
||||
EXPECT keyboard-report empty # Report should be empty
|
||||
EXPECT keyboard-report Key_A # Report should contain only A
|
||||
|
||||
RUN 16 ms
|
||||
EXPECT keyboard-report empty # Report should be empty
|
||||
|
||||
RUN 100 ms
|
||||
|
||||
PRESS A
|
||||
RUN 5 ms
|
||||
|
||||
RELEASE A
|
||||
RUN 1 cycle
|
||||
EXPECT keyboard-report Key_A # Report should contain only A
|
||||
RUN 5 ms
|
||||
|
||||
PRESS A
|
||||
RUN 50 ms
|
||||
|
||||
RELEASE A
|
||||
# I'm not sure why this takes 2 cycles instead of just one
|
||||
RUN 2 cycles
|
||||
EXPECT keyboard-report empty # Report should be empty
|
||||
|
||||
# ==============================================================================
|
||||
# DualUse Qukey tap-repeat test
|
||||
NAME TapRepeat DualUse Qukey
|
||||
|
||||
RUN 10 ms
|
||||
|
||||
PRESS J
|
||||
RUN 5 ms
|
||||
|
||||
RELEASE J
|
||||
RUN 1 cycle
|
||||
EXPECT keyboard-report Key_J # Report should contain only J
|
||||
RUN 5 ms
|
||||
|
||||
PRESS J
|
||||
RUN 5 ms
|
||||
|
||||
RELEASE J
|
||||
RUN 2 cycles
|
||||
EXPECT keyboard-report empty # Report should be empty
|
||||
EXPECT keyboard-report Key_J # Report should contain only J
|
||||
|
||||
RUN 16 ms
|
||||
EXPECT keyboard-report empty # Report should be empty
|
||||
|
||||
RUN 100 ms
|
||||
|
||||
PRESS J
|
||||
RUN 5 ms
|
||||
|
||||
RELEASE J
|
||||
RUN 1 cycle
|
||||
EXPECT keyboard-report Key_J # Report should contain only J
|
||||
RUN 5 ms
|
||||
|
||||
PRESS J
|
||||
RUN 50 ms
|
||||
|
||||
RELEASE J
|
||||
# I'm not sure why this takes 2 cycles instead of just one
|
||||
RUN 2 cycles
|
||||
EXPECT keyboard-report empty # Report should be empty
|
||||
|
||||
# ==============================================================================
|
||||
# SpaceCadet Qukey tap-repeat test
|
||||
NAME TapRepeat SpaceCadet Qukey
|
||||
|
||||
RUN 10 ms
|
||||
|
||||
PRESS B
|
||||
RUN 5 ms
|
||||
|
||||
RELEASE B
|
||||
RUN 1 cycle
|
||||
EXPECT keyboard-report Key_B # Report should contain only B
|
||||
RUN 5 ms
|
||||
|
||||
PRESS B
|
||||
RUN 5 ms
|
||||
|
||||
RELEASE B
|
||||
RUN 2 cycles
|
||||
EXPECT keyboard-report empty # Report should be empty
|
||||
EXPECT keyboard-report Key_B # Report should contain only B
|
||||
|
||||
RUN 16 ms
|
||||
EXPECT keyboard-report empty # Report should be empty
|
||||
|
||||
RUN 100 ms
|
||||
|
||||
PRESS B
|
||||
RUN 5 ms
|
||||
|
||||
RELEASE B
|
||||
RUN 1 cycle
|
||||
EXPECT keyboard-report Key_B # Report should contain only B
|
||||
RUN 5 ms
|
||||
|
||||
PRESS B
|
||||
RUN 50 ms
|
||||
|
||||
RELEASE B
|
||||
# I'm not sure why this takes 2 cycles instead of just one
|
||||
RUN 2 cycles
|
||||
EXPECT keyboard-report empty # Report should be empty
|
Loading…
Reference in new issue