From 2be0bb5c5ad309ba2da10d8aac27e209907f1b46 Mon Sep 17 00:00:00 2001 From: Spoons GitHub Bot Date: Wed, 7 Aug 2024 13:20:46 +0000 Subject: [PATCH] Generate docs for MiddleClickDragScroll --- Source/MiddleClickDragScroll.spoon/docs.json | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Source/MiddleClickDragScroll.spoon/docs.json diff --git a/Source/MiddleClickDragScroll.spoon/docs.json b/Source/MiddleClickDragScroll.spoon/docs.json new file mode 100644 index 00000000..564af49a --- /dev/null +++ b/Source/MiddleClickDragScroll.spoon/docs.json @@ -0,0 +1,19 @@ +[ + { + "Command": [], + "Constant": [], + "Constructor": [], + "Deprecated": [], + "Field": [], + "Function": [], + "Method": [], + "Variable": [], + "desc": "Allows scrolling by holding down the middle mouse button and dragging it, the same as it works on Windows.", + "doc": "Allows scrolling by holding down the middle mouse button and dragging it, the same as it works on Windows.\nEspecially useful to quickly scroll to the top or bottom of a page, if you don't have a Magic Mouse.\n\nNote: Due to OS limitations, it always scrolls the window currently below the mouse, not the window below the position\nwhere the dragging started, like it works on Windows. You therefore need to take some care to stay inside the window.\n\n== Usage ==\n\n```lua\nlocal MiddleClickDragScroll = hs.loadSpoon(\"MiddleClickDragScroll\"):start()\n```\n\nYou can temporarily stop the spoon by calling `MiddleClickDragScroll:stop()` and then restart it by calling `MiddleClickDragScroll:start()` again.\n\n== Configuration ==\n\n```lua\nlocal MiddleClickDragScroll = hs.loadSpoon(\"MiddleClickDragScroll\"):configure{\n excludedApps = {\"Some App\", \"Other app\"}, -- Don't activate scrolling in apps with these names\n excludedWindows = {\"^Some Window Title$\"}, -- Don't activate scrolling in windows with these names (supports regex, for exact match, use \"^title$\")\n excludedUrls = {\"^https://geogebra.calculator$\"}, -- Don't activate scrolling when the active window is on these URLs (supports regex, only works in Chrome and Safari, asks for extra permissions on first trigger)\n indicatorSize = 25, -- Size of the scrolling indicator in pixels\n indicatorAttributes = -- Attributes of the scrolling indicator. Takes any specified on https://www.hammerspoon.org/docs/hs.canvas.html#attributes. Alternatively, you can pass a custom canvas, see the explenation below.\n {\n type = \"circle\",\n fillColor = { red = 0, green = 0, blue = 0, alpha = 0.3 },\n strokeColor = { red = 1, green = 1, blue = 1, alpha = 0.5 },\n },\n startDistance = 15, -- Minimal distance to drag the mouse before scrolling is triggered.\n scrollMode = \"pixel\", -- Whether the scroll speed is in \"line\"s or \"pixel\"s. Scrolling by lines has smooting in some applications\n -- and therefore works with reduced frequency but it offers much less precise control.\n scrollFrequency = 0.01, -- How often to trigger scrolling (in seconds)\n scrollAccelaration = 30, -- How fast scrolling accelerates based on the mouse distance from the initial location. Larger is faster.\n scrollSpeedFn = -- How scrolling accelerates based on the mouse distance from the initial location.\n -- The default is dist^2 / scrollAcceleration^2. You can pass a custom function that recieves `self` as the first argument\n -- and the absolute distance as the second and returns the resulting speed (in pixels or lines, depending on the scrollMode setting).\n function(self, x)\n return (x ^ 2) / (self.scrollAccelaration ^ 2)\n end\n}:start()\n```\n\nUnspecified keys are unchanged. You can call `configure` multiple times to dynamically change it but changing `indicatorAttributes` and `indicatorSize` only works when `MiddleClickDragScroll` is stopped.\n\nInstead of `indicatorSize` and `indicatorAttributes`, you can also pass a custom canvas to `configure` or set it directly to have more control over the indicator style:\n\n```lua\n MiddleClickDragScroll.canvas = hs.canvas.new{ w = 25, h = 25}:insertElement{\n type = \"circle\",\n fillColor = { red = 0, green = 0, blue = 0, alpha = 0.3 },\n strokeColor = { red = 1, green = 1, blue = 1, alpha = 0.5 },\n }\n```\n\nFor more details, see: https://www.hammerspoon.org/docs/hs.canvas.html\n\nDownload: [https://github.com/Hammerspoon/Spoons/raw/master/Spoons/MiddleClickDragScroll.spoon.zip](https://github.com/Hammerspoon/Spoons/raw/master/Spoons/MiddleClickDragScroll.spoon.zip)", + "items": [], + "name": "MiddleClickDragScroll", + "stripped_doc": "Especially useful to quickly scroll to the top or bottom of a page, if you don't have a Magic Mouse.\n\nNote: Due to OS limitations, it always scrolls the window currently below the mouse, not the window below the position\nwhere the dragging started, like it works on Windows. You therefore need to take some care to stay inside the window.\n\n== Usage ==\n\n```lua\nlocal MiddleClickDragScroll = hs.loadSpoon(\"MiddleClickDragScroll\"):start()\n```\n\nYou can temporarily stop the spoon by calling `MiddleClickDragScroll:stop()` and then restart it by calling `MiddleClickDragScroll:start()` again.\n\n== Configuration ==\n\n```lua\nlocal MiddleClickDragScroll = hs.loadSpoon(\"MiddleClickDragScroll\"):configure{\n excludedApps = {\"Some App\", \"Other app\"}, -- Don't activate scrolling in apps with these names\n excludedWindows = {\"^Some Window Title$\"}, -- Don't activate scrolling in windows with these names (supports regex, for exact match, use \"^title$\")\n excludedUrls = {\"^https://geogebra.calculator$\"}, -- Don't activate scrolling when the active window is on these URLs (supports regex, only works in Chrome and Safari, asks for extra permissions on first trigger)\n indicatorSize = 25, -- Size of the scrolling indicator in pixels\n indicatorAttributes = -- Attributes of the scrolling indicator. Takes any specified on https://www.hammerspoon.org/docs/hs.canvas.html#attributes. Alternatively, you can pass a custom canvas, see the explenation below.\n {\n type = \"circle\",\n fillColor = { red = 0, green = 0, blue = 0, alpha = 0.3 },\n strokeColor = { red = 1, green = 1, blue = 1, alpha = 0.5 },\n },\n startDistance = 15, -- Minimal distance to drag the mouse before scrolling is triggered.\n scrollMode = \"pixel\", -- Whether the scroll speed is in \"line\"s or \"pixel\"s. Scrolling by lines has smooting in some applications\n -- and therefore works with reduced frequency but it offers much less precise control.\n scrollFrequency = 0.01, -- How often to trigger scrolling (in seconds)\n scrollAccelaration = 30, -- How fast scrolling accelerates based on the mouse distance from the initial location. Larger is faster.\n scrollSpeedFn = -- How scrolling accelerates based on the mouse distance from the initial location.\n -- The default is dist^2 / scrollAcceleration^2. You can pass a custom function that recieves `self` as the first argument\n -- and the absolute distance as the second and returns the resulting speed (in pixels or lines, depending on the scrollMode setting).\n function(self, x)\n return (x ^ 2) / (self.scrollAccelaration ^ 2)\n end\n}:start()\n```\n\nUnspecified keys are unchanged. You can call `configure` multiple times to dynamically change it but changing `indicatorAttributes` and `indicatorSize` only works when `MiddleClickDragScroll` is stopped.\n\nInstead of `indicatorSize` and `indicatorAttributes`, you can also pass a custom canvas to `configure` or set it directly to have more control over the indicator style:\n\n```lua\n MiddleClickDragScroll.canvas = hs.canvas.new{ w = 25, h = 25}:insertElement{\n type = \"circle\",\n fillColor = { red = 0, green = 0, blue = 0, alpha = 0.3 },\n strokeColor = { red = 1, green = 1, blue = 1, alpha = 0.5 },\n }\n```\n\nFor more details, see: https://www.hammerspoon.org/docs/hs.canvas.html\n\nDownload: [https://github.com/Hammerspoon/Spoons/raw/master/Spoons/MiddleClickDragScroll.spoon.zip](https://github.com/Hammerspoon/Spoons/raw/master/Spoons/MiddleClickDragScroll.spoon.zip)", + "submodules": [], + "type": "Module" + } +] \ No newline at end of file