Skip to content

Instantly share code, notes, and snippets.

@stash
Created May 16, 2018 18:19
Show Gist options
  • Save stash/c16a3984b4da8424fd9c9a6a207e292f to your computer and use it in GitHub Desktop.
Save stash/c16a3984b4da8424fd9c9a6a207e292f to your computer and use it in GitHub Desktop.
Logitech gsuite script for middle-mouse button panning in illustrator and photoshop
-- The following code is in the public domain
--
-- Logitech g-suite script that binds middle mouse button to "SHIFT + LMB"
--
-- Holding spacebar in Illustrator or Photoshop (CC 2018-ish) allows you to pan the screen around with a left mouse drag
--
function OnEvent(event, arg)
if (event == "MOUSE_BUTTON_PRESSED" and arg == 3) then
-- 57 == 0x39 == "spacebar"
PressKey(57);
PressMouseButton(1);
end
if (event == "MOUSE_BUTTON_RELEASED" and arg == 3) then
ReleaseKey(57);
ReleaseMouseButton(1);
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment