[Y-devel] Widget set progress
jswensen at intergate.com jswensen at intergate.com
Sat Apr 17 19:21:36 BST 2004
This would be a great use of polymorphism. Any type of manipulator should have
a base class that contains some basic info (as suggested in another post) about
the number of axes, buttons, and other manipulators. A reference to the
manipulator should be included in the event parameters. Then the reference to
the device itself can provide the developer with the capabilities and button
mapping. Usually when there are a lot of additional buttons and features(like
detecting the angle of the pen on a tablet or the pressure on the tablet) they
are handled in an application specific manner with standard mapping provided by
the manufacturer or driver developer. The real key is to identify those that
are not application specific and make them part of the base class. It is easy
enough at a later time to move items from the derived class into the base class,
if an when they appear to be more standard than initially thought. I think that
this thread has identified a lot of the more standard ones, and those that are not.
This is how it is done in C# with DirectX 9 and joysticks. They require you to
derive from the base joystick class and then allow you to create properties to
access the buttons and axes with different names, or you can continue to use
them by the names Button1 through Button1kadjillion. Some hardware vendors
(like Logitech) ship the class already derived with names for their buttons like
TopLeft, LeftPad, RightStick, etc.
This won't work directly for non-OO languages like C, but it can be done easy
enough using some sort of device enumeration rather than derived classes.
As an aside, I always thought it would be cool to have multiple pointer devices.
Especially when running dual or triple displays. Maybe this is already
possible in X, but lets make it possible in Y.
John
Quoting Thorsten Wilms <t_w_ at freenet.de>:
> On Sat, Apr 17, 2004 at 02:43:14PM +0200, JP Dinger wrote:
> >
> > Oh and what about spaceballs? Maybe a joystick isn't too far out for
> > moving around the mouse cursor? How does one intergrate a tablet?
>
> Well, taking any and all possible pointing devices into account
> will be too hard, I think.
> But the most common options besides mice have to be considered.
> For the tablett the only extra that has to be dealt with is
> pressure.
>
> > While I think rolification is basically a good idea, what (standard)
> > roles do we have for mouse buttons? We have standard _functions_,
> > as well as even more non-standard functions, but no fixed role ``per
> > click''. FreeBSDs moused (and net- and openbsds too, I think, and
> > the linux equivalent probably as well) allows one to swap mouse
> > button numbers. That is much more of a hack but probably easier both
> > to implement and to explain to users.
>
> Well, I think that role-names for the 3 common mouse buttons
> would underline consistency. It are just names, but handling a
> MouseLeftClick event that realy is from a right button because
> of remapping on another level ...
> Even just numbering (primary, secondary, tertiary) would be
> more elegant.
>
> > > Standard modifier keys could be defined for simulating the missing
> > > buttons on those mice (click with modifier key directly translated
> > > to the 'role').
> > > Maybe support an arbitrary number of buttons on pointing devices.
> > > And don't forget the mouse wheel.
> >
> > Or a mouse-mini-joystick instead of the wheel, and an extra wheel on
> > the side, and...
> >
> > Most of these are short-lived fads, but since they all have something
> > or other in common, abstraction seems indeed the way to go.
>
> Yes, best is to concentrate on what is common between pointing devices.
> But at least mousewheels, maybe the Microsoft 2 direction thingy and for
> sure pressure (tabletts) should be dealt with right from start.
>
>
> ---
> Thorsten Wilms
>
>
-------------------------------------------------
This mail sent through IMP: https://horde.org/imp/
More information about the Y-devel mailing list
2026 © www.Y-Windows.Org - All Rights Reserved