Re: [AD] Linux mouse patch

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Shawn Hargreaves <shawn@xxxxxxxxxx> wrote:
> tjaden@xxxxxxxxxx writes:
> > 
> > But a little problem came up.  The mouse wheel only generates data
> > when the wheel moves, not when it stops moving.
> 
> Urgh, that's a pain. It sounds like the wheel would be better described as a 
> third axis, rather than a button, since it doesn't have a clear on/off 
> state. Adding a mouse_z axis would involve changing quite a lot of files, 
> but it would mostly just be a matter of searching for mouse_x/mouse_y, and 
> adding a third entry wherever they are referenced.

Originally I added a variable `mouse_wh', so it is not too hard to do.

However, using the wheel as an axis in the classic case (with scroll
bars) would require user programs to constantly store the previous
value and compare it with the current value in order to see if it has
changed.  In this case I think a new function to reset mouse_z to zero
after the value has been checked would be very handy.
`reset_mouse_z', anyone?

> Alternatively we could have poll_mouse() clear the bit, so it would be a 
> sticky thing like how reading mouse mickeys behaves. But that has the risk 
> of losing input if the wheel is turned more than one notch in between two 
> polling calls, and would require user programs to only ever read the mouse 
> in polling mode if they want to access the wheel, so I don't think it is 
> such a great idea.

poll_mouse() could be used to reset the third axis.  This way no
"extra" input will be lost, and the wheel will still feel like
buttons, as opposed to an axis.

I was going to suggest this was the better option, but then I reread
the bit in docs about how poll_mouse() turns off asynchronous mouse
updating, which does not sound very nice...

In another message GAH suggested "sticky bits".  I can tell you first
hand that this is *very* annoying behavior, and at the very least,
unexpected.

Peter
-- 
tjaden@xxxxxxxxxx - http://www.alphalink.com.au/~tjaden/
"What's in the box?"  "Pain."



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/