getlantern / systray

a cross platfrom Go library to place an icon and menu in the notification area
Apache License 2.0
3.28k stars 451 forks source link

Feature: Click callbacks #234

Open Purple-CSGO opened 2 years ago

Purple-CSGO commented 2 years ago

I've added callback functions for mouse left/right click events to fit customization. Examples and README are also adjusted. It works on my project as intended but I'm unable to test if it works on platforms other than windows.

P.S double clicks are not added cuz the lParam const value is not defined and I cannot find it from the doc in comments. Maybe we should customize and implement dbclick by calculating intervals between clicks ourselves?

P.S this PR would break original codes cuz two more callbacks are added to Run() and Register(), so it should be carefully notified when making a new release.