Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Apply Guichan's changes from f0e7bcb9b32c2fddfcc8c76c16cbd06e136caa07…
Browse files Browse the repository at this point in the history
… (Sept 10th 2008)

Click count in mouse events should now work as expected if the time stamp supplied by back ends is a time stamp in milliseconds when the event occurred.
Jarod42 committed Sep 3, 2024
1 parent c333145 commit dcec62d
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion TODO
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
* Continue rebasing from f0e7bcb9b32c2fddfcc8c76c16cbd06e136caa07
* Continue rebasing from 6725f3b08248d94e3ac11ce530aec42e3029fc62
* Add a focus listener interface.
* Make focus apply synchronously.
* Graphics and input objects for DirectX.
20 changes: 10 additions & 10 deletions src/gui.cpp
Original file line number Diff line number Diff line change
@@ -528,6 +528,16 @@ namespace gcn
sourceWidget->requestFocus();
}

if (mouseInput.getTimeStamp() - mLastMousePressTimeStamp < 250
&& mLastMousePressButton == mouseInput.getButton())
{
mClickCount++;
}
else
{
mClickCount = 1;
}

distributeMouseEvent(sourceWidget,
MouseEvent::Pressed,
mouseInput.getButton(),
@@ -539,16 +549,6 @@ namespace gcn
mFocusHandler->setDraggedWidget(sourceWidget);
mLastMouseDragButton = mouseInput.getButton();

if (mLastMousePressTimeStamp < 300
&& mLastMousePressButton == mouseInput.getButton())
{
mClickCount++;
}
else
{
mClickCount = 1;
}

mLastMousePressButton = mouseInput.getButton();
mLastMousePressTimeStamp = mouseInput.getTimeStamp();
}

0 comments on commit dcec62d

Please sign in to comment.