mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-31 02:08:03 +01:00
NetDriver triple click bug fix. (#1422)
This commit is contained in:
@@ -698,6 +698,13 @@ namespace Terminal.Gui {
|
||||
mouseEvent.ButtonState = buttonState;
|
||||
//System.Diagnostics.Debug.WriteLine ($"ButtonState: {mouseEvent.ButtonState} X: {mouseEvent.Position.X} Y: {mouseEvent.Position.Y}");
|
||||
|
||||
if (isButtonDoubleClicked) {
|
||||
Application.MainLoop.AddIdle (() => {
|
||||
Task.Run (async () => await ProcessButtonDoubleClickedAsync ());
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
if ((buttonState & MouseButtonState.Button1Pressed) != 0
|
||||
|| (buttonState & MouseButtonState.Button2Pressed) != 0
|
||||
|| (buttonState & MouseButtonState.Button3Pressed) != 0) {
|
||||
@@ -865,6 +872,13 @@ namespace Terminal.Gui {
|
||||
});
|
||||
}
|
||||
|
||||
async Task ProcessButtonDoubleClickedAsync ()
|
||||
{
|
||||
await Task.Delay (300);
|
||||
isButtonDoubleClicked = false;
|
||||
buttonPressedCount = 0;
|
||||
}
|
||||
|
||||
void ProcessButtonDoubleClicked (MouseEvent mouseEvent)
|
||||
{
|
||||
var me = new MouseEvent () {
|
||||
|
||||
Reference in New Issue
Block a user