natinusala / borealis

Hardware accelerated, controller and TV oriented UI library for PC and Nintendo Switch (libnx)
Apache License 2.0
260 stars 83 forks source link

Use sticks to navigate #52

Closed Chrscool8 closed 3 years ago

Chrscool8 commented 4 years ago

Demo Vid

Pretty straight-forward, quick and easy chunk of code that sets the d-pad nav values based on the stick states. Works perfect and feels great except for one thing.

The main problem is that other, more wide-spread problem, where if you push two directions at the same time, multiple things can accept the focus. This is a lot easier to do on the same frame with a diagonally pressed stick than pushing two distinct d-pad buttons at the same time. I can add a band-aid where it'll only accept right/left stick inputs when not pushing up/down, but like I said, that's just a fix for this one case.

Chrscool8 commented 4 years ago

Band-aid commit above prioritizes up and down over left and right. It feels almost exactly the same but will never do the split-up as long as you're only using one type of control at once.

natinusala commented 4 years ago

Hey, I like that thanks!

Did you try on PC? How does it behave when using directional keys?

Also I think there should be a focus lock that prevents a focus change when another is going, but at the focus system level, not at the input level. There can be as many inputs as we want at the same time in one frame, the system should be able to handle that.

Chrscool8 commented 4 years ago

Thanks!

Not sure. I've never actually been able to compile for Windows because I can't figure out how to get my msys2 to find and install the mingw packages required. :\

Agreed on that last part!

natinusala commented 4 years ago

If you use the mingw msys2 everything will work out of the box

Chrscool8 commented 4 years ago

Nice, got most of that going, just trying to get it to find glfw3 now.

Chrscool8 commented 4 years ago

Got it going on PC! Works great with an Xbox controller now, too.

natinusala commented 4 years ago

Nice, did you tackle the multiple focus issue?

Chrscool8 commented 4 years ago

That's still working with the band-aid. Gonna look into that deeper soon!

Chrscool8 commented 4 years ago

Card link just for handy reference: https://github.com/natinusala/borealis/projects/1#card-25958217

natinusala commented 4 years ago

Can you rebase on master once the other PR has been merged? Thanks :D

Chrscool8 commented 4 years ago

Can do!

natinusala commented 3 years ago

I will close this PR as I don't accept contributions for master anymore.

However I will port your changes to the yoga branch, while keeping authorship. Unless you want to do it yourself?

Chrscool8 commented 3 years ago

You're welcome to pull 'em over yourself if it isn't too much trouble! Hoping to help with the new version soon when I get back into dev stuff. Thanks!