Add testcase for OneShot issue #896
Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>pull/1024/head
parent
add3ab4e83
commit
f1e727dba7
@ -0,0 +1,70 @@
|
|||||||
|
/* -*- 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-OneShot.h>
|
||||||
|
|
||||||
|
#include "./common.h"
|
||||||
|
|
||||||
|
// *INDENT-OFF*
|
||||||
|
KEYMAPS(
|
||||||
|
[0] = KEYMAP_STACKED
|
||||||
|
(
|
||||||
|
OSL(1), ___, ___, ___, ___, ___, ___,
|
||||||
|
Key_A, Key_B, ___, ___, ___, ___, ___,
|
||||||
|
___, ___, ___, ___, ___, ___,
|
||||||
|
___, ___, ___, ___, ___, ___, ___,
|
||||||
|
___, ___, ___, ___,
|
||||||
|
___,
|
||||||
|
|
||||||
|
___, ___, ___, ___, ___, ___, ___,
|
||||||
|
___, ___, ___, ___, ___, ___, ___,
|
||||||
|
___, ___, ___, ___, ___, ___,
|
||||||
|
___, ___, ___, ___, ___, ___, ___,
|
||||||
|
___, ___, ___, ___,
|
||||||
|
___
|
||||||
|
),
|
||||||
|
[1] = KEYMAP_STACKED
|
||||||
|
(
|
||||||
|
Key_X, ___, ___, ___, ___, ___, ___,
|
||||||
|
Key_C, Key_D, ___, ___, ___, ___, ___,
|
||||||
|
___, ___, ___, ___, ___, ___,
|
||||||
|
___, ___, ___, ___, ___, ___, ___,
|
||||||
|
___, ___, ___, ___,
|
||||||
|
___,
|
||||||
|
|
||||||
|
___, ___, ___, ___, ___, ___, ___,
|
||||||
|
___, ___, ___, ___, ___, ___, ___,
|
||||||
|
___, ___, ___, ___, ___, ___,
|
||||||
|
___, ___, ___, ___, ___, ___, ___,
|
||||||
|
___, ___, ___, ___,
|
||||||
|
___
|
||||||
|
),
|
||||||
|
)
|
||||||
|
// *INDENT-ON*
|
||||||
|
|
||||||
|
KALEIDOSCOPE_INIT_PLUGINS(OneShot);
|
||||||
|
|
||||||
|
void setup() {
|
||||||
|
Kaleidoscope.setup();
|
||||||
|
OneShot.time_out = 50;
|
||||||
|
OneShot.hold_time_out = 20;
|
||||||
|
OneShot.double_tap_time_out = 20;
|
||||||
|
}
|
||||||
|
|
||||||
|
void loop() {
|
||||||
|
Kaleidoscope.loop();
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
// -*- 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 {
|
||||||
|
|
||||||
|
} // namespace testing
|
||||||
|
} // namespace kaleidoscope
|
@ -0,0 +1,61 @@
|
|||||||
|
VERSION 1
|
||||||
|
|
||||||
|
KEYSWITCH OSL_1 0 0
|
||||||
|
KEYSWITCH A 1 0
|
||||||
|
KEYSWITCH B 1 1
|
||||||
|
|
||||||
|
# ==============================================================================
|
||||||
|
NAME OneShot next key
|
||||||
|
|
||||||
|
RUN 5 ms
|
||||||
|
|
||||||
|
PRESS OSL_1
|
||||||
|
RUN 5 ms
|
||||||
|
RELEASE OSL_1
|
||||||
|
RUN 10 ms
|
||||||
|
PRESS A
|
||||||
|
RUN 1 cycle
|
||||||
|
EXPECT keyboard-report Key_C # There should be only `C`
|
||||||
|
RUN 5 ms
|
||||||
|
RELEASE A
|
||||||
|
RUN 1 cycle
|
||||||
|
EXPECT keyboard-report empty # Report should be empty
|
||||||
|
|
||||||
|
# ==============================================================================
|
||||||
|
NAME OneShot double tap layer 896
|
||||||
|
|
||||||
|
RUN 5 ms
|
||||||
|
PRESS OSL_1
|
||||||
|
RUN 5 ms
|
||||||
|
RELEASE OSL_1
|
||||||
|
|
||||||
|
RUN 5 ms
|
||||||
|
PRESS OSL_1
|
||||||
|
RUN 5 ms
|
||||||
|
RELEASE OSL_1
|
||||||
|
|
||||||
|
RUN 50 ms
|
||||||
|
|
||||||
|
PRESS A
|
||||||
|
RUN 1 cycle
|
||||||
|
EXPECT keyboard-report Key_C # There should be only `C`
|
||||||
|
RUN 5 ms
|
||||||
|
RELEASE A
|
||||||
|
RUN 1 cycle
|
||||||
|
EXPECT keyboard-report empty # Report should be empty
|
||||||
|
|
||||||
|
RUN 10 ms
|
||||||
|
|
||||||
|
PRESS A
|
||||||
|
RUN 1 cycle
|
||||||
|
EXPECT keyboard-report Key_C # There should be only `C`
|
||||||
|
RUN 5 ms
|
||||||
|
RELEASE A
|
||||||
|
RUN 1 cycle
|
||||||
|
EXPECT keyboard-report empty # Report should be empty
|
||||||
|
|
||||||
|
RUN 5 ms
|
||||||
|
PRESS OSL_1
|
||||||
|
RUN 5 ms
|
||||||
|
RELEASE OSL_1
|
||||||
|
RUN 1 cycle
|
Loading…
Reference in new issue