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

Request: I want to set JIS eisu key as a modifier key #1372

Open
kt0319 opened this issue Apr 25, 2017 · 1 comment
Open

Request: I want to set JIS eisu key as a modifier key #1372

kt0319 opened this issue Apr 25, 2017 · 1 comment

Comments

@kt0319
Copy link

kt0319 commented Apr 25, 2017

local function keyCode(key, modifiers)
   modifiers = modifiers or {}
   return function()
      hs.eventtap.event.newKeyEvent(modifiers, string.lower(key), true):post()
      hs.timer.usleep(1000)
      hs.eventtap.event.newKeyEvent(modifiers, string.lower(key), false):post()
   end
end

local function remapKey(modifiers, key, keyCode)
   hs.hotkey.bind(modifiers, key, keyCode, nil, keyCode)
end

remapKey({'eisu'}, 'h', keyCode('left'))
remapKey({'eisu'}, 'j', keyCode('down'))
remapKey({'eisu'}, 'k', keyCode('up'))
remapKey({'eisu'}, 'l', keyCode('right'))

Although it is set like this, it is judged that it is pushed even if you release the eisu key.
Please be able to set eisu key etc as modifier key.

@cmsj
Copy link
Member

cmsj commented Apr 27, 2017

I'm not sure how macOS handles eisu, but I've never seen it referenced anywhere in Carbon as a modifier that can be used like ctrl/alt/shift/opt/cmd.

@asmagill any ideas here?

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