On 2010-03-23 16:05-0400 Hazen Babcock wrote:

> Alan W. Irwin wrote:
>> On 2010-03-22 10:58-0400 Hazen Babcock wrote:
>> 
>>> On my linux box the xcairo device does not respond to mouse clicks, only
>>> key presses.
>>> 
>>> I thought I would look up how the devices are supposed to respond, but
>>> it looks like plGetCursor() is undocumented. I'd be happy to fill in the
>>> documentation and implement for the Qt devices, but, any thoughts on
>>> what the "correct" behavior should be? I think we have the following
>>> possibilities for when this function should return:
>>> 
>>> (1) After any key press or mouse event including movement.
>>> (2) Key press and mouse button events (release events only?).
>>> (3) Mouse button event only.
>>> (4) Key press only.
>>> (5) Other permutations of the above.
>> 
>> This is an important topic which I am glad you have brought up again.
>> 
>> As far as getting proper documentation started, there is a whole lot
>> of commentary in the xwin.c code concerning cursor(s), crosshairs, etc.,
>> which should give a good start to that effort.
>
> Ok. I will take care of adding the documentation for plGetCursor().
>
>> To summarize all these key/mouse button identification issues, we probably
>> want to deliver the exact same keysym symbolic (i.e., not hexadecimal)
>> identification information as xev currently does for its key release 
>> events.
>> That should be straightforward to implement since the xev source code is
>> available under the permissive MIT license.
>
> As of v10880, xcairo event handling should match that of xev. It detects 
> button press and release events as well as key press and release events. I 
> think we need to return press and release events in both cases for different 
> reasons. For the mouse, as you mentioned, this allows the possibility of drag 
> events, though it is going to be a bit sub-optimal without also returning 
> motion events. For the keyboard, this is one way to handle modifiers like Alt 
> and Shift.
>
> I took advantage of the string element of PLGraphicsIn to return the key 
> characters and button events as you requested. Hopefully this did not have 
> some other purpose. Example 1 has been extended to print this element of the 
> structure.

It works as you describe here on Linux.  However, I suggest you should
output a press or release flag to distinguish those two cases.  That might
require a change to PLGraphicsIn to propagate that information to example 1.

The other issue I want to bring up now is that there is obviously a tonne of
infrastructure for X events in xwin.c.  It's not perfect for our current
-dev xwin needs, and I understand no details of the code, but just from the
lines of code involved, I believe it is doing much more than what you are
now doing with xcairo. Once you understand that event infrastructure for
-dev xwin and have fixed it up for our current -dev xwin needs I assume you
will want to move the part of it that would be commonly useful for all our
X-related devices to the PLplot core library, and then adapt xcairo to use
that common infrastructure.  This would help support the ultimate goal which
is that X events are handled exactly the same way for all our X-related
devices.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Plplot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to