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
Intermittently stops working over time, restarting Unshaky usually help #39
Comments
Right now I haven't seen any other incidents yet. Next time when you feel it does not work, open the debug window and type the same key repeatedly (and quickly). It should print "dismissed" for some events. Otherwise, we can investigate further. |
And recently I did not release any major changes, neither did Apple do to macOS. So if it works before it should continue to work. 🤔 |
I have this same issue occasionally where it becomes less effective over time. If I close the app and reopen it the problem goes away. I installed it about a week ago and it completely fixed my issues with the keyboard, then after a day I noticed that the issue had come back, and saw that the app had closed itself. When I turned it back on it worked fine for a while, then suddenly had the same issue again where it stopped working randomly, and I had to close the app again to get it working. Really insane that on a $3500 computer we need an app like this to be able to use the computer without giving our laptop to Apple for several weeks to fix a simple issue. |
So I ran the debugger while typing t his responsea nd this is the raw output of thekeyboardwithout any typos. I'm not really sure what's going on. It seems like some of the keys are being recorded incorrectly? I fixed all of my own typos. The double spaces and typos are the result of the keyboard with the app running. |
@nmercuro it closing itself is odd, can you open the two interesting findings made me suspect your
|
Yea, I'm thinking that the space bar is intermittently both not registering keypresses AND registering 2-3 keypresses when there was only 1. Quite frustrating. |
@nmercuro For the "close itself" part, search "Unshaky" in the console.app to see if there is anything there. Otherwise I will add some crash report feature directly into Unshaky. |
I also noticed this issue. The app intermittently stops working, but restarting it fixes the issue. Otherwise that, great app! Thanks for making it @aahung! |
We had a little discussion in #40 and implementing some "recovery mechanism" is a feasible workaround. |
@aahung I see no mentions of |
@chmac then it must lose the event tap (listener) naturally (not crashed). I just made some modifications and hope it can resolve the problem. Also I put a simple recovery mechanism, and when you click the Unshaky status bar item, it will be triggered. Try v0.4.7 (alpha) to see if the issue persists. |
In my case I just observed Unshakey not working and the debug window showed no keys being captured. Restart fixed the issue. |
Can you try v0.4.7? I am not sure if it can be fixed with v0.4.7. |
Still not working entirely with 0.4.7. Sometimes I reset the app and it works better and other times it doesn't. |
Here's a nexample of me typing into chrome. What's interesting is that it seems to work better in certain apps? For instance, in chrome, it's dismissing a lot of erroneous keypresses, but in "Spark", the e-mail client I use, almost every other word has an extra space or similar. Perhaps the capture isn't working in certain apps? Is there a way to find out? |
v0.4.7 implements a mechanism when you click Unshaky in status bar it auto try to recover itself. If clicking Unshaky in status bar has same effect as restarting Unshaky, please let me know, so I can make the rauto-recovery more aggressive.
I don't think Chrome and Spark could have differences since Unshaky works at a lower level than these applications. Unless we do some controlled study we don't know if this "feel" is consistent over time. When it does not seem to work in Spark, do you have any log? |
It really seems random now that I've tested it a bit more. Chrome is especially bad when writing on FB or similar, but I guess it's just be USA you're typing more?
…On Apr 9, 2019, 15:54 -0700, _sam ***@***.***>, wrote:
v0.4.7 implements a mechanism when you click Unshaky in status bar it auto try to recover itself. If clicking Unshaky in status bar has same effect as restarting Unshaky, please let me know, so I can make the rauto-recovery more aggressive.
> Perhaps the capture isn't working in certain apps? Is there a way to find out?
I don't think Chrome and Spark could have differences since Unshaky works at a lower level than these applications. Unless we do some controlled study we don't know if this "feel" is consistent over time. When it does not seem to work in Spark, do you have any log?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I downloaded 0.4.7 to see if it's much better. It seems about the same, so I'm thinking it's probably just the keyboard vs the app. It's hardt o tell exactly what's happening to see what could be implemented to make Unshaky more effective. Here's the raw output of my keyboard whiel typing, along with the log. I only have unshaky enabled for T and Space since those are the main keys that seme to have issues. |
Seems Unshaky is working as expected for the log you provide. To be honest I don’t know what to look for in your case. The event tapping is obviously on. Maybe in your case Unshaky cannot receive keyboard events properly due to some software conflicts? |
It's possible. Anything you can think of that might conflict? It's also possible my keyboard is just a total loss and I need to send it to Apple for a week to replace.
…On Apr 10, 2019, 00:08 -0700, _sam ***@***.***>, wrote:
Seems Unshaky is working in the expected condition for the log you provide. To be honest I don’t know what to look for in your case. The event tapping is obviously on. Maybe in your case Unshaky cannot receive keyboard events properly due to some software conflicts?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I've been trying to log a bit more to try and understand what's going on. It seems like based on he log, sometimes they keypresses are out of order? Like the logging or key capture can't keep up with the typing? For example: In this string, I typed "Before we". But you can see that the sequence of letters is the following: b press, b release, e press, e release, f press, f release, o press, r press, o release, e press, r release, space press, e release, space release, w press, e press, space press, w release, space release, e release, space press, space release.
I think the issue here is how Unshakey works. Because it's 'listening' for a press and release within a given timeframe, the fact that there are other presses and releases mixed up with legitimate presses and releases seems make it think everything is fine. Here's another example. In the original text, make had an extra space after it. You can see in the logging that it didn't catch the double space because the "Press and release" is out of order. M & A were pressed before either was released. That didn't create a problem because those keys aren't duplicating key presses. But when I hit space bar, it doesn't register the release ofthe e key until after it registers the space press and release, which makes it think it's ok to allow the second space since another key has been pressed in between. One possible solution might be to set up an even more aggressive mode that doesn't allow a keypress at all within a specified period of time, vs allowing the keypress if another key has been pressed in between? Or perhaps only track the "Press" vs caring about the release. This out of order (Happened again here, I'll attach the log below) capture happens every time I get an erroneous space. I can't think of any reason why the out of order presses would be hardware related, because that would result in out of order typing wouldn't it?
|
The "out of order presses" scenario you mentioned above is what actually happens when you types. when you press down a key, let's say "w", "w" will be registered, and if you type very fast, you are very likely to press down another key, let's say "e", before you release "w". This is totally normal and you will end up typing "we" as a result, because "pressing" is where macOS register your typing.
I don't think it will result in out of order typing. "press" event is when the letter being typed.
"hitting space bar" does not necessary release your "e" key. It might be your "e" key not bouncing back instantly, creating a delay. |
Unshaky treats each key separately and key A's press/release won't affect key B's handling.
Unshaky does not listen, how it works is totally passive. It only register a handler to macOS's session event loop. When you press a key, macOS will call the handler to decide whether to block it or not. |
@nmercuro I also looked into your log but without flagging which key presses "should have been but was not blocked", not much I can do to find a pattern. :-( |
I see. I guess what I'm seeing is that sometimes I'll press a key and it registers the space, but then registers the release of the first key and the erroneous space comes in later, so it looks like it's ignoring the second space because there's another keypress in between. Really though, the sequence of the keys is press "e" press "space".
I'll try to do some more logging where I capture the logs with the raw output I'm typing so you can match up the text to the log. As of right now though; it doesn't seem like it's detecting the "second space" event at all, either because it's registering the event late, or the behavior of the second press isn't what it expects to see. It does occasionally dismiss the erroneous spaces, but I can write an email similar in length to this, and there might be 20-30 double spaces with only 3-4 dismissed. I wish it worked! Because it's a great app.
Thanks for putting in the time to help where Apple won't!
…On Apr 11, 2019, 17:21 -0700, _sam ***@***.***>, wrote:
@nmercuro I also looked into your log but without flagging which key presses "should be but was not blocked", not much I can do to find a pattern. :-(
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@aahung yeah and I can see you already enlarge the delay of space to 60ms. If we can find some extra pattern among your space events we might be able to implement some extra mechanism to counteract it. Otherwise keep enlarging delay of space could alleviate this problem but will block some false positives. |
Yes, I was playing with the delay; but it doesn't seem like it helps much. And I type so fast that anything above about 45-50 on the space bar results in the opposite problem of blocking intentional spaces.
…On Apr 12, 2019, 08:38 -0700, _sam ***@***.***>, wrote:
@aahung yeah and I can see you already enlarge the delay of space to 60ms. If we can find some extra pattern among your space events we might be able to implement some extra mechanism to counteract it. Otherwise keep enlarging delay of space could alleviate this problem but will block some false positives.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
WORKAROUND |
Is there a way to reset statistics? |
@andreynering |
@BobbyC777 You're welcome 😉 |
@BobbyC777 Pro tip, replacing the keyboard on a mac laptop usually includes the battery, so you if unshaky solves your problem, you might want to wait until the laptop is a year or three old and then get it serviced by apple! :-) |
@callum Macdonald -
Great tip & one that helps me rationalize procrastination ! Thanks! It
irks me to spend this much for a laptop (way more than normal for me) and
then have a problem like this. My first Apple computer <sigh>. (And if
you're listening thanks to Sam Liu for writing unshaky!)
…On Thu, Oct 31, 2019 at 10:43 AM Callum Macdonald ***@***.***> wrote:
@BobbyC777 <https://github.com/BobbyC777> Pro tip, replacing the keyboard
on a mac laptop usually includes the battery, so you if unshaky solves your
problem, you might want to wait until the laptop is a year or three old and
then get it serviced by apple! :-)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#39?email_source=notifications&email_token=ANUSV4YY3KSO3MGQCMX2B3DQRLVHJA5CNFSM4G5EKJC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECYA4XQ#issuecomment-548408926>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANUSV4YBHKH2IGBEIOCA5JTQRLVHJANCNFSM4G5EKJCQ>
.
|
close now. We could not find the cause of the issue, neither can I reproduce it. :-( |
Maybe It's just a feeling, but sometimes I feel unshaky is opened and not working as expected.
I close it, and the open it again and it seems to work correctly again... Could it be possible or it's just a reiterative coincidence? 😕
The text was updated successfully, but these errors were encountered: