Update
This commit is contained in:
24
dot_hammerspoon/init.lua
Normal file
24
dot_hammerspoon/init.lua
Normal file
@ -0,0 +1,24 @@
|
||||
-- Function to simulate key presses
|
||||
local function pressFn(mods, key)
|
||||
if key == nil then
|
||||
key = mods
|
||||
mods = {}
|
||||
end
|
||||
|
||||
return function() hs.eventtap.keyStroke(mods, key, 1000) end
|
||||
end
|
||||
|
||||
-- Function to remap keys
|
||||
local function remap(mods, key, pressFn)
|
||||
hs.hotkey.bind(mods, key, pressFn, nil, pressFn)
|
||||
end
|
||||
|
||||
-- Define Caps Lock as the Hyperkey
|
||||
local hyper = {'ctrl', 'alt', 'cmd'}
|
||||
|
||||
-- Remap HJKL to arrow keys using Caps Lock as a Hyperkey
|
||||
remap(hyper, 'h', pressFn({}, 'left')) -- Move left
|
||||
remap(hyper, 'j', pressFn({}, 'down')) -- Move down
|
||||
remap(hyper, 'k', pressFn({}, 'up')) -- Move up
|
||||
remap(hyper, 'l', pressFn({}, 'right')) -- Move right
|
||||
|
||||
@ -1 +0,0 @@
|
||||
../.dotfiles/hammerspoon/.hammerspoon/init.lua
|
||||
Reference in New Issue
Block a user