Handwriting / Stylus input ?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Traxgeek
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Wed Jan 09, 2013 10:11 am

Handwriting / Stylus input ?

Post by Traxgeek » Mon Apr 08, 2013 11:32 am

Hi,
A friend was quizzing me about handwriting input in LC over the weekend. I had to admit I had no idea as to whether handwriting input was available or not at the current time.
I did some forums and google searching but failed to determine definitively whether handwriting in LC was a current feature or not.

I could see that one <i>could</i> use the pen a and drawing features to create something from scratch but this kind of 'start from scratch' type-of-thing usually turns into a long winded nightmare... just wondered if LC was 'handwriting i/p ready' ?
Oh yeah - she doesn't need any form of 'recognition' or 'conversion-to-typeface' (at the moment (!!) - but I'm sure she will in the future IF the basics of handwriting is available) - that's one complication out of the way !

She also asked whether it was possible to create a 'video' of the screen and gave me the example of -1- wanting to make notes and drawings (with a stylus prefarably but maybe also with the keyboard) and, -2- whilst doing so, have LC capture the screen as she was working/updating it and finally, -3- have LC create a video of the whole thing for playback. Not too sure if I'm explaining that particularly well.

I gather both items / functionalities would be core in an app she has in mind to track people's logic / thought processes in working out puzzles / filling in forms on tablets etc. etc...

Being an experienced programmer but a total novice to LC, I wasn't sure if either of these features (handwriting and screen capture to video file) were available. I know I could do this in a previous incarnation with a different product BUT have totally committed myself to LC (well, at this for this year ;-) ) so would only get involved with helping her IF it were possible with the existing arsenal available to us in LC.

At the mo I'm deep in it with other projects (with LC) but any pointers, help, tips and general feedback would be greatly appreciated... and, who knows, may lead to future app development.

Hope you won't be shy with any ideas !

Regards.
I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Handwriting / Stylus input ?

Post by jmburnod » Mon Apr 08, 2013 3:50 pm

Hi TraxGeek,

Have a look to the Bernd's stack in attachment

Best regards

Jean-Marc
Attachments
DrawBN.livecode.zip
(2.28 KiB) Downloaded 283 times
https://alternatic.ch

Traxgeek
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Wed Jan 09, 2013 10:11 am

Re: Handwriting / Stylus input ?

Post by Traxgeek » Mon Apr 08, 2013 6:44 pm

Thanks Jean-Marc.

Bernd's drawing stack looks cool and gives me more than the basics to get going making her a demo scribble pad 'thingy' (I guess Benrd's OK with that ? - I won't plagarise his code - just use it as a lesson for me).

All I need now is a way to record the screen as the user draws / scribbles for future playback. I'll look into that next - kinda like grabbing a screen dump at a reasonable fps rate and creating a video / .mov file from the resulting snapshots.

Again, thanks a million. Much appreciated.

Regards.
I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: Handwriting / Stylus input ?

Post by bn » Mon Apr 08, 2013 8:12 pm

Hi Traxgeek,

Of course you can use the code any way you want, part of the code is from Dixie, I guess he does not mind either.

If you want to use this on a mobile touch device replace the mouseDoubleUp to clear the screen with a button. mouseDoubleUp is not reliable on touch devices since you don't hit the same pixel twice easily and the system thinks it is two mouseUps.

If you want to use it to make an animation of the scribblings you could export a screenshot from the graphic as an image and use Trevor Devore's Quicktime External to assemble the movie, all from within Livecode. But this only works on desktop, not mobile.
The external for Mac and Windows are here:
http://www.bluemangolearning.com/revolu ... rnals/eqt/

Kind regards
Bernd

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: Handwriting / Stylus input ?

Post by Dixie » Mon Apr 08, 2013 11:09 pm

Hi Bernd...:-)

John Craig came up with a really good method for 'replaying' a scribble, a painting or whatever at a later date...
The essence of what he did was to record the points of the graphic along with time, in millisecs, when it was created... then drew it onto the card using the relative time difference along with points of the graphic... it works really well... but it is John Craig's work and so I can't post it... but the hint is there...

Dixie

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4172
Joined: Sun Jan 07, 2007 9:12 pm

Re: Handwriting / Stylus input ?

Post by bn » Tue Apr 09, 2013 12:29 am

Hi Dixie,

nice to see you :)
John Craig came up with a really good method for 'replaying' a scribble, a painting or whatever at a later date...
I don't know what John Craig did but here is a little bare bones replay stack. It records the milliseconds when a point is drawn and puts it into an array. The milliseconds are the keys of the array and the x,y coordinates the values.

Then the replay is reconstructed from the array. Waiting the difference in milliseconds between draws.

Would probably have to be refined quite a bit for serious work. But I just liked the idea to replay the drawing of a graphic. Although Traxgeek rather wanted a movie.
DrawAndReplay.livecode.zip
(2.47 KiB) Downloaded 247 times
it is basically the same stack as the one Jean-Marc posted, just added a clear button instead of double click to clear the drawing and a replay button

Kind regards
Bernd

Traxgeek
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Wed Jan 09, 2013 10:11 am

Re: Handwriting / Stylus input ?

Post by Traxgeek » Wed Apr 10, 2013 8:30 am

Hey Dixie / Bernd.

AWSOME !

Huge pointers there. Maybe I will be able to help my friend with her idea. I'll revert as-and-when with progress.

Thanks a million - both of you !
I'm 'getting there'... just far too slowly !
Mac (Siera) and PC (Win7)
LiveCode 8.1.2 / 7.1.1

Post Reply