|
|
@ -18,10 +18,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
#include "./common.h"
|
|
|
|
#include "./common.h"
|
|
|
|
|
|
|
|
|
|
|
|
#undef min
|
|
|
|
|
|
|
|
#undef max
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// *INDENT-OFF*
|
|
|
|
// *INDENT-OFF*
|
|
|
|
KEYMAPS(
|
|
|
|
KEYMAPS(
|
|
|
|
[0] = KEYMAP_STACKED
|
|
|
|
[0] = KEYMAP_STACKED
|
|
|
@ -48,9 +44,12 @@ namespace plugin {
|
|
|
|
|
|
|
|
|
|
|
|
class IdleKeyDetector : public kaleidoscope::Plugin {
|
|
|
|
class IdleKeyDetector : public kaleidoscope::Plugin {
|
|
|
|
public:
|
|
|
|
public:
|
|
|
|
EventHandlerResult onKeyswitchEvent(Key &key, KeyAddr key_addr, uint8_t key_state) {
|
|
|
|
// handleKeyswitchEvent() is going to mask the underlying issue if it recurs,
|
|
|
|
if (key_addr == KeyAddr{0, 0} && key_state == 0) {
|
|
|
|
// but leaving this here is better than nothing.
|
|
|
|
handleKeyswitchEvent(Key_X, key_addr, IS_PRESSED | WAS_PRESSED);
|
|
|
|
EventHandlerResult onKeyswitchEvent(KeyEvent &event) {
|
|
|
|
|
|
|
|
if (event.addr == KeyAddr{0, 0} && event.state == 0) {
|
|
|
|
|
|
|
|
event.key = Key_X;
|
|
|
|
|
|
|
|
event.state = IS_PRESSED;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return EventHandlerResult::OK;
|
|
|
|
return EventHandlerResult::OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|