From 25be8b1be3bfe57a3d7a2c86be68dec4e51b93c3 Mon Sep 17 00:00:00 2001 From: Choupom Date: Fri, 3 Sep 2010 19:39:20 +0200 Subject: fixed so clicking 3 times doesn't generate 2 double-clicks --- src/engine/client/input.cpp | 8 +++++++- src/game/client/components/menus_demo.cpp | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/engine/client/input.cpp b/src/engine/client/input.cpp index c6d3f58e..195b78aa 100644 --- a/src/engine/client/input.cpp +++ b/src/engine/client/input.cpp @@ -87,7 +87,13 @@ void CInput::MouseModeRelative() int CInput::MouseDoubleClick() { - return m_ReleaseDelta < (time_freq() >> 2); + if(m_ReleaseDelta >= 0 && m_ReleaseDelta < (time_freq() >> 2)) + { + m_LastRelease = 0; + m_ReleaseDelta = -1; + return 1; + } + return 0; } void CInput::ClearKeyStates() diff --git a/src/game/client/components/menus_demo.cpp b/src/game/client/components/menus_demo.cpp index 82be758d..45a96d80 100644 --- a/src/game/client/components/menus_demo.cpp +++ b/src/game/client/components/menus_demo.cpp @@ -342,6 +342,7 @@ CMenus::CListboxItem CMenus::UiDoListboxNextItem(void *pId, bool Selected) if(m_EnterPressed || (Input()->MouseDoubleClick() && UI()->ActiveItem() == pId)) { gs_ListBoxItemActivated = true; + UI()->SetActiveItem(0); } else { -- cgit 1.4.1