Add override of OneShot.isStickable() to testcase

Signed-off-by: Michael Richters <gedankenexperimenter@gmail.com>
pull/1062/head
Michael Richters 3 years ago
parent 25c975eae7
commit 9f65e808c0
No known key found for this signature in database
GPG Key ID: 1288FD13E4EEF0C0

@ -21,7 +21,7 @@
KEYMAPS( KEYMAPS(
[0] = KEYMAP_STACKED [0] = KEYMAP_STACKED
( (
Key_Insert, ___, ___, ___, ___, ___, ___, Key_Insert, OSM(LeftAlt), OSM(RightAlt), ___, ___, ___, ___,
Key_A, Key_B, ___, ___, ___, ___, ___, Key_A, Key_B, ___, ___, ___, ___, ___,
___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___,
___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___,
@ -51,6 +51,12 @@ class OneShotInsert : public Plugin {
} }
}; };
bool OneShot::isStickable(Key key) {
if (key == Key_LeftAlt)
return false;
return OneShot::isStickableDefault(key);
}
} // namespace plugin } // namespace plugin
} // namespace kaleidoscope } // namespace kaleidoscope

@ -1,6 +1,8 @@
VERSION 1 VERSION 1
KEYSWITCH INSERT 0 0 KEYSWITCH INSERT 0 0
KEYSWITCH LALT 0 1
KEYSWITCH RALT 0 2
KEYSWITCH A 1 0 KEYSWITCH A 1 0
KEYSWITCH B 1 1 KEYSWITCH B 1 1
@ -98,3 +100,69 @@ RUN 1 cycle
EXPECT keyboard-report empty EXPECT keyboard-report empty
RUN 5 ms RUN 5 ms
# ==============================================================================
NAME OneShot left alt not sticky
RUN 4 ms
PRESS LALT
RUN 1 cycle
EXPECT keyboard-report Key_LeftAlt
RUN 4 ms
RELEASE LALT
RUN 1 cycle
RUN 4 ms
PRESS LALT
RUN 1 cycle
RUN 4 ms
RELEASE LALT
RUN 1 cycle
EXPECT keyboard-report empty
RUN 5 ms
# ==============================================================================
NAME OneShot right alt sticky
RUN 4 ms
PRESS RALT
RUN 1 cycle
EXPECT keyboard-report Key_RightAlt
RUN 4 ms
RELEASE RALT
RUN 1 cycle
RUN 4 ms
PRESS RALT
RUN 1 cycle
RUN 4 ms
RELEASE RALT
RUN 1 cycle
RUN 4 ms
PRESS A
RUN 1 cycle
EXPECT keyboard-report Key_RightAlt Key_A
RUN 4 ms
RELEASE A
RUN 1 cycle
EXPECT keyboard-report Key_RightAlt
RUN 100 ms
RUN 4 ms
PRESS RALT
RUN 1 cycle
RUN 4 ms
RELEASE RALT
RUN 1 cycle
EXPECT keyboard-report empty
RUN 5 ms

Loading…
Cancel
Save