agzam / spacehammer

Hammerspoon config inspired by Spacemacs
MIT License
556 stars 70 forks source link

Cannot emit backslash #165

Closed agzam closed 1 year ago

agzam commented 2 years ago

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 "\\")
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.

Grazfather commented 2 years ago

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