File tree Expand file tree Collapse file tree
YMouseButtonControl.Core/Services/KeyboardAndMouse/Implementations Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,17 +42,13 @@ public partial class EventSimulatorService(
4242 IEventSimulator eventSimulator
4343) : IEventSimulatorService
4444{
45- public void SimulateMousePress ( MouseButton mb )
46- {
47- var t = new Thread ( ( ) => eventSimulator . SimulateMousePress ( mb ) ) ;
48- t . Start ( ) ;
49- }
45+ // needs to be ran from another thread in windows due to mouse button suppress behavior
46+ public void SimulateMousePress ( MouseButton mb ) =>
47+ new Thread ( ( ) => eventSimulator . SimulateMousePress ( mb ) ) . Start ( ) ;
5048
51- public void SimulateMouseRelease ( MouseButton mb )
52- {
53- var t = new Thread ( ( ) => eventSimulator . SimulateMouseRelease ( mb ) ) ;
54- t . Start ( ) ;
55- }
49+ // needs to be ran from another thread in windows due to mouse button suppress behavior
50+ public void SimulateMouseRelease ( MouseButton mb ) =>
51+ new Thread ( ( ) => eventSimulator . SimulateMouseRelease ( mb ) ) . Start ( ) ;
5652
5753 public void SimulateKeyPress ( string ? key )
5854 {
You can’t perform that action at this time.
0 commit comments