godbout / Wooshy.docs

it's like Alfred but for the UI
https://wooshy.app
222 stars 0 forks source link

Does not work with App Hyperkey #43

Closed aaronrolls closed 2 years ago

aaronrolls commented 2 years ago

I recently switched from karabiner to Hyperkey to change my caps lock into something more useful. In 1a6 Wooshy worked fine, but now that I have updated to 1a7 wooshy will not detect any shortcut that contains the hyperkey. kindaVim won't detect any shortcut containing it ether. However they both still let you set the shortcut and it detects it fine in the little box which lets you set the shortcut.

my hyper key is mapped to ⌃⌥⌘

CleanShot2022-08-02at06 46 15

Wooshy and kindaVim will still activate if they are mapped to something that does not use the hyperkey.

Other apps that use the my hyperkey such as Homerow and Rectangle still work.

It would be nice to have a fix to this ASAP!

godbout commented 2 years ago

In 1a6 Wooshy worked fine, but now that I have updated to 1a7 wooshy will not detect any shortcut that contains the hyperkey.

wait. you already had Hyperkey and your key set up when you were on a6? regarding the event tap nothing has changed since day one. if it was working with Hyperkey before and it doesn't now that you've updated to a7, that means it's an event tap priority issue. that means, you need to start the apps in a proper order. that mega sucks. the event tap system kV is using is necessary to do its job. Wooshy could be rewritten, which would solve also this issue. but i doubt this is solvable quickly.

the issue with all those apps is that Apple gives 6 places to insert an event tap. then the system "decides" what goes before and after, if you try to place the taps at the same place. kV you need a very low level. probably same as Hyperkey. Karabiner works because it's a whole keyboard drivers so it's even lower and grabs and generates everything before all the taps.

godbout commented 2 years ago

try quitting Wooshy, quitting Hyperkey, launching Wooshy, launching Hyperkey. maybe a quick workaround for now.

aaronrolls commented 2 years ago

Well that sucks. Starting Wooshy before Hyperkey works.

I don't exactly know what you mean though. Does "Apple gives 6 places to insert an event tap." mean that only 6 apps can use a hyperkey?

Or does it mean that if Wooshy is lower on the list than Hypertap, Hypertap will activate after wooshy checks for its hotkey? So Wooshy will be seeing Capslock+f instead of ⌃⌥⌘F?

godbout commented 2 years ago

Well that sucks. Starting Wooshy before Hyperkey works.

well. then that doesn't suck now. here you go. case closed.

I don't exactly know what you mean though. Does "Apple gives 6 places to insert an event tap." mean that only 6 apps can use a hyperkey?

no. see below.

Or does it mean that if Wooshy is lower on the list than Hypertap, Hypertap will activate after wooshy checks for its hotkey? So Wooshy will be seeing Capslock+f instead of ⌃⌥⌘F?

Apple gives you three locations where you can place an event tap: https://developer.apple.com/documentation/coregraphics/cgeventtaplocation on each of these location you can choose whether you want to add your tap at the head or the tail of the pipe. 3 * 2 = 6.

the problem with all those apps adding a tap is who gets the priority? when you tell Apple i want a tap at the head of the cgi event stream, Apple puts it in the head, before all the other apps that registered before you.

when you receive a key, you can decide to use it and passing it down the stream of events, or to "steal" it. when it's stolen, all the other apps down the stream don't get the keys. this is the issue you're having now.

godbout commented 2 years ago

why closing? 😅️

there's still at least 3 taps i can try for Wooshy. i think it should be fine. for kV though it's gonna be harder, because it needs to not only steal keys, but to rewrite and pass them DOWN the stream. it cannot pass them above, because else it will act on its own sent keys. like it would grab l, change it to right arrow, send it, but then receve a right arrow and act on it ad libitum.

i'll try Hyperkey tomorrow and see if i can find something.

godbout commented 2 years ago

for kV i'm pretty sure i've made many tests before because of issues with Hammerspoon. contacted the guys too. but ultimately if i'm not wrong currently the kV event tap is the only one possible (lowest). if i can't make it work with Hyperkey i'll contact Ryan.

godbout commented 2 years ago

i'm getting Hyperkey to work with Wooshy but then the jk G gg etc. of kV don't work anymore on Wooshy. this is gonna be a mega nightmare to get it to work on all the possible setups and with all the possible apps that people use and that are setting themselves wherever then want down the stream pipe. i will contact Ryan later today and see if he can think of something.

godbout commented 2 years ago

Hammerspoon works out of the box. for reference, the talk with them a while ago: https://github.com/Hammerspoon/hammerspoon/issues/3037

godbout commented 2 years ago

set the tap a tad lower so that Hyperkey can get in front. let's open an issue when another key remapper app breaks: https://github.com/godbout/Wooshy.docs/releases/tag/1a.8

godbout commented 2 years ago

opened a task for this on kV: https://github.com/godbout/kindaVim.docs/issues/104

godbout commented 2 years ago

i'll probably try a few things before contacting Ryan. i may have a few things i wanna explore first.