Wazzaps / fingerpaint

Draw using your laptop's touchpad
GNU General Public License v2.0
135 stars 6 forks source link

Feature Request: "hover" cursor #17

Open mdmayfield opened 2 years ago

mdmayfield commented 2 years ago

This is a great & fun project - thanks for making it. I saw it on OMG! Ubuntu.

Would you consider implementing a mode where we only see a cursor at the point on the canvas that a touch corresponds to...and then it only draws while holding down a key?

Thank you!

ittayd commented 1 year ago

+1 FWIW

ittayd commented 1 year ago

I tried to fiddle with the code. I can't see how to make the cursor appear where drawing is supposed to be. The code just draws on the canvas while the cursor is even out of the window.

Wazzaps commented 1 year ago

I don't use the OS cursor at all (because I take absolute measurements from the touchpad directly, rather than relative movements like the OS cursor)

You can create a cursor image after this line and take the last line of each event and move the cursor there.

Then add a boolean to each event/line signaling when the key/button (whichever you prefer) is pressed, to determine if you want to draw or not (read it in the event loop).

Make sure to disable the logic that closes the window when any key/button is pressed or your window will close.

Sorry for not having much time to maintain this app, but that's the beauty of open source, you don't need my permission to add it :)