Make OneShot.isStickable() overridable by user code

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

@ -118,7 +118,12 @@ bool OneShot::isSticky() {
// could potentially use three different color values for the three
// states (sticky | active && !sticky | pressed && !active).
__attribute__((weak))
bool OneShot::isStickable(Key key) {
return isStickableDefault(key);
}
bool OneShot::isStickableDefault(Key key) {
int8_t n;
if (key.isKeyboardModifier()) {
n = key.getKeyCode() - Key_LeftControl.getKeyCode();

@ -153,7 +153,10 @@ class OneShot : public kaleidoscope::Plugin {
key.getRaw() <= kaleidoscope::ranges::OS_LAST);
}
static bool isStickable(Key key); // inline?
/// Determine if the given `key` is allowed to become sticky.
static bool isStickable(Key key);
static bool isStickableDefault(Key key);
static bool isTemporary(KeyAddr key_addr); // inline?
static bool isSticky(KeyAddr key_addr); // inline?

Loading…
Cancel
Save