Re: [gtk-list] strokes interface



> I have been using lately a EDA CAD toolset that has a realy nice
> feature: it implements mouse strokes in all the programs in the
> toolset.
> 
> How does it work? You click the middle button of the mouse and then
> drag it as you were drawing something, a thin line is drawn on the
> screen, when you release the button the line is erased and the shape
> you have drawn is matched against some predifined shapes, if it
> matches one of the an acction associated with that shape is executed.
> 
> As an example a horizontal line drawn from right to left could mean
> "Cancel",  one drawn from left to right could mean "Ok", one at 45
> degree could mean "Zoom in", and one at 45 degree in the oposite sense
> could mean "Zoom out". 
>
> This is useful in very complex CAD packages, you won't need to go to a
> toolbar, and pick a tool all the time (which means that you have to
> move the mouse from the place on the screen were you are working if
> you have a stroke that picks the last tool you used, or zooms in and
> out, or undo, redo etc.). Even doing a right-click and then picking
> something from a menu is not as easy, as it distracts your
> attention. Or in a web browser if you have some strokes that do:
> forward, backward, etc. you won't have to reach for the toolbar, you
> can have the mouse anywhere.

This can also be very useful in the Gimp.
 
> This is implemented in Emacs-20.[23] and XEmacs-20.x (is anybody
> suprised?) 

[snip emacs code]

This is a good reason to upgrade from XEmacs 19.16 to 20.4. ;-)

> How does the stroke recognition works? You match the figure drawn
> against a matrix. 
> 
> For a 3x3 matrix, using a notation like phone pad:
> 
>  1 2 3 
>  4 5 6
>  7 8 9
> 
> a "456" stroke is a horizontal line from left to right.
> a "258" stroke is a vertical line
> 
> I have put some screenshots from the tool that uses strokes on the web
> at:
> http://www.ics.uci.edu/~dann/strokes1.jpg
> http://www.ics.uci.edu/~dann/strokes2.jpg

Hey, this is cool!

> I think that having strokes implemented in GTK would be a very good
> thing, and have a few strokes defined by default (like one for Ok and
> one Cancel), then the applications could define more specialized
> strokes. 
> It should not be too hard to implement it (the implementation in Emacs
> is less than 1000 lines of elisp code, well if this is a valid
> comparison...) 
> Probably the hardest problem is to decide how to represent the strokes
> (I like the phone pad notation, but it is limited...) and to have an
> interface to define strokes. 
> 
> What do you think about this? 

I think this is a good plan. The strokes idea looks very intuitive
to me. Just tried it in XEmacs, but IMHO it would definitively be a
very nice feature for GTK applications.

I have no idea how hard it will be to implement. I just use GTK as a
widget set, I never modified it.


Erik

-- 
J.A.K. (Erik) Mouw, Information and Communication Theory Group, Department
of Electrical Engineering, Faculty of Information Technology and Systems,
Delft University of Technology, PO BOX 5031,  2600 GA Delft, The Netherlands
Phone: +31-15-2785859  Fax: +31-15-2781843  Email J.A.K.Mouw@its.tudelft.nl
WWW: http://www-ict.its.tudelft.nl/~erik/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]