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

Layer toggles across ergodox can get stuck in the wrong state #66

Closed
r4v5 opened this issue Oct 19, 2015 · 8 comments

Comments

Projects
None yet
5 participants
@r4v5
Copy link
Contributor

commented Oct 19, 2015

With the "stock" ergodox layout, pressing the two f1 keys at the same time (across both keyboards) and then releasing them in order will lock the keyboard in Layer 1 until the process is repeated.

Steps to reproduce:

  • Press down left half's f1 key
  • Press down right half's f1 key
  • Release left half's f1 key
  • Release right half's f1 key
  • Observe the keyboard thinks it's back on L1 now.

I'd expect f1 to be cleared when both keys are up, and if you release the second key before the first, this does indeed happen. Also, when using a layout that has multiple f1 keys on the same half-keyboard, this issue does not seem to manifest for those two keys, so it seems that operating across the split is required.

@haata

This comment has been minimized.

Copy link
Member

commented Oct 19, 2015

Yep, definitely a bug.
I've reproduced it here. I think the issue is that the shift current XOR's the current state. But since it's XOR'd twice it's getting confused.

I should be able to fix it in the next few days, but if someone gets impatient, this is where the code is:
https://github.com/kiibohd/controller/blob/master/Macro/PartialMap/macro.c#L171

@Duckle29

This comment has been minimized.

Copy link

commented Dec 17, 2015

Just wanted to chime in. Happens on my MD1 as well, with this layout image of my layout

@ntietz

This comment has been minimized.

Copy link
Contributor

commented Oct 9, 2016

I've also run into this on my Infinity Ergodox. I am interested in contributing a fix. @haata can you point me in the right direction on this?

@haata

This comment has been minimized.

Copy link
Member

commented Oct 9, 2016

Basically, in this function (and the functions calling it) https://github.com/kiibohd/controller/blob/master/Macro/PartialMap/macro.c#L139

I believe what's happening is I'm using an XOR instead of just a set/unset. This means if you pressed two Shift keys at different times (now the layer is temporarily unset). But release them at the same time (I think this is what's happening), it will only unset once.

It should be possible to fix this by strengthening the logic a bit more. Instead of blindly setting every time the function is called.

@ntietz

This comment has been minimized.

Copy link
Contributor

commented Oct 10, 2016

I've submitted a PR that should resolve the issue, assuming the CI checks are successful. On my Infinity Ergodox, it fixes things.

@ntietz

This comment has been minimized.

Copy link
Contributor

commented Oct 14, 2016

@haata I believe this has been resolved, can we close the issue?

@haata

This comment has been minimized.

Copy link
Member

commented Oct 14, 2016

Sure, still need to update the configurator, @jbondeson will take care of that.

@haata haata closed this Oct 14, 2016

@jbondeson

This comment has been minimized.

Copy link
Contributor

commented Oct 14, 2016

@haata Configurator has been updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.