Skip to content

Commit

Permalink
Added CTRL+click to emulate right click (#1048)
Browse files Browse the repository at this point in the history
  • Loading branch information
deepnight committed Jan 15, 2024
1 parent 613dc9c commit c9bdfe8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- Fixed crash on async painting with no default Tileset
- Fixed a crash with empty identifiers
- Fixed a potential infinite loop with empty identifiers
- On macOS, CTRL+Left click should now behave like Right Clicking for editing tools and open context menus

# 1.5.2

Expand Down
2 changes: 2 additions & 0 deletions src/electron.renderer/Tool.hx
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ class Tool<T> extends dn.Process {
switch button {
case 0:
curMode = Add;
if( App.ME.isMacCtrlDown() )
curMode = Remove;

case 1:
curMode = Remove;
Expand Down
10 changes: 10 additions & 0 deletions src/electron.renderer/ui/modal/ContextMenu.hx
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,16 @@ class ContextMenu extends ui.Modal {
ev.preventDefault();
_open(ev);
});

// Emulated right click on macOS
if( App.isMac() )
jTarget.on("mousedown.context", (ev:js.jquery.Event)->{
if( ev.button==0 && App.ME.isMacCtrlDown() ) {
ev.stopPropagation();
ev.preventDefault();
_open(ev);
}
});
}


Expand Down

0 comments on commit c9bdfe8

Please # to comment.