SharpHook
SharpHook copied to clipboard
Question: Windows application is working but the same application does not work on a mac
I have created a dotnet maui application with the idea to build a windows desktop and a mac desktop application. The development is done on windowI have excapsulated the sharphook in an EventHook class. In this class I create an SimpleGlobalHook and call the RunAsync() to start monitoring keyboard and mouse.
The EventHook class is added an an singleton via the AddSingleton<IEventHook, EventHook>(); function.
The first time the eventhook is instantiated is in the constructor of the App class. The SimpleGlobalHook is created, callbacks are set and the RunAsync() is called. then the keys and mouse usage is monitored.
this is working perfectly in windows but on a mac is does not work, no keypressed or mousemovements are detected. when i am debugging and checking if the correct functions are called i can see it is running on the main thread.
I am new to the mac, do you know if there is some extra work to be done to get it working on a mac or should it be sort of plug-and-play?