Skip to content

Commit b9cf8e7

Browse files
committed
core: Fix mechanical locking supoort #390
1 parent 12aa0fd commit b9cf8e7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

common/action.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
2727
#include "action_util.h"
2828
#include "action.h"
2929
#include "hook.h"
30+
#include "wait.h"
3031

3132
#ifdef DEBUG_ACTION
3233
#include "debug.h"
@@ -365,6 +366,7 @@ void register_code(uint8_t code)
365366
#endif
366367
add_key(KC_CAPSLOCK);
367368
send_keyboard_report();
369+
wait_ms(100);
368370
del_key(KC_CAPSLOCK);
369371
send_keyboard_report();
370372
}
@@ -375,6 +377,7 @@ void register_code(uint8_t code)
375377
#endif
376378
add_key(KC_NUMLOCK);
377379
send_keyboard_report();
380+
wait_ms(100);
378381
del_key(KC_NUMLOCK);
379382
send_keyboard_report();
380383
}
@@ -385,6 +388,7 @@ void register_code(uint8_t code)
385388
#endif
386389
add_key(KC_SCROLLLOCK);
387390
send_keyboard_report();
391+
wait_ms(100);
388392
del_key(KC_SCROLLLOCK);
389393
send_keyboard_report();
390394
}
@@ -440,6 +444,7 @@ void unregister_code(uint8_t code)
440444
#endif
441445
add_key(KC_CAPSLOCK);
442446
send_keyboard_report();
447+
wait_ms(100);
443448
del_key(KC_CAPSLOCK);
444449
send_keyboard_report();
445450
}
@@ -450,6 +455,7 @@ void unregister_code(uint8_t code)
450455
#endif
451456
add_key(KC_NUMLOCK);
452457
send_keyboard_report();
458+
wait_ms(100);
453459
del_key(KC_NUMLOCK);
454460
send_keyboard_report();
455461
}
@@ -460,6 +466,7 @@ void unregister_code(uint8_t code)
460466
#endif
461467
add_key(KC_SCROLLLOCK);
462468
send_keyboard_report();
469+
wait_ms(100);
463470
del_key(KC_SCROLLLOCK);
464471
send_keyboard_report();
465472
}

0 commit comments

Comments
 (0)