-
Notifications
You must be signed in to change notification settings - Fork 2
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
Double Shift Function often triggers unintentionally + Double Shift Action Improvement #4
Comments
Hello @MaxMoldmann , thank you for posting this issue. Also I apologize for late response due to finishing my semester at University. I've looked at your problem. To be honest I did not look for your possible workarounds, usually I want to solve it myself, but I appreciate your attempt to help me. My workaround:Added variable to remember last pressed (not released) key, and check if this key is equal to released key. If not, then it's obvious that this double-key command was interrupted via other key (in your case with ↑ key) and won't register it as first-hit of double-key command key. It also helped me to fix one problem with releasing double-key command, when it registers release of it as first hit of this command (happens with double Ctrl After few minutes I'll push and release fix version, where this mistake will be fixed. Thank you again for your issue post and hope that Keyshots is your #1 shortcuts plugin. Have a nice day! |
Currently published fixed version here, and in Obsidian as well: https://github.com/KrazyManJ/obsidian-keyshots/releases/tag/2.1.1 |
Thank you for the quick response! I appreciate it especially as being a Software Engineer myself. I feel like the quick search is now being activated unintentionally less often. However the issue is tricky and not fully fixed. You can reproduce the problem easily by writing something like "AB&C" in a note. If you write "AB" while holding shift then quickly holding Shift down in order to get to the "&" sign will activate Quick Search even before pressing the "&" key, while it should only do so with an intentional Double Shift while no other key is being pressed. |
Hello once and again, well, I've checked my code again and I am actually surprised that in your case these unintentional activations happened less often than before because I've forgotten one keyword in code to make my previous fix fully work. Due to that my code registered, that the keychain was interrupted, but was not cancelled and still registered as success key press. Now I am trying to make quick switch pop happen for like 5 minutes without any success and now, I can say, it seems to be fixed. I apologize for non-fixing my code properly, now I have a lot of stuff to do with Keyshots, so after refactoring few files, I'll again release fix for that and let you know here when it releases. Please stay patient. Also I'll leave this issue open until you'll let me know that it've been definitely fixed. |
Currently I've released fix release for this problem here: https://github.com/KrazyManJ/obsidian-keyshots/releases/tag/2.1.2 |
Thank you for your super fast response! Just on a side note: JetBrain IDE's trigger after the second shift-up (if within a certain time limit). Keyshots triggers earlier after the second Shift Key-down. I would suggest changing it to match what JetBrains does as the User still might want to write an Uppercase letter after pressing Shift and releasing Shift just before. So only after the second uninterrupted Shift Key-up you can be totally sure that the File open dialog was really intended by the user. |
@MaxMoldmann, this sounds like a pretty good improvement to actually make it work fully the same way as in JetBrains.
Right now I am finishing other project, but stay focused, this improve will be released soon! |
Hello @MaxMoldmann currently I've been working on additional Keyshots features and now, I've released version which fixes and improves all of what I've said above:
Release 2.2.0 is now available here: https://github.com/KrazyManJ/obsidian-keyshots/releases/tag/2.2.0 |
This is awesome! Thank you! |
While I find the JetBrains inspired Double Shift Function awesome it triggers unintentional many times every day.
This happens when using Shift to write an Uppercase letter (e.g. 'Shift' 'A') and then pressing Shift down again for any reason.
The resulting sequence like this: 'Shift-Down' 'A-Down' 'A-Up' 'Shift-Up' 'Shift-Down' should not trigger the Double Shift function, but it does.
Likely Root Cause:
The Keyshots plugin seems to count a Shift press even when there was another key pressed while Shift was pressed down.
Then a following Shift Down event triggers the function, although it should only trigger when there was no other Key event between a sequence of Shift Key down, Shift Key up, Shift Key down, Shift Key up events.
In other words Shift Key up should only count as one time pressed when there was only Shift Key down events since and no other key event.
Possible Workarounds:
Remember last key event. Look for Shift-Down event. If last key event was not also Shift-Down increase shift counter variable. Any other key event resets the shift counter variable to zero. Look for Shift-Up event. Increase Shift counter variable. If Shift counter variable hits 3 or 4 we know it is a real double shift and Shift Down and Shift Up came twice.
Does not fix Root cause, but might be simple and effective: Option to relax sensitivity. Internally this will look for Triple instead of Double Shifts
Does not fix Root cause: Add a short filter time that will ignore a double Shift event from counting when Shift Key Up and Shift Key Down happen too fast in sequence
Resource:
Javascript in Browser Keyboards Event Playground: https://www.w3docs.com/tools/editor/20348
The text was updated successfully, but these errors were encountered: