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

SHIFT/CTRL + GRAVE_ESC not released correctly if SHIFT/CTRL is released first #1568

Closed
BalzGuenat opened this issue Aug 11, 2017 · 2 comments

Comments

@BalzGuenat
Copy link
Contributor

BalzGuenat commented Aug 11, 2017

To reproduce:

  1. Press and hold GUI or SHIFT.
  2. Press and hold GRAVE_ESC.
  3. Release GUI or SHIFT.
  4. Release GRAVE_ESC.

This will spam ` until the next keypress.

This is because when the ESC_GRAVE key is released, only the currently pressed mods are used to determine which keycode (GRAVE or ESC) gets released.

This looks like an issue that would arise with layers as well. We should look at how it's solved there.

@BalzGuenat
Copy link
Contributor Author

I have looked into how this issue is handled for layers.

The function that is responsible for finding the right keycode to release is store_or_get_action in action_layer.c. Looks like we store in source_layers_cache for every physical key the layer on which it was pressed (albeit in a complicated encoding). When a key is released, we look up the layer on which it was originally pressed, get the action of that key on that layer and run process_action with that action.

Since GRAVE_ESC does not work with normal layers, it's not possible to integrate the handling of this issue with the above mentioned source_layers_cache. A close analogue is also impossible, since GRAVE_KEY is not a physical key but a keycode.

I suggest we store the generated keycode when GRAVE_ESC is pressed so we can release the correct one once it's released. I will create a pull request for this shortly. If you disagree with the basic idea to solve this, we should discuss that here. If you just have comments concerning the particular implementation, put those on the pull request.

BalzGuenat added a commit to BalzGuenat/qmk_firmware that referenced this issue Aug 12, 2017
jackhumbert added a commit that referenced this issue Aug 15, 2017
@drashna
Copy link
Member

drashna commented Mar 25, 2018

This should be fixed.

Closing. If it's not, reopen or open a new issue, please!

@drashna drashna closed this as completed Mar 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants