Let the simulator receive mouse events

I've made 2 level editors so far in my games, and one thing that would speed things up for me is if the simulator could handle mouse events, since I have to make more levels.

ie:
function playdate.mousehandler(button, state, x, y)
-- buttons: 1=left, 2=middle, 3=right
-- states: 1=moving while released, 2=down, 3=moving while down, 4=just released
end

2 Likes

Yes! I requested this many years ago, would still love to see it.

When I presented my use-case it was for the editor in Daily Driver and I compared Pico 8 dev mode mouse support.

1 Like

Using the new playdate.serialMessageReceived(message) API I've created my own solution for mouse support/control.

With a few caveats:

  • mouse forwarding script is macOS-only right now
  • works only with the device connected over USB

https://devforum.play.date/t/matts-prototypes/826/201

Would be much better if the Simulator had this built in, perhaps as an option, and that it also forwarded mouse events to a connected device if "Control Device with Simulator" was checked.

Related issue