Log In  

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:

Cart #cursorlock-0 | 2022-10-06 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

I haven't seen anybody else use it, so is it even possible? The only thing saying it's possible is the wiki.

P#118685 2022-10-06 23:11


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.

P#118687 2022-10-06 23:18

@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?

P#118688 2022-10-06 23:29

Cart #ruhupibiri-0 | 2022-10-06 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA

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?

P#118691 2022-10-06 23:47

Ah ok, that would make sense. I was using education edition so I wouldn't be surprised if it had the same limitation.

P#118692 2022-10-06 23:54

bbs unfortunately doesn’t support mouse lock - only exports (binary/html) and pico8 desktop.

P#118710 2022-10-07 05:31

[Please log in to post a comment]