spacehammer icon indicating copy to clipboard operation
spacehammer copied to clipboard

Cannot emit backslash

Open agzam opened this issue 3 years ago • 1 comments

This is [most likely] not a bug in Spacehammer. I'm struggling to pinpoint the cause of it.

Basically, I am unable to emit certain keys, specifically, backslash, i.e., the following:

(hs.eventtap.keyStroke nil "\\")
  • doesn't work. Interestingly, the similar Lua code [when executed from hs IPC] works just fine:
hs.eventtap.keyStroke(nil, "\\")

Also, (hs.eventtap.keyStrokes "\\") works. But I needed to emit Ctrl+\. And hs.eventtap.keyStrokes doesn't allow modifiers.

I tried a bit more elaborate way:

(local {: for-each} (require :lib.functional)) ;; Spacehammer's built-in

(for-each
  (fn [ev] (: ev :post))
  (hs.eventtap.event.newKeyEventSequence [:ctrl] "\\"))

Alas, that didn't work either. Even though this bug [probably] has nothing to do with this project, I am unsure where to report it since it seems to be working in the hs command-line tool.

agzam avatar Apr 18 '22 19:04 agzam

(hs.eventtap.keyStroke nil "\\") seems to work fine for me.

Grazfather avatar May 12 '22 22:05 Grazfather