Fix mcsr/global binds
This commit is contained in:
@@ -1,16 +1,6 @@
|
||||
local function mcsr_submap(window, active)
|
||||
if window ~= nil and window.class ~= nil and window.class:find("Minecraft") then
|
||||
hl.dispatch(hl.dsp.submap("mcsr"))
|
||||
else
|
||||
hl.dispatch(hl.dsp.submap("reset"))
|
||||
end
|
||||
end
|
||||
hl.on("window.active", mcsr_submap)
|
||||
hl.bind("mouse:275", function() mcsr_submap(hl.get_active_window(), nil) end)
|
||||
|
||||
local function remap(from, to)
|
||||
hl.bind(from, hl.dsp.send_key_state({mods = "", key = to, state = "down"}), {transparent = true})
|
||||
hl.bind(from, hl.dsp.send_key_state({mods = "", key = to, state = "up"}), {transparent = true, release = true})
|
||||
hl.bind(from, hl.dsp.send_key_state({mods = "", key = to, state = "down"}), {ignore_mods = true, transparent = true})
|
||||
hl.bind(from, hl.dsp.send_key_state({mods = "", key = to, state = "up"}), {ignore_mods = true, transparent = true, release = true})
|
||||
end
|
||||
|
||||
-- #MCSR
|
||||
@@ -34,20 +24,16 @@ hl.define_submap("mcsr", function()
|
||||
hl.bind("KP_NEXT", hl.dsp.window.resize({x = 2540, y = 400}))
|
||||
hl.bind("KP_NEXT", hl.dsp.window.center())
|
||||
|
||||
-- Close boateye
|
||||
-- FIXME: use hl.on() to couple this to the actions of fullscreening/floating
|
||||
-- instead of the keybinds
|
||||
hl.bind("SUPER + F", hl.dsp.exec_cmd("quickshell ipc call boateye close"))
|
||||
hl.bind("SUPER + M", hl.dsp.exec_cmd("quickshell ipc call boateye close"))
|
||||
|
||||
-- Search crafting mappings
|
||||
remap("mouse:275", "f3")
|
||||
remap("SHIFT + mouse:275", "f3")
|
||||
remap("1", "apostrophe")
|
||||
remap("apostrophe", "1")
|
||||
remap("k", "0")
|
||||
remap("semicolon", "w")
|
||||
remap("j", "v")
|
||||
|
||||
hl.bind("SUPER_L", hl.dsp.submap("reset"))
|
||||
end)
|
||||
|
||||
-- Close boateye
|
||||
-- FIXME: use hl.on() to couple this to the actions of fullscreening/floating
|
||||
-- instead of the keybinds
|
||||
bind("SUPER + F", hl.dsp.exec_cmd("quickshell ipc call boateye close"))
|
||||
bind("SUPER + M", hl.dsp.exec_cmd("quickshell ipc call boateye close"))
|
||||
|
||||
Reference in New Issue
Block a user