mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
awful.mouse: Add a function to add a new awful.button
s to clients.
This commit is contained in:
parent
a8e8c46b56
commit
370e754006
1 changed files with 16 additions and 1 deletions
|
@ -421,6 +421,22 @@ function mouse.remove_global_mousebinding(button)
|
|||
capi.root._remove_button(button)
|
||||
end
|
||||
|
||||
local default_buttons = {}
|
||||
|
||||
--- Add an `awful.button` to the default client buttons.
|
||||
--
|
||||
-- @staticfct awful.mouse.append_client_mousebinding
|
||||
-- @tparam awful.button button The button.
|
||||
-- @emits client_mousebinding::added
|
||||
-- @emitstparam client_mousebinding::added awful.button button The button.
|
||||
-- @see awful.button
|
||||
-- @see awful.keyboard.append_client_keybinding
|
||||
|
||||
function mouse.append_client_mousebinding(button)
|
||||
table.insert(default_buttons, button)
|
||||
capi.client.emit_signal("client_mousebinding::added", button)
|
||||
end
|
||||
|
||||
for _, b in ipairs {"left", "right", "middle"} do
|
||||
mouse.object["is_".. b .."_mouse_button_pressed"] = function()
|
||||
return capi.mouse.coords().buttons[1]
|
||||
|
@ -470,7 +486,6 @@ end)
|
|||
-- when button 1 is pressed.
|
||||
-- @staticfct mouse.coords
|
||||
|
||||
|
||||
return mouse
|
||||
|
||||
-- vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80
|
||||
|
|
Loading…
Reference in a new issue