Skip to content
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

Hammerspoon brings back com.apple.keylayout.ABC #3647

Open
isudfv opened this issue Jun 20, 2024 · 1 comment
Open

Hammerspoon brings back com.apple.keylayout.ABC #3647

isudfv opened this issue Jun 20, 2024 · 1 comment

Comments

@isudfv
Copy link

isudfv commented Jun 20, 2024

Hi,
I'm trying to get rid of com.apple.keylayout.ABC because of this issue, which is already achieved.
But when I use hammerspoon to switch input source by hs.keycodes.currentSourceID("org.unknown.keylayout.custom"), hs brings the annoying ABC back.
I tried a workaround to execute a shell command issw org.unknown.keylayout.custom (issw), which has the same effect.
However that behavior happens only in config and works well in hs console and terminal.

this is my config file, which changes input-source to custom when hit ESC in Android Studio

bEventTap = hs.eventtap.new({ hs.eventtap.event.types.keyDown }, function(event)
  if event:getKeyCode() == 53 then
    local frontApp = hs.application.frontmostApplication()
    if string.match(frontApp:title(), "Android Studio") then
      -- hs.keycodes.currentSourceID("org.unknown.keylayout.custom")
      hs.execute("/Users/isudfv/Desktop/tmp/input-source-switcher/build/issw org.unknown.keylayout.custom")
    end
  end
  return false -- don't delete the event
end)
bEventTap:start()
@isudfv isudfv changed the title Hammerspoon bring back com.apple.keylayout.ABC Hammerspoon brings back com.apple.keylayout.ABC Jun 20, 2024
@cmsj
Copy link
Member

cmsj commented Aug 5, 2024

hmm, I've not come across this before. I don't believe we're intentionally trying to modify layouts when switching them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants