summaryrefslogtreecommitdiffstats
path: root/quantum/action.c
diff options
context:
space:
mode:
authorQMK Bot <hello@qmk.fm>2021-11-17 12:28:38 -0800
committerGitHub <noreply@github.com>2021-11-18 07:28:38 +1100
commit2c5d66987da4c7d5857cab8b09c4f852b4d8e4d9 (patch)
tree3ddc4f2cc572c632a0027d31d6e3e86af03591bc /quantum/action.c
parentb06740c933c63a8f82e0a7112f9eeab9bd93687a (diff)
Format code according to conventions (#15193)
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 be135f18f2..208690f5e4 100644
--- a/quantum/action.c
+++ b/quantum/action.c
@@ -782,9 +782,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
@@ -801,33 +802,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
}
@@ -872,22 +875,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
}