Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Add key event check to is_tap_record and remove is_tap_key #18063

Merged
merged 2 commits into from
Aug 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions quantum/action.c
Original file line number Diff line number Diff line change
Expand Up @@ -1085,20 +1085,15 @@ void clear_keyboard_but_mods_and_keys() {
#endif
}

/** \brief Utilities for actions. (FIXME: Needs better description)
*
* FIXME: Needs documentation.
*/
bool is_tap_key(keypos_t key) {
action_t action = layer_switch_get_action(key);
return is_tap_action(action);
}

/** \brief Utilities for actions. (FIXME: Needs better description)
*
* FIXME: Needs documentation.
*/
bool is_tap_record(keyrecord_t *record) {
if (IS_NOEVENT(record->event)) {
return false;
}

#ifdef COMBO_ENABLE
action_t action;
if (record->keycode) {
Expand Down
1 change: 0 additions & 1 deletion quantum/action.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ void clear_keyboard(void);
void clear_keyboard_but_mods(void);
void clear_keyboard_but_mods_and_keys(void);
void layer_switch(uint8_t new_layer);
bool is_tap_key(keypos_t key);
bool is_tap_record(keyrecord_t *record);
bool is_tap_action(action_t action);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,6 @@ TEST_F(DefaultTapHold, tap_regular_key_while_layer_tap_key_is_held) {
}

TEST_F(DefaultTapHold, tap_mod_tap_hold_key_two_times) {
GTEST_SKIP() << "TODO:Holding a modtap key results in out of bounds access to the keymap, this is a bug in QMK.";

TestDriver driver;
InSequence s;
auto mod_tap_hold_key = KeymapKey(0, 1, 0, SFT_T(KC_P));
Expand Down Expand Up @@ -175,8 +173,6 @@ TEST_F(DefaultTapHold, tap_mod_tap_hold_key_two_times) {
}

TEST_F(DefaultTapHold, tap_mod_tap_hold_key_twice_and_hold_on_second_time) {
GTEST_SKIP() << "TODO:Holding a modtap key results in out of bounds access to the keymap, this is a bug in QMK.";

TestDriver driver;
InSequence s;
auto mod_tap_hold_key = KeymapKey(0, 1, 0, SFT_T(KC_P));
Expand Down