aboutsummaryrefslogtreecommitdiffstats
path: root/mouse.lua
diff options
context:
space:
mode:
authorTeddy Wing2019-07-25 00:16:06 +0200
committerTeddy Wing2019-07-25 00:16:06 +0200
commit826bff35755e4b2692316f8916facc6f39087158 (patch)
treefa8d18368efb7b5648c1a8608a32420af4343e9f /mouse.lua
parentf27622ab0653f0790a7bc9217c53dd2f7eb66660 (diff)
downloaddothammerspoon-826bff35755e4b2692316f8916facc6f39087158.tar.bz2
mouse: Add non-functioning Option-Click
Was trying to get this to work a while ago and it's been sitting uncommitted in my local repo. Commit it just to have it, and try to figure out how to get it to work later.
Diffstat (limited to 'mouse.lua')
-rw-r--r--mouse.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/mouse.lua b/mouse.lua
index fefacb9..8f9e9f0 100644
--- a/mouse.lua
+++ b/mouse.lua
@@ -61,6 +61,16 @@ function mouse.click_down()
hs.eventtap.event.newMouseEvent(hs.eventtap.event.types.leftMouseDown, position):post()
end
+-- TODO: Doesn't work
+function mouse.option_click_down()
+ local position = hs.mouse.getAbsolutePosition()
+ hs.eventtap.event.newMouseEvent(
+ hs.eventtap.event.types.leftMouseDown,
+ position,
+ {'option'}
+ ):post()
+end
+
function mouse.click_up()
local position = hs.mouse.getAbsolutePosition()
hs.eventtap.event.newMouseEvent(hs.eventtap.event.types.leftMouseUp, position):post()
@@ -139,6 +149,7 @@ mouse_mode:bind({}, 'pad2', mouse.bottom(100), nil, mouse.bottom(100))
mouse_mode:bind({}, 'pad3', mouse.bottom_right(100), nil, mouse.bottom_right(100))
mouse_mode:bind({}, 'pad4', mouse.left(100), nil, mouse.left(100))
mouse_mode:bind({}, 'pad5', mouse.click_down, mouse.click_up)
+mouse_mode:bind({'option'}, 'pad5', mouse.option_click_down, mouse.click_up)
mouse_mode:bind({}, 'pad6', mouse.right(100), nil, mouse.right(100))
mouse_mode:bind({}, 'pad7', mouse.top_left(100), nil, mouse.top_left(100))
mouse_mode:bind({}, 'pad8', mouse.top(100), nil, mouse.top(100))