Unshaky icon indicating copy to clipboard operation
Unshaky copied to clipboard

Unshaky with Punto Swithcer cause space bar deleting

Open ghost opened this issue 6 years ago • 10 comments

I use Punto Switcher because I have 2 keyboard layouts. This application helps me by hotkey change keyboard layout of the latest word, like from en to ru and otherwise. Very convenient if you forgot to change the layout. I have 60ms in Unshaky for spacebar and it deletes spacebar after when I'm using Punto. Only spacebar, with others everything is fine. It's not a big deal, but I always have to add additional spacebar, that's so annoying.

To Reproduce

  1. Set ms in Unshaky for the space bar
  2. Install Punto Switcher
  3. Write the word with the spacebar after
  4. Hit the punto's hotkey
  • macOS version: 10.14.4
  • Unshaky version : 0.4.6

ghost avatar Apr 17 '19 13:04 ghost

Can you use the Unshaky's debug window to capture the events? Also, can you try to turn on "ignore external keyboard" in configuration. Maybe the key events sent by Punto Switcher is not associated with the internal keyboard.

aahung avatar Apr 19 '19 01:04 aahung

possible duplicate with #54

aahung avatar Apr 22 '19 04:04 aahung

External keyboard option didn't help.

Here is when I wrote a word with space after and pressed Option (punto switcher hotkey):

1556113592.859066 Key( 58| 49|         Space|         0| 60) E(10)
1556113592.979099 Key( 58| 49|         Space|         0| 60) E(11)
1556113593.649640 Key( 58| 49|         Space|         0| 60) E(10)
1556113593.652340 Key( 58| 49|         Space|         0| 60) E(11)
1556113593.659952 Key( 58| 49|         Space|         0| 60) E(10) DISMISSED
1556113593.661564 Key( 58| 49|         Space|         0| 60) E(11) DISMISSED

And even if I press Option after word without spacebar after - I see in debug window that spacebar was pressed anyway (punto switcher bug?). So because of this Unshaky thinks that it's a double key press.

ghost avatar Apr 24 '19 13:04 ghost

so you expect all spaces are there right?

aahung avatar Apr 24 '19 14:04 aahung

Yep, but I understand that it's not Unshaky issue. Maybe there can be something to avoid this case?

ghost avatar Apr 24 '19 14:04 ghost

The two spaces are pretty close (< 8ms) and in the latest version of Unshaky, two presses are very close (< 5ms) will be whitelisted since it is likely to be other software-generated key presses. I might increase it to 10ms and it should fix your problem.

1556113593.652340 Key( 58| 49|         Space|         0| 60) E(11)
1556113593.659952 Key( 58| 49|         Space|         0| 60) E(10) DISMISSED

aahung avatar Apr 24 '19 14:04 aahung

Sounds good, I can test it

ghost avatar Apr 24 '19 14:04 ghost

@fedor1991 did it work>?

aahung avatar Jun 05 '19 19:06 aahung

@aahung not very, it works in 30% cases, example when it was false positive

1559762189.880007 Key( 40| 49| Space| 0| 40) E(10) 1559762189.958238 Key( 40| 49| Space| 0| 40) E(11) 1559762192.689738 Key( 58| 49| Space| 0| 40) E(10) 1559762192.691964 Key( 58| 49| Space| 0| 40) E(11) 1559762192.699074 Key( 58| 49| Space| 0| 40) E(10) DISMISSED 1559762192.699239 Key( 58| 49| Space| 0| 40) E(11) DISMISSED 1559762193.435401 Key( 58| 49| Space| 0| 40) E(10) 1559762193.435478 Key( 58| 49| Space| 0| 40) E(11) 1559762193.440729 Key( 58| 49| Space| 0| 40) E(10) DISMISSED 1559762193.440842 Key( 58| 49| Space| 0| 40) E(11) DISMISSED 1559762194.310761 Key( 58| 49| Space| 0| 40) E(10) 1559762194.310852 Key( 58| 49| Space| 0| 40) E(11) 1559762194.315477 Key( 58| 49| Space| 0| 40) E(10) 1559762194.315586 Key( 58| 49| Space| 0| 40) E(11)

ghost avatar Jun 05 '19 19:06 ghost

looks like that workaround did not work well since the interval is not consistent...

aahung avatar Jun 05 '19 19:06 aahung