bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
36.39k stars 3.59k forks source link

Support double click recognition in `bevy_picking`. #16456

Open 443eb9 opened 4 days ago

443eb9 commented 4 days ago

What problem does this solve or what need does it fill?

bevy_picking currently only able to recognize the type of clicks, but can't, for counts.

What solution would you like?

Add a DoubleClick type.

What alternative(s) have you considered?

Supporting MultipleClick<const N: usize> would be better.

Additional context

None

BenjaminBrienen commented 4 days ago

I guess the plugin needs a max_delay: Duration parameter.

rosofo commented 3 days ago

https://learn.microsoft.com/en-us/windows/win32/inputdev/wm-lbuttondblclk https://developer.apple.com/documentation/appkit/nsevent/doubleclickinterval

Should the interval default to that set in the OS?

bezmuth commented 2 days ago

https://learn.microsoft.com/en-us/windows/win32/inputdev/wm-lbuttondblclk https://developer.apple.com/documentation/appkit/nsevent/doubleclickinterval

Should the interval default to that set in the OS?

It looks like Linux doesn't have a standard way to get this https://discourse.gnome.org/t/what-should-i-use-to-get-the-double-click-time/19917/2

BenjaminBrienen commented 2 days ago

How should this interact with single clicking? As in, do single clicks get delayed until the double click time has expired? Do both events happen?

BenjaminBrienen commented 2 days ago

I think the obvious answer is "both events happen", but I don't actually know how it is typically implemented.