This Trac instance is not used for development anymore!

We migrated our development workflow to git and Gitea.
To test the future redirection, replace trac by ariadne in the page URL.

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 elexis)

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 elexis, 7 years ago

Description: modified (diff)

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

comment:2 by elexis, 7 years ago

In 19583:

Fix doubleclicking if the unit died between the clicks following rP19444, refs #4414, https://code.wildfiregames.com/D326

Differential Revision: https://code.wildfiregames.com/D469
Patch By: causative

comment:3 by elexis, 7 years ago

In 19786:

Prevent unintentional selection of all units following rP19444 / D326 when doubleclicking while not in selection input mode.

Differential Revision: https://code.wildfiregames.com/D634
Fixes #4631.
Refs #4414.
Patch By: causative

comment:4 by elexis, 7 years ago

Also requested that we can customize the duration between clicks and pixel distance: #4741.

Note: See TracTickets for help on using tickets.