Matt's Prototypes

I've developed a way to control Playdate using your mouse. Open source for anybody to use. Code and example app is included.

It works by having a small piece of code in the game to receive mouse events, and a PC helper to forward the mouse events (this part is Mac-only at the moment, as that's what I use).

For developers this is useful for tools (position items in your in-game level editor more easily and with higher precision).

For players it's a new accessibility option, a new analogue control method (select items more directly, etc)

I'll be supporting it in my own games going forward, when it makes sense to do so.

Because of my recording setup the video shows a lot of lag, but in real life there's no perceptible lag.

https://blog.gingerbeardman.com/2024/05/11/mouse-support-for-playdate/

2 Likes

Hi Matt,

Nice!
I have made some tests using the crank for cursor speed, to be able to both have precision and quick movement and thinks it works really good. I had some brief plans to make a vector editor and mouse support would be a nice addition.

I can see that it's a good combination to be able to do things on device only but also extend with mouse support.

playdate-20240516-091809
cursor.zip (84.9 KB)

1 Like

Nice! I agree, it should be used to augment the device capabilities.

For example in one of my upcoming games you can use dpad to move a cursor across a grid, or use the mouse to move a pointer and click (at which point the location is converted to a grid position). It's a different vibe playing with mouse.

I tried the Hammerspoon script but get no canvas and a mouse_fwd error.

2024-05-16 11:47:54: usbmodemPDU1_Y0777091
2024-05-16 11:47:54: -- Loading extension: inspect
2024-05-16 11:47:54: "usbmodemPDU1_Y0777091"
2024-05-16 11:47:54: -- mouse_fwd port not open
2024-05-16 11:47:54: -- Loading extension: osascript
2024-05-16 11:47:54: -- Loading extension: mouse
2024-05-16 11:47:54: -- Loading extension: screen
2024-05-16 11:47:54: -- Loading extension: canvas

@osterberg I've only seen this when the serial port is already in use by either Simulator or Mirror. Make sure both of those are not running.

If the port can't be opened the then you'll get an error beep and no canvas will appear.

(mentioned in the announcement blog post)

1 Like