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

Fix Caps Word and Unicode Map #17247

Closed
wants to merge 1 commit into from
Closed

Conversation

kosorin
Copy link
Contributor

@kosorin kosorin commented May 30, 2022

Description

Caps Word doesn't work with Unicode Map pairs XP(a, A).

I changed order of calling process_caps_word in process_record_quantum. Moved it before process_unicode_common.

In unicode_input_start I just clear weak_mods. I don't know if it breaks anything else. I'm still a little bit confused with weak mods and how they work. Maybe save and restore weak_mods after sending unicode keys, just like mods? Or is it unnecessary?

User function caps_word_press_user can look like this:

bool caps_word_press_user(uint16_t keycode) {
    switch (keycode) {
        case KC_A ... KC_Z:
        case QK_UNICODEMAP_PAIR ... QK_UNICODEMAP_PAIR_MAX: // use whole range or filter only required pairs
            add_weak_mods(MOD_BIT(KC_LSFT));
            return true;

        default:
            return false;
    }
}

Btw I just noticed that there is also another bug fix (#17240) that changes the order of calling process_caps_word.

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@github-actions github-actions bot added the core label May 30, 2022
@tzarc
Copy link
Member

tzarc commented May 30, 2022

Similar class of issue as per #17240.
@drashna @getreuer probably need some input here, too.

@drashna drashna requested a review from a team May 30, 2022 16:12
@drashna drashna requested a review from a team May 30, 2022 16:13
Copy link
Contributor

@getreuer getreuer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. Thanks for submitting the fix!

@KarlK90
Copy link
Member

KarlK90 commented Jun 5, 2022

@kosorin your fix is part of #17284 which got merged to master. Thanks for your contribution, closing this.

@KarlK90 KarlK90 closed this Jun 5, 2022
@kosorin kosorin deleted the unicode-caps-word branch June 5, 2022 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants