Skip to content

Commit

Permalink
Emulate middle click with alt or cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
codefrau committed Dec 25, 2023
1 parent 96af425 commit c652b53
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion squeak.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
"version", {
// system attributes
vmVersion: "SqueakJS 1.1.2",
vmDate: "2023-12-23", // Maybe replace at build time?
vmDate: "2023-12-24", // Maybe replace at build time?
vmBuild: "unknown", // or replace at runtime by last-modified?
vmPath: "unknown", // Replace at runtime
vmFile: "vm.js",
Expand Down Expand Up @@ -55222,6 +55222,8 @@
case 1: buttons = Squeak.Mouse_Yellow; break; // middle
case 2: buttons = Squeak.Mouse_Blue; break; // right
}
if (buttons === Squeak.Mouse_Red && (evt.altKey || evt.metaKey))
buttons = Squeak.Mouse_Yellow; // emulate middle-click
if (options.swapButtons)
if (buttons == Squeak.Mouse_Yellow) buttons = Squeak.Mouse_Blue;
else if (buttons == Squeak.Mouse_Blue) buttons = Squeak.Mouse_Yellow;
Expand Down

0 comments on commit c652b53

Please sign in to comment.