Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bindings for setting and getting emulation mouse from touch and touch from mouse in input #86076

Closed
wants to merge 25 commits into from

Conversation

KoTeYkA23
Copy link
Contributor

This will allow to set emulation of this input events in runtime, for example enabling it in game menu on touchscreen only device to allow use Control based buttons

@KoTeYkA23 KoTeYkA23 requested a review from a team as a code owner December 12, 2023 13:54
Comment on lines 146 to 149
ClassDB::bind_method(D_METHOD("set_emulate_mouse_from_touch", "p_emulate"), &Input::set_emulate_mouse_from_touch);
ClassDB::bind_method(D_METHOD("is_emulating_mouse_from_touch"), &Input::is_emulating_mouse_from_touch);
ClassDB::bind_method(D_METHOD("set_emulate_touch_from_mouse", "p_emulate"), &Input::set_emulate_touch_from_mouse);
ClassDB::bind_method(D_METHOD("is_emulating_touch_from_mouse"), &Input::is_emulating_touch_from_mouse);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
ClassDB::bind_method(D_METHOD("set_emulate_mouse_from_touch", "p_emulate"), &Input::set_emulate_mouse_from_touch);
ClassDB::bind_method(D_METHOD("is_emulating_mouse_from_touch"), &Input::is_emulating_mouse_from_touch);
ClassDB::bind_method(D_METHOD("set_emulate_touch_from_mouse", "p_emulate"), &Input::set_emulate_touch_from_mouse);
ClassDB::bind_method(D_METHOD("is_emulating_touch_from_mouse"), &Input::is_emulating_touch_from_mouse);
ClassDB::bind_method(D_METHOD("set_emulate_mouse_from_touch", "enable"), &Input::set_emulate_mouse_from_touch);
ClassDB::bind_method(D_METHOD("is_emulating_mouse_from_touch"), &Input::is_emulating_mouse_from_touch);
ClassDB::bind_method(D_METHOD("set_emulate_touch_from_mouse", "enable"), &Input::set_emulate_touch_from_mouse);
ClassDB::bind_method(D_METHOD("is_emulating_touch_from_mouse"), &Input::is_emulating_touch_from_mouse);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are this property name only visual or this is reference to function properties?

Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

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

You should bind those as properties (ADD_PROPERTY below, see how it's done for use_accumulated_input), and then sync the class reference by running your compiled Godot with --doctool to generate the documentation template (and fill the description).

@akien-mga akien-mga requested a review from a team December 12, 2023 13:58
@akien-mga akien-mga added this to the 4.x milestone Dec 12, 2023
@KoTeYkA23 KoTeYkA23 requested a review from a team as a code owner December 12, 2023 14:28
@AThousandShips
Copy link
Member

Please use rebasing to update your branch instead of merge commits, you will need to squash your commits, see here

@KoTeYkA23
Copy link
Contributor Author

I think i messed up something seriously, it will be easier to create new pr, sorry about that

@KoTeYkA23 KoTeYkA23 closed this Dec 12, 2023
@AThousandShips AThousandShips removed this from the 4.x milestone Dec 12, 2023
@AThousandShips
Copy link
Member

Make sure to open your new PR on a dedicated branch and make your changes there and not master

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.

6 participants