summaryrefslogtreecommitdiff
path: root/quantum/action.c
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2021-11-01 19:18:33 +0000
committerGitHub <noreply@github.com>2021-11-01 19:18:33 +0000
commit92385e30cdad61ddfc0461b1ce1340bcb494a68a (patch)
treed472f93ed9f4e42e4972630d8178a387b91a51bc /quantum/action.c
parentee371c1295f00c119dd5a1bb2f3d4acedff832a7 (diff)
Manually format develop (#15003)
Diffstat (limited to 'quantum/action.c')
-rw-r--r--quantum/action.c83
1 files changed, 45 insertions, 38 deletions
diff --git a/quantum/action.c b/quantum/action.c
index 8c34b84ef1..5c33bd6d2c 100644
--- a/quantum/action.c
+++ b/quantum/action.c
@@ -821,9 +821,10 @@ void register_code(uint8_t code) {
}
#endif
- else if IS_KEY (code) {
- // TODO: should push command_proc out of this block?
- if (command_proc(code)) return;
+ else if
+ IS_KEY(code) {
+ // TODO: should push command_proc out of this block?
+ if (command_proc(code)) return;
#ifndef NO_ACTION_ONESHOT
/* TODO: remove
@@ -840,33 +841,35 @@ void register_code(uint8_t code) {
} else
*/
#endif
- {
- // Force a new key press if the key is already pressed
- // without this, keys with the same keycode, but different
- // modifiers will be reported incorrectly, see issue #1708
- if (is_key_pressed(keyboard_report, code)) {
- del_key(code);
+ {
+ // Force a new key press if the key is already pressed
+ // without this, keys with the same keycode, but different
+ // modifiers will be reported incorrectly, see issue #1708
+ if (is_key_pressed(keyboard_report, code)) {
+ del_key(code);
+ send_keyboard_report();
+ }
+ add_key(code);
send_keyboard_report();
}
- add_key(code);
+ }
+ else if
+ IS_MOD(code) {
+ add_mods(MOD_BIT(code));
send_keyboard_report();
}
- } else if IS_MOD (code) {
- add_mods(MOD_BIT(code));
- send_keyboard_report();
- }
#ifdef EXTRAKEY_ENABLE
- else if IS_SYSTEM (code) {
- host_system_send(KEYCODE2SYSTEM(code));
- } else if IS_CONSUMER (code) {
- host_consumer_send(KEYCODE2CONSUMER(code));
- }
+ else if
+ IS_SYSTEM(code) { host_system_send(KEYCODE2SYSTEM(code)); }
+ else if
+ IS_CONSUMER(code) { host_consumer_send(KEYCODE2CONSUMER(code)); }
#endif
#ifdef MOUSEKEY_ENABLE
- else if IS_MOUSEKEY (code) {
- mousekey_on(code);
- mousekey_send();
- }
+ else if
+ IS_MOUSEKEY(code) {
+ mousekey_on(code);
+ mousekey_send();
+ }
#endif
}
@@ -911,22 +914,26 @@ void unregister_code(uint8_t code) {
}
#endif
- else if IS_KEY (code) {
- del_key(code);
- send_keyboard_report();
- } else if IS_MOD (code) {
- del_mods(MOD_BIT(code));
- send_keyboard_report();
- } else if IS_SYSTEM (code) {
- host_system_send(0);
- } else if IS_CONSUMER (code) {
- host_consumer_send(0);
- }
+ else if
+ IS_KEY(code) {
+ del_key(code);
+ send_keyboard_report();
+ }
+ else if
+ IS_MOD(code) {
+ del_mods(MOD_BIT(code));
+ send_keyboard_report();
+ }
+ else if
+ IS_SYSTEM(code) { host_system_send(0); }
+ else if
+ IS_CONSUMER(code) { host_consumer_send(0); }
#ifdef MOUSEKEY_ENABLE
- else if IS_MOUSEKEY (code) {
- mousekey_off(code);
- mousekey_send();
- }
+ else if
+ IS_MOUSEKEY(code) {
+ mousekey_off(code);
+ mousekey_send();
+ }
#endif
}