summaryrefslogtreecommitdiff
path: root/quantum
diff options
context:
space:
mode:
authorQMK Bot <hello@qmk.fm>2022-02-21 09:44:27 -0800
committerGitHub <noreply@github.com>2022-02-21 17:44:27 +0000
commit2f0dc0fb6d36b43e0d143224e4a9058b77c4e0e3 (patch)
treeecdbdccbb5fde38e22f6228f6a20a4ca2fed8b99 /quantum
parent32903779181c31244c7c7b97a04bda0fd5b59de1 (diff)
downloadqmk_firmware-2f0dc0fb6d36b43e0d143224e4a9058b77c4e0e3.tar.gz
qmk_firmware-2f0dc0fb6d36b43e0d143224e4a9058b77c4e0e3.zip
Format code according to conventions (#16419)
Diffstat (limited to 'quantum')
-rw-r--r--quantum/action.c83
-rw-r--r--quantum/action.h2
2 files changed, 39 insertions, 46 deletions
diff --git a/quantum/action.c b/quantum/action.c
index 5e81efb671..7a330b05cd 100644
--- a/quantum/action.c
+++ b/quantum/action.c
@@ -834,10 +834,9 @@ 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
@@ -854,35 +853,33 @@ 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);
- send_keyboard_report();
- }
- add_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();
}
- }
- else if
- IS_MOD(code) {
- add_mods(MOD_BIT(code));
+ add_key(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
}
@@ -927,26 +924,22 @@ 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
}
diff --git a/quantum/action.h b/quantum/action.h
index b562f18c5b..8a357ded87 100644
--- a/quantum/action.h
+++ b/quantum/action.h
@@ -88,7 +88,7 @@ extern bool disable_action_cache;
/* Code for handling one-handed key modifiers. */
#ifdef SWAP_HANDS_ENABLE
-extern bool swap_hands;
+extern bool swap_hands;
extern const keypos_t PROGMEM hand_swap_config[MATRIX_ROWS][MATRIX_COLS];
# if (MATRIX_COLS <= 8)
typedef uint8_t swap_state_row_t;