Skip to content

Added double clicking to all buttons on Linux and Javascript#20385

Merged
akien-mga merged 1 commit into
godotengine:masterfrom
moiman100:unify-double-clicking
Dec 14, 2018
Merged

Added double clicking to all buttons on Linux and Javascript#20385
akien-mga merged 1 commit into
godotengine:masterfrom
moiman100:unify-double-clicking

Conversation

@moiman100

@moiman100 moiman100 commented Jul 23, 2018

Copy link
Copy Markdown
Contributor

Before only windows supported double clicking on all buttons.
Javascript didn't have double clicking at all and linux and OSX supported double clicking only on left/primary mouse button.

This PR adds double clicking support on all buttons for linux and javascript. For javascript to function properly #20081 is needed or there won't be release event after double click.

It might be better if someone else implements the OSX support, because I don't have a mac and the current implementation is quite different. Though it could be changed to similar to linux and javascript.

Fixes #20042. Not on mac obviously.

@mhilbrunner

Copy link
Copy Markdown
Member

Formatting needs to be fixed, see Travis CI output :)

@moiman100 moiman100 force-pushed the unify-double-clicking branch 2 times, most recently from b4f5905 to ed5a84e Compare July 25, 2018 18:54
@moiman100

moiman100 commented Jul 25, 2018

Copy link
Copy Markdown
Contributor Author

Formatted

@leonkrause leonkrause left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For HTML5, we should eventually let the OS/browser determine double clicks, but I want to fix life-cycle management before that. Until then this is a reasonable implementation.

Comment thread platform/javascript/os_javascript.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Member initialization goes into the constructor

Comment thread platform/javascript/os_javascript.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to wrap Vector2 in a Point2 constructor, it's just a typedef. Same for other cases below

@moiman100 moiman100 force-pushed the unify-double-clicking branch from ed5a84e to 51fa23a Compare August 12, 2018 09:42
@moiman100

Copy link
Copy Markdown
Contributor Author

Made the changes.

For HTML5, we should eventually let the OS/browser determine double clicks, but I want to fix life-cycle management before that. Until then this is a reasonable implementation.

I was going to use dblclick event, but according to this it only supports primary mouse button and the event is dispatched after mouse up, whereas Godot needs it after mouse down.

@akien-mga

Copy link
Copy Markdown
Member

Sorry for the delay. Let's give it a try in the master branch and see how user feedback goes - platform input harmonization is a great improvement :)

@akien-mga akien-mga merged commit 5f32fc8 into godotengine:master Dec 14, 2018
@akien-mga

Copy link
Copy Markdown
Member

Thanks!

@moiman100 moiman100 deleted the unify-double-clicking branch July 3, 2019 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants