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

Added mouse api interface #731

Merged
merged 9 commits into from
Dec 10, 2024
Merged

Added mouse api interface #731

merged 9 commits into from
Dec 10, 2024

Conversation

KiritoDv
Copy link
Contributor

@KiritoDv KiritoDv commented Dec 3, 2024

This PR Adds a mouse support api for future port implementations

API:

Ship::Coords Window::GetMousePos();
Ship::Coords Window::GetMouseDelta();
Ship::CoordsF Window::GetMouseWheel();
bool Window::GetMouseState(Ship::MouseBtn btn);
void Window::SetMouseCapture(bool capture);
bool Window::IsMouseCaptured();

co-authored-by: @lightmanLP

Copy link
Collaborator

@briaguya-ai briaguya-ai left a comment

Choose a reason for hiding this comment

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

Overall this all seems reasonable. What would be wonderful to see is a proof-of-concept of a port using it (possibly updating HarbourMasters/2ship2harkinian#870 to use it)

The main issue with HarbourMasters/2ship2harkinian#870 is that it directly changes Controller.cpp in LUS to write relative mouse to gyro.

@garrettjoecox any chance you have ideas on how to accomplish what HarbourMasters/2ship2harkinian#870 is doing using this PR as a base?

garrettjoecox added a commit to garrettjoecox/libultraship that referenced this pull request Dec 10, 2024
@garrettjoecox
Copy link
Contributor

@garrettjoecox any chance you have ideas on how to accomplish what HarbourMasters/2ship2harkinian#870 is doing using this PR as a base?

@briaguya-ai https://github.com/HarbourMasters/2ship2harkinian/pull/870/files Have another look. Not beautiful (just applying it to the gyro) but I think the LUS side of this is fine, will be up to the port to determine what to do with the input.

@briaguya-ai
Copy link
Collaborator

Not beautiful (just applying it to the gyro)

that's perfect for a proof of concept! just knowing this API works and nothing else is needed/has to be changed on the LUS side is what i was hoping to learn!

Copy link
Collaborator

@briaguya-ai briaguya-ai left a comment

Choose a reason for hiding this comment

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

:shipit:

garrettjoecox added a commit to garrettjoecox/libultraship that referenced this pull request Dec 10, 2024
@Kenix3 Kenix3 merged commit ee1c0df into Kenix3:main Dec 10, 2024
5 checks passed
@MegaMech
Copy link
Contributor

MegaMech commented Dec 11, 2024

I tested this on mk64 and it worked. I did not test all the features. But mouse tracking was good.

lightmanLP added a commit to lightmanLP/libultraship that referenced this pull request Dec 13, 2024
* Added WIP mouse support

* Fixed compilation

* Added mouse press state

* Fixed tidy

* Added support for mouse capturing (SetMouseCapture)

* Added mouse wheel support

* mouse backward & forward support

* bool IsMouseCaptured()

---------

Co-authored-by: lightmanLP <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants