Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. # Hammerspoon 한영변환 ``` local inputSource = { english = "com.apple.keylayout.ABC", korean = "com.apple.inputmethod.Korean.2SetKorean", } -- 한영변환 local changeInput = function() local current = hs.keycodes.currentSourceID() local nextInput = nil if current == inputSource.english then nextInput = inputSource.korean else nextInput = inputSource.english end local result = hs.keycodes.currentSourceID(nextInput) if result == true then hs.alert.show(nextInput) end end -- hs.hotkey.bind(nil, 'f13', changeInput) -- change layout hs.hotkey.bind({}, "f13", function() -- hs.eventtap.keyStroke({"ctrl", "option"}, "space") local lay = hs.keycodes.currentLayout() print(lay) if lay == "ABC" then -- hs.keycodes.setLayout("2-Set Korean") -- hs.keycodes.currentSourceID(inputSource.korean) hs.keycodes.setMethod("2-Set Korean") else -- hs.keycodes.currentSourceID(inputSource.english) hs.keycodes.setLayout("ABC") end end) ``` open/hammerspoon-한영변환.txt Last modified: 2024/10/05 06:15by 127.0.0.1