I to remap the ` key so that when I hold it it behave the same way as holding the alt key. For instance holding ` and pressing tab should behave as alt+tab.
I tried this, but it doesn't work. What am I doing wrong?
hs.hotkey.bind({}, "`", function() hs.eventtap.keyStroke({"alt"},"") end)
Create an eventtap and hook into the
keyDown
event. Determine the keycode for the backtick (50
for my keyboard layout) and post key events to simulate that the alt (option) key was pressed. Finally returntrue
to surpress the original key (`).