GithubHelp home page GithubHelp logo

On click tray event ? about systray HOT 6 OPEN

getlantern avatar getlantern commented on June 29, 2024 10
On click tray event ?

from systray.

Comments (6)

LukePulverenti avatar LukePulverenti commented on June 29, 2024 5

Exposing a double click event would also be nice.

from systray.

myleshorton avatar myleshorton commented on June 29, 2024 2

We aren't able to pull away to implement this right away unfortunately but PRs are most welcome!!!

from systray.

let4be avatar let4be commented on June 29, 2024

Same question...

from systray.

biter777 avatar biter777 commented on June 29, 2024

Please, implement the "On click tray event" (WM_RBUTTONUP / WM_LBUTTONUP).
Maybe as OnIconTrayClickHandler()...

Please! :)

from systray.

jredh avatar jredh commented on June 29, 2024

@myleshorton point me in the right direction and I can tackle this

from systray.

tmalaher-telus avatar tmalaher-telus commented on June 29, 2024

I started down this road for windows, trying to create a minimal change to handle right-click, left-click and left-double-click, but ran into the following questions:

  1. Should it use a channel or set of channels (like existing menu click handlers) or should it be "OnIconTray[Left|Right][Double]ClickHandler" as suggested by @biter777
  2. Distinguishing single click from double click requires "debouncing" (when you receive a click, wait a bit to see if it is really going to be the first click in a double click), as per https://devblogs.microsoft.com/oldnewthing/20041015-00/?p=37553

So for the moment my modifications fit my needs: distinguishing RightClick from LeftDoubleClick. But obviously that's not completely general:

systray_windows.go function wndProc line ~ 284:

		switch lParam {
		case WM_RBUTTONUP://, WM_LBUTTONUP:
			t.showMenu()
		case WM_LBUTTONUP:
			//XXX: need to debounce so this doesn't fire on a double click
			//start timer, wait, cancel timer if double click arrives, send msg on timer end
			//and also ignore subsequent click event after double click
			//systrayClicked()
		case WM_LBUTTONDBLCLK://WM_LBUTTONUP:
			//XXX: cancel timer here, tell single slick to eat next click
			systrayDoubleClicked() 
		}

from systray.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.