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

ESC key not detecting key being pressed #117

Closed
HomerSp opened this issue Nov 11, 2020 · 6 comments · Fixed by #118
Closed

ESC key not detecting key being pressed #117

HomerSp opened this issue Nov 11, 2020 · 6 comments · Fixed by #118
Labels
bug Something isn't working

Comments

@HomerSp
Copy link

HomerSp commented Nov 11, 2020

Using the latest 0.2.3 firmware the ESC key doesn't behave as it should. It no longer detects when it's being pressed, instead it triggers both press and release when I release the key. This can cause issues in games as the time between press and release is abnormally small (around 2ms in my testing) and I think some games check for this because the esc key only works around 1 in 10 presses (sometimes it works immediately, other times I have to press it 20 times). As a test I added a macro that would press the esc key, delay by 100ms and then release it and all games I've tested register it fine now.
This works fine on the 0.2.2 firmware where the press and release events are generated as expected. I've also tested every 0.2.3 beta firmware and they all exhibit this problem.

Only the ESC key has this issue - all other keys work as expected.

Steps to reproduce the behavior:

  1. Flash latest 0.2.3 firmware.
  2. Use a keyboard tester to get key events (I use xev on Linux)
  3. Press and release the ESC key.
  4. Both the press and release events should appear when you release the key.

Expected behavior
Pressing the ESC key should generate one event, and releasing it should generate another.

Desktop (please complete the following information):

  • OS: KDE Neon 5.19 (Ubuntu 20.04)
  • Bazecor Version: [e.g. 0.1.0]

Additional context
Here's the relevant output from xev, time is in milliseconds:

xev output 0.2.2:
KeyPress event, serial 40, synthetic NO, window 0x6000001,
root 0x6cb, subw 0x0, time 6882090, (68,53), root:(68,122),
state 0x10, keycode 9 (keysym 0xff1b, Escape), same_screen YES,
XLookupString gives 1 bytes: (1b) "
XmbLookupString gives 1 bytes: (1b) "
XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x6000001,
root 0x6cb, subw 0x0, time 6882301, (68,53), root:(68,122),
state 0x10, keycode 9 (keysym 0xff1b, Escape), same_screen YES,
XLookupString gives 1 bytes: (1b) "
XFilterEvent returns: False

xev output 0.2.3:
KeyPress event, serial 40, synthetic NO, window 0x6000001,
root 0x6cb, subw 0x0, time 7797394, (28,73), root:(28,142),
state 0x10, keycode 9 (keysym 0xff1b, Escape), same_screen YES,
XLookupString gives 1 bytes: (1b) "
XmbLookupString gives 1 bytes: (1b) "
XFilterEvent returns: False

KeyRelease event, serial 40, synthetic NO, window 0x6000001,
root 0x6cb, subw 0x0, time 7797396, (28,73), root:(28,142),
state 0x10, keycode 9 (keysym 0xff1b, Escape), same_screen YES,
XLookupString gives 1 bytes: (1b) "
XFilterEvent returns: False

@HomerSp HomerSp added the bug Something isn't working label Nov 11, 2020
@AlexDygma
Copy link
Member

AlexDygma commented Nov 11, 2020

Hello @HomerSp ! thanks for the detailed bug report, ill look into this asap, the most probable origin for the bug is the "update" we did of the kaleidoscope repository, the recent changes may have caused this issues. so reverting them is easy for the time being.

I'll release something today to patch this even if i do find the root cause or i have to revert back to an older kaleidoscope version.

@AlexDygma
Copy link
Member

So i managed to reproduce the problem and it comes from the Escape-OneShot plugin from Kaleidoscope's repository.

They updated it's behaviour 3 months ago and we just synced the repo from that date up to today, i'll try modifying the way its working so that it does what it should.

If i'm not able to, ill disable the Oneshot Escape plugin because it's rarely used (the user can just wait for 2.5 seconds instead of pressing esc if you make a mistake).

later ill upload a corrected version of Bazecor with the updated Firmware attached to it so we solve this for everyone.

@HomerSp
Copy link
Author

HomerSp commented Nov 11, 2020

Thanks! I actually built the firmware from your repo to see if I could track the issue down, but it seems like the built firmware is still at 0.2.2? It looks to be missing macro support at least. Is there a trick to getting it to work, or is that code not public just yet?

Good that you've managed to reproduce and track it down though!

@AlexDygma
Copy link
Member

Thanks! I actually built the firmware from your repo to see if I could track the issue down, but it seems like the built firmware is still at 0.2.2? It looks to be missing macro support at least. Is there a trick to getting it to work, or is that code not public just yet?

Good that you've managed to reproduce and track it down though!

Yea! it's not at 0.2.2 but the macros are buggy in the default kaleidoscope repo, and i haven't been able to push them the changes for the DynamicMacros file because they would have to approve them so i am custom building the firmwares for the raise until today.

now that we have finished building the feature, i am starting to clean the repo and organize the changes, and will import the DynamicMacros plugin to our project to make the necessary changes for it to work when compiled. then will push them to their repo so they can take the time they need to review/approve them.

Btw i already found the bug, it's located in Escape-Oneshot plugin, a change was made that created a local memory for that function to avoid sending ESC keys when you are cancelling a Oneshot function, but the code was before the identification of the Oneshot so it blocked any Esc key press that happened either with or without Oneshot.

i'm going to build a new Bazecor version with the FW attached so i can solve this for everyone and then continue cleaning the repo.

@HomerSp
Copy link
Author

HomerSp commented Nov 11, 2020

Ah, that makes sense - explains why I couldn't find any of the macro code in the repos (except for bazecor). And yeah, it can be quite a pain depending on external projects that you have no control over.

Thanks for looking into this so quickly, by the way! Just tested that PR and it is indeed working as intended now.

@AlexDygma
Copy link
Member

You're Welcome! this was easy to fix, but it even can prevent flasing as #120 says! need to keep an eye on it 😕

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants