Re: Ink
Re: Ink
- Subject: Re: Ink
- From: Raleigh Ledet <email@hidden>
- Date: Thu, 26 Jan 2006 16:08:17 -0800
On Jan 26, 2006, at 3:20 PM, Ricky Sharp wrote:
Raleigh,
Thank you very much for your very detailed description!
NP.
Currently, I allow users of my app to write their answers to math
problems. It really works well!
I downloaded the Demo of you app and the Demo does not have this
feature. Darn! I just wanted to see it in action.
I will definitely file a few enhancement requests about adding a
Cocoa wrapper. I would really like to see something like this:
- (void)inkText:(NSString*)text;
- (void)inkGesture:(int)gesture;
That's basically what I added as wrappers around handling the Ink
carbon events.
Yeah, along with the inkPoint events as well. The guy behind inkBook
does his own ink drawing, so he has his own Ink Objects and an
InkableView and stuff.
One problem I initially had though was when I would write my number
such that digits were spaced a bit apart (beyond the tolerance as
set by the system prefs), each digit would produce a separate
event. To solve this, I just enqueue recognized text into a buffer
(NSString) and only dispatch that string after a certain delay.
Basically, if I get multiple Ink events that are very close
together, I coalesce them into a single string.
Yes. When Ink finishes a "Phrase" it recognizes all the text at once
and sends inkText events back to back.
Do you think that coalescing should also be handled by the Cocoa
APIs? I'm thinking that it would be best to just get a single
NSString back. Apple could just inject spaces in between the
individual recognized strings. One could then just filter out the
spaces if need be (basically what I'd do in my case).
I disagree. inkText events not only have the recognized word, but
also the data to redraw the word as well. Not to mention the
alternative recognitions too. The Ink SketchPad does a good example
of how Apple envisioned it's use. The recognized word is wrong, user
right-clicks on the word and a drop down menu with the alternates
come down and even shows the image of the original inking as a
refresher.
Another example is that inkBook wants each individual word so the
user can move them around. If the spacing is too big, then the user
can adjust the Ink pref settings and / or use the "Join" gesture to
combine the two words into 1.
Understandably, this does not work for your scenario, and your
scenario should be taken into account with the API. (See below)
One final thing I thought I'd share is that because I only accept
digits as input, I convert '\', '/', '|' and 'l' to ones and
captial/lower-case 'O' to zeroes. This greatly helps the accuracy
of the input.
This is where I think a "Hint" capability would be especially useful.
You could inform ink that you expect 1 phrase of nothing but numbers
and no spaces. With this hint, Ink would not only combine largely
spaced objects into 1 inkTextEvent, but it would also auto convert
'\', '/', '|', 'l', 'o', 'O' to the right thing for you.
-raleigh
PS Why don't you do the ink drawing yourself? Perhaps in a nice chalk
motif?
-----------------------------------------------
Raleigh Ledet, <email@hidden>
Wacom Technology Corp.
Mac Software Engineer
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
References: | |
| >(no subject) (From: Raleigh Ledet <email@hidden>) |
| >Re: Ink (From: Ricky Sharp <email@hidden>) |