A cmd-eikana like Hammerspoon spoon plugin.
Eikana is a hammerspoon plugin that can be used to switch between alphanumeric/kana mode by pressing left / right command key only. Inspired by cmd-eikana.
And it can also be used to switch between input methods by only pressing modifier keys (cmd / rightcmd / alt / rightalt / shift / rightshift / ctrl / rightctrl).
Install Hammerspoon and extract Eikana.spoon.zip to ~/.hammerspoon/Spoons.
Manually, download the zip file. Load, configure, and start the plugin in ~/.hammerspoon/init.lua:
hs.loadSpoon('Eikana') -- initialize the plugin
spoon.Eikana:start() -- enable keyboard shortcutsAlternatively, you can use SpoonInstall.
hs.loadSpoon("SpoonInstall")
spoon.SpoonInstall.repos.Eikana = {
url = "https://github.com/kouhin/Eikana.spoon",
desc = "Eikana spoon repository",
branch = "main",
}
spoon.SpoonInstall:andUse("Eikana", {
repo = "Eikana",
start = true
})By default, you can switch between alphanumberic / kana by left cmd and right cmd without any configuration.
And there are options for customize the key mapping.
userMapping: Add extra key mappings to your input methods.override: Override the default key mapping (Disable left cmd → alphanumberic, right cmd → kana)
For manual installtion:
hs.loadSpoon('Eikana') -- initialize the plugin
spoon.Eikana.userMapping = {
rightcmd = 'Pinyin - Simplified',
rightalt = 'Wubi - Simplified'
}
-- Uncomment the following line to override default mapping (cmd: Eisuu, rightcmd: Kana)
-- spoon.Eikana.override = true
spoon.Eikana:start() -- enable keyboard shortcutsFor SpoonInstall:
hs.loadSpoon("SpoonInstall")
spoon.SpoonInstall.repos.Eikana = {
url = "https://github.com/kouhin/Eikana.spoon",
desc = "Eikana spoon repository",
branch = "main",
}
spoon.SpoonInstall:andUse("Eikana", {
repo = "Eikana",
config = {
-- Uncomment the following line to override default mapping (cmd: Eisuu, rightcmd: Kana)
-- override = true,
userMapping = {
rightalt = "Pinyin - Simplified"
}
},
start = true
})
- Open
Consolefrom hammperspoon menu. - Enter this command without executing it yet:
hs.keycodes.currentMethod(). - Switch to desired input method
- Run command
MIT