Skip to content

Commit

Permalink
Improve naming
Browse files Browse the repository at this point in the history
  • Loading branch information
drashna committed Apr 6, 2020
1 parent b1b5176 commit f62426c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions quantum/quantum.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,21 +149,21 @@ void reset_keyboard(void) {
}

/* Convert record into usable keycode via the contained event. */
uint16_t get_record_keycode(keyrecord_t *record, bool do_update) { return get_event_keycode(record->event, do_update); }
uint16_t get_record_keycode(keyrecord_t *record, bool update_layer_cache) { return get_event_keycode(record->event, update_layer_cache); }

/* Convert event into usable keycode. Checks the layer cache to ensure that it
* retains the correct keycode after a layer change, if the key is still pressed.
* "do_update" is to ensure that it only updates the layer cache when appropriate,
* otherwise, it will update it and cause layer tap (and other keys) from
* triggering properly.
* "update_layer_cache" is to ensure that it only updates the layer cache when
* appropriate, otherwise, it will update it and cause layer tap (and other keys)
* from triggering properly.
*/
uint16_t get_event_keycode(keyevent_t event, bool do_update) {
uint16_t get_event_keycode(keyevent_t event, bool update_layer_cache) {
#if !defined(NO_ACTION_LAYER) && !defined(STRICT_LAYER_RELEASE)
/* TODO: Use store_or_get_action() or a similar function. */
if (!disable_action_cache) {
uint8_t layer;

if (event.pressed && do_update) {
if (event.pressed && update_layer_cache) {
layer = layer_switch_get_layer(event.key);
update_source_layers_cache(event.key, layer);
} else {
Expand Down
4 changes: 2 additions & 2 deletions quantum/quantum.h
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ void matrix_init_kb(void);
void matrix_scan_kb(void);
void matrix_init_user(void);
void matrix_scan_user(void);
uint16_t get_record_keycode(keyrecord_t *record, bool do_update);
uint16_t get_event_keycode(keyevent_t event, bool do_update);
uint16_t get_record_keycode(keyrecord_t *record, bool update_layer_cache);
uint16_t get_event_keycode(keyevent_t event, bool update_layer_cache);
bool process_action_kb(keyrecord_t *record);
bool process_record_kb(uint16_t keycode, keyrecord_t *record);
bool process_record_user(uint16_t keycode, keyrecord_t *record);
Expand Down
2 changes: 1 addition & 1 deletion tmk_core/common/action_tapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define WAITING_BUFFER_SIZE 8

#ifndef NO_ACTION_TAPPING
uint16_t get_event_keycode(keyevent_t event, bool do_update);
uint16_t get_event_keycode(keyevent_t event, bool update_layer_cache);
uint16_t get_tapping_term(uint16_t keycode);
void action_tapping_process(keyrecord_t record);
#endif
Expand Down

0 comments on commit f62426c

Please sign in to comment.