Skip to content

Commit

Permalink
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.
  • Loading branch information
Jarod42 committed Sep 3, 2024
1 parent c333145 commit ca48408
Show file tree
Hide file tree
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.
Expand Down
20 changes: 10 additions & 10 deletions src/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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();
}
Expand Down

0 comments on commit ca48408

Please sign in to comment.