I cannot figure out what's happening with btn()
. It seems totally random. I made this cart so you can see. I thought it was supposed to imitate PICO-8's btn()
function, but that's clearly not happening.
Also, if anyone knows how to get data from different controllers, please share. Usually I would do something like btn(btn_num, controller_num)
but with btn()
acting the way it is... 🤷😂
Okay, figured it out. Thanks to @Waporwave on the Discord server, I checked to see if I had a controller plugged in. And I did! That was messing with all my values. Unplugged the controller and now it works fine, as expected.
BUT! Also kind of weird that just having the controller plugged in (not being pressed or anything) totally bugged out the arrow keys. So, still something to debug there.
Using this program I can see now why I can't properly read my Switch Pro D-Pad.
This is fixed for 0.1.0f -- and yes, it was broken deadzone code.
The btn() calls process the raw values in two ways:
-
the magnitude of x,y sticks is clamped to 1.0: more often than not what you want when paying attention to analogue values, and
- holding left and right cancel each other out -- reduce the number of carts that require pressing both L and R at the same time without realising it is impossible on some installations
It will still be possible to grab raw values from @5400 though if needed.
[Please log in to post a comment]