thread-pond / signature-pad

A jQuery plugin for assisting in the creation of an HTML5 canvas based signature pad. Records the drawn signature in JSON for later regeneration.
BSD 3-Clause "New" or "Revised" License
730 stars 290 forks source link

Signature Pad with Pointer Lock #120

Open janz892033 opened 10 years ago

janz892033 commented 10 years ago

Hi, would it be cool if the signature pad had an ability to lock the cursor on the canvas?

thomasjbradley commented 10 years ago

That's an interesting idea that I hadn't thought about. What would happen if someone put a looping flourish in their signature? Would it draw along the edge?

janz892033 commented 10 years ago

:smile: I think as long as the signature is within the canvas it would draw, It's just that whenever you're drawing your signature and accidentally went out of the canvas, the cursor is selecting or dragging everything outside the signature pad. Well, that's just a minor issue for me.

stephenlawuk commented 9 years ago

I was trying to this myself alongside this plugin so I could essentially focus on the canvas only when a button is pressed so I can grab a graphics tablet input but haven't had much luck so far other than locking to the element (Can't get it to draw).

I did find some reading material related to the API which firefox and chrome use (no IE support yet) which might help though.

http://www.w3.org/TR/pointerlock/ https://developer.mozilla.org/en-US/docs/Web/API/Pointer_Lock_API https://developer.mozilla.org/en-US/docs/Web/API/Element/setCapture http://www.smartjava.org/content/html5-use-pointer-lock-api-restrict-mouse-movement-element