-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adds support for click extensions on osx arm (#58)
Co-authored-by: Chris Hanna <[email protected]>
- Loading branch information
1 parent
d98cb96
commit 7bc2c09
Showing
5 changed files
with
87 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
using System.Runtime.InteropServices; | ||
|
||
namespace Desktop.Robot.Clicks.OSX.ARM | ||
{ | ||
static class Common | ||
{ | ||
[DllImport("./osx_arm.os", EntryPoint = "rightMouseUp")] | ||
internal static extern void RightClickUp(uint x, uint y); | ||
|
||
[DllImport("./osx_arm.os", EntryPoint = "rightMouseDown")] | ||
internal static extern void RightClickDown(uint x, uint y); | ||
|
||
|
||
[DllImport("./osx_arm.os", EntryPoint = "leftMouseUp")] | ||
internal static extern void LeftClickUp(uint x, uint y); | ||
|
||
[DllImport("./osx_arm.os", EntryPoint = "leftMouseDown")] | ||
internal static extern void LeftClickDown(uint x, uint y); | ||
|
||
|
||
[DllImport("./osx_arm.os", EntryPoint = "otherMouseUp")] | ||
internal static extern void OtherClickUp(uint x, uint y); | ||
|
||
[DllImport("./osx_arm.os", EntryPoint = "otherMouseDown")] | ||
internal static extern void OtherClickDown(uint x, uint y); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace Desktop.Robot.Clicks.OSX.ARM | ||
{ | ||
internal record LeftClick(int delay) : IClick | ||
{ | ||
public int Delay => delay; | ||
|
||
public void ExecuteMouseDown(MouseContext context) | ||
{ | ||
Common.LeftClickDown((uint)context.Position.X, (uint)context.Position.Y); | ||
} | ||
|
||
public void ExecuteMouseUp(MouseContext context) | ||
{ | ||
Common.LeftClickUp((uint)context.Position.X, (uint)context.Position.Y); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace Desktop.Robot.Clicks.OSX.ARM | ||
{ | ||
internal record MiddleClick(int delay) : IClick | ||
{ | ||
public int Delay => delay; | ||
|
||
public void ExecuteMouseDown(MouseContext context) | ||
{ | ||
Common.OtherClickDown((uint)context.Position.X, (uint)context.Position.Y); | ||
} | ||
|
||
public void ExecuteMouseUp(MouseContext context) | ||
{ | ||
Common.OtherClickUp((uint)context.Position.X, (uint)context.Position.Y); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
namespace Desktop.Robot.Clicks.OSX.ARM | ||
{ | ||
internal record RightClick(int delay) : IClick | ||
{ | ||
public int Delay => delay; | ||
|
||
public void ExecuteMouseDown(MouseContext context) | ||
{ | ||
Common.RightClickDown((uint)context.Position.X, (uint)context.Position.Y); | ||
} | ||
|
||
public void ExecuteMouseUp(MouseContext context) | ||
{ | ||
Common.RightClickUp((uint)context.Position.X, (uint)context.Position.Y); | ||
} | ||
} | ||
} |