Re: [NTLK] Newton Quickwriting - sending characters back from a C++ thread to NS

From: Jim Witte (
Date: Wed Mar 27 2002 - 17:10:08 EST

Jim, did you finish this project? I'd love to try it!

   No I never did. It might be still floating around somehwere on one of
the 9 or so CDRs that back up my stuff at various points (think a
geologic record that's been put in a blender - I *really* need to find a
nice file cataloguer/categorizer/updater - prefereably one that can
packet-write CDRs too..)

   I got a very rough beginning working, but one main problem was in
detecting when the user went from a corner box to the center box,
without catching one of the other boxes "on the way in". this could
probably be done with some rather tricky math (to do and to optimize),
or probably with some kind of a neural net architecture. The other,
bigger problem was speed. Repeatedly calling GetMouse in the viewStroke
method (from the top of my head) from Newtonscript, and doing all the
processing in Newtonscript is far too slow to allow anything even
approching a usable entry speed (well-trained Graffitti speed or
higher). On possibility I though of was to record and entire stoke
which would encompass multiple "character swirls", and then pass the
whole stoke data unit to a C++ function, which would pull out the data
and do the calculations. I'd have to process each data point
seperately, but at the C++ level, it would probably be fast enough.
This however would preclude updating the display in the NS world as you
wrote (unless I could pass data back to the NS thread somhow for
updating, which probably be possible - I'll have to poke around in the
Mad Max and Waba source to see if it's done)

   Another idea is that if I could get access to the inker itself from
C++, I could just forgo NS entirely, except for "put a character here"
callbacks. But to my knowledge none of the low-level inker interfaces
are documented. I saw a Usenet message dated sometime back in the
mid-late nineties about how to generate a pen-press event from C++, but
that's it. And I can't find that now, although I should look, since
Google Groups seems to have reopened their older archives since they
aquired them from DejaNews.

   The holy grail of all this would be to know enough about the low-level
OS to be able to write your own recognition algorithm that you could
plug into the inker, (maybe) the same way both Rosetta and the Paragraph
engine do. You might also be able to rejigger Grafitti to work like
this, although it would probably involve ARM disassembling the Graffitti
functions and wrapping them up in whatever p-class you'd need in your
own assembly code. But I have no idea if the NewtOS is layered well
enough to allow this kind of plug-in architecture to work. My suspicion
is it's not - and even if you could get enough docs to do it (miracle
from God and Jobs), it would probably cause things to break in strange

   Anyway, right now I'm covered up with embarrasingly simple but
tedious-to-code Java program for my CS class (a damn pizza calculator
applet, temperature graph, space invaders, and a solitaire game), and
reading for Cognative Science..

Jim Witte

Read the List FAQ/Etiquette:
Read the Newton FAQ:
This is the NewtonTalk mailing list -

This archive was generated by hypermail 2.1.2 : Tue Apr 02 2002 - 14:03:41 EST