Opened 8 years ago
Last modified 7 years ago
#4414 new defect
Click and double-click hotkeys
Reported by: | elexis | Owned by: | |
---|---|---|---|
Priority: | Nice to Have | Milestone: | Backlog |
Component: | Core engine | Keywords: | |
Cc: | Patch: |
Description (last modified by )
The current click and double click implementation is messy.
1) The usual GUI objects are handled in CGUI.cpp
and it implements a custom click-delay measurement to decide if there was a doubleclick, instead of parsing the clicks
count of the SDL_MouseButtonEvent.
2) Double-clicking in running games is again implemented with a custom timer in input.js
, instead of receiving a more low-level mousebuttondouble
event constructed in ScriptInterface::ToJSVal<SDL_Event_>
of GuiScriptConversions.cpp
.
3) Furthermore the meaning of click and doubleclicks is hardcoded in input.js
(depending on the inputState
).
It might be preferable if players could chose on their own what happens when clicking / doubleclicking and also assign alternative hotkeys to trigger the actions that are currently only possible with clicking.
The actions defined in input.js
should be moved to functions triggered from gui/session/hotkeys/
and subscribe to new hotkeys events defined in default.cfg
that are declared in KeyName.cpp
and constructed in HotkeyInputHandler
of Hotkey.cpp
.
Change History (4)
comment:1 by , 7 years ago
Description: | modified (diff) |
---|
comment:4 by , 7 years ago
Also requested that we can customize the duration between clicks and pixel distance: #4741.
In r19444:
Replace input.js doubleclick hack and ease doubleclicking on moving units.
Differential Revision: https://code.wildfiregames.com/D326
Patch By: causative
causative Refs #4414