So according to the wiki, if you poke(0x5f2d, 0x4), it turns on pointer lock mode, and then you can use stat(38) and stat(39) to read X and Y mouse movement. This isn't working for me, though. Both stat()s just return 0 no matter what. I'm not sure if you have to poke(0x5f2d, 0x1) first too, but either way it's not changing anything.
Here's a little demo cart to demonstrate:
I haven't seen anybody else use it, so is it even possible? The only thing saying it's possible is the wiki.
Have you tried adding the flags and calling it just once? (0x5). I think what's happening is that your 0x4 call is resetting the flags and thus turning off devkit mouse support.
@2bitchuck I hadn't tried it, but I just did and it didn't change anything. I don't know very much about memory so just to make sure I'm doing what you said, you're suggesting I use poke(0x5f2d, 0x5) and not 0x1 or 0x4?
Correct. I tried using 0x5 in my local PICO-8 with your code and it did seem to work for me, but the same cart didn't work on the BBS, so maybe it's just a BBS limitation?
Ah ok, that would make sense. I was using education edition so I wouldn't be surprised if it had the same limitation.
bbs unfortunately doesn’t support mouse lock - only exports (binary/html) and pico8 desktop.
[Please log in to post a comment]