So I have the following macro, the effect of which should be emulate the holding down of the alt and printscreen keys for a duration of one second:
static void altSysrqMacro(uint8_t keyState) {
uint32_t timeout = 1000;
static uint32_t end_time = 0;
if (keyToggledOn(keyState)) {
end_time = millis() + timeout;
}
if (millis() < end_time) {
kaleidoscope::hid::pressKey(Key_LeftAlt);
kaleidoscope::hid::pressKey(Key_PrintScreen);
}
}
(the reasons isn’t super-important right now, though if you’re interested the name gives a clue).
This used to work. It definitely worked when I first added it.
At some point in the process of upgrading to newer versions of the firmware, it stopped working. (I didn’t notice immediately since I don’t use the macro that often). The effect of it now (seen with xev) is that I get keypress events for alt and sysrq (alt+printscrn = sysrq) and then the corresponding keyrelease events for them immediately, without a 1s pause.
Anyone know why it no longer works? And/or whether there’s now any better way to accomplish the same thing?