misc: disable mouse macro

This commit is contained in:
Klesh Wong 2022-09-25 20:49:58 +08:00
parent 5a347f6f5b
commit a2b9c61069

View File

@ -751,19 +751,20 @@ local clientbuttons = gears.table.join(
awful.button({ modkey }, 3, function(c) awful.button({ modkey }, 3, function(c)
c:emit_signal("request::activate", "mouse_click", { raise = true }) c:emit_signal("request::activate", "mouse_click", { raise = true })
awful.mouse.client.resize(c) awful.mouse.client.resize(c)
end),
awful.button({}, 6, function()
mousegrabber.run(function()
volume_widget.dec()
return false
end, "mouse")
end),
awful.button({}, 7, function()
mousegrabber.run(function()
volume_widget.inc()
return false
end, "mouse")
end) end)
-- ,
-- awful.button({}, 6, function()
-- mousegrabber.run(function()
-- volume_widget.dec()
-- return false
-- end, "mouse")
-- end),
-- awful.button({}, 7, function()
-- mousegrabber.run(function()
-- volume_widget.inc()
-- return false
-- end, "mouse")
-- end)
) )
@ -872,28 +873,28 @@ gears.timer.start_new(0.1, function()
return true return true
end) end)
-- bind button click event -- bind button click event
for button in pairs(buttonmacros) do -- for button in pairs(buttonmacros) do
buttonstate[button] = {} -- buttonstate[button] = {}
gears.debug.print_error("register " .. tostring(button)) -- gears.debug.print_error("register " .. tostring(button))
local function f(c) -- local function f(c)
if replaying > 0 then -- if replaying > 0 then
replaying = replaying - 1 -- replaying = replaying - 1
return -- return
end -- end
gears.debug.print_error("button clicked " .. tostring(button)) -- gears.debug.print_error("button clicked " .. tostring(button))
c:emit_signal("request::activate", "mouse_click", { raise = true }) -- c:emit_signal("request::activate", "mouse_click", { raise = true })
mousegrabber.run(function(_) -- mousegrabber.run(function(_)
local timestamps = buttonstate[button] -- local timestamps = buttonstate[button]
table.insert(timestamps, socket.gettime()) -- table.insert(timestamps, socket.gettime())
return false -- return false
end, "mouse") -- end, "mouse")
end -- end
--
clientbuttons = gears.table.join(clientbuttons, -- clientbuttons = gears.table.join(clientbuttons,
awful.button({ "Shift" }, button, f), -- awful.button({ "Shift" }, button, f),
awful.button({}, button, f) -- awful.button({}, button, f)
) -- )
end -- end
-- Set keys -- Set keys
root.keys(globalkeys) root.keys(globalkeys)