How to read position of scrollwheel?

How to read position of scrollwheel?

Post by Johan Karlsso » Tue, 09 Apr 2002 18:31:30



Does anyone know how to read the scrollwheel position in xlib.

The XButtonEvent structure only contains x and y coordinates and so does
every other event that I know about.

/Johan

 
 
 

How to read position of scrollwheel?

Post by Kasper Dupon » Tue, 09 Apr 2002 19:23:59



> Does anyone know how to read the scrollwheel position in xlib.

> The XButtonEvent structure only contains x and y coordinates and so does
> every other event that I know about.

Usually one step up or down on the wheel gets reported
as a click on mousebutton 4 or 5.

--
Kasper Dupont -- der bruger for meget tid p? usenet.


 
 
 

How to read position of scrollwheel?

Post by Eric P. McC » Wed, 10 Apr 2002 01:49:16



> > Does anyone know how to read the scrollwheel position in xlib.
> > The XButtonEvent structure only contains x and y coordinates and so does
> > every other event that I know about.
> Usually one step up or down on the wheel gets reported
> as a click on mousebutton 4 or 5.

Yet it's reported to programs like Quake 3 as mouse3.  Is that bad
if/else progamming (if(mouse1), else if(mouse2), else) or something X does?

--

"Last I checked, it wasn't the power cord for the Clue Generator that
was sticking up your ass." - John Novak, rasfwrj

 
 
 

How to read position of scrollwheel?

Post by Kasper Dupon » Wed, 10 Apr 2002 23:18:57




> > > Does anyone know how to read the scrollwheel position in xlib.
> > > The XButtonEvent structure only contains x and y coordinates and so does
> > > every other event that I know about.

> > Usually one step up or down on the wheel gets reported
> > as a click on mousebutton 4 or 5.

> Yet it's reported to programs like Quake 3 as mouse3.  Is that bad
> if/else progamming (if(mouse1), else if(mouse2), else) or something X does?

I think that is just the way quake interprets it. I have seen
similar problems in some netscape versions where many other
programs on same display were able to use the scroll wheel.

You can change the wheels behaviour in individual programs
with rules in .Xdefaults or whatever is used in your
distribution.

--
Kasper Dupont -- der bruger for meget tid p? usenet.

 
 
 

How to read position of scrollwheel?

Post by Johan Karlsso » Thu, 11 Apr 2002 18:30:12




>> Does anyone know how to read the scrollwheel position in xlib.

>> The XButtonEvent structure only contains x and y coordinates and so
>> does every other event that I know about.

> Usually one step up or down on the wheel gets reported as a click on
> mousebutton 4 or 5.

That worked liked a charm. Thank you Kasper!

I hope it is always button 4 for wheel up and button 5 for wheel down
then.

/Johan

 
 
 

1. sort keys based on character positions, not field positions?

I'm working on a heavily-used (in our system) wrapper around /bin/sort.  A
file to be sorted,
key positions, and other sort parameters are passed into this routine, and
then /bin/sort is
system()'ed with the parameters.  Because the sort routine has no
information about the
actual contents of the file (whitespace, specifically), keys are defined in
terms of column positions,
and then /bin/sort is forced to treat the entire line as one field with the
argument:

sort "-t\\\n" +0.0 -0.72 ...

On SunOS 5.5.1, this fails with the message: "sort: option requires an
argument -- t".  This
particular routine has worked on Irix.

1) How can I portably define sort keys in terms of column positions, not
field positions?  Or,
equivalently, how can I indicate that sort should use the entire line as one
field, not whitespace
separated fields?

2) The "-t\\\n" syntax seems correct to me.  Is there a better solution?

I'd very much appreciate any tips.

Norbert Burger

2. IFMAIL installing

3. How do I read the cursor position?

4. The CURRENT macro

5. Cursor positioning/reading

6. Two KPPP problems

7. mtio - Locate and Read Position commands in Unix

8. Powerful Comments Against MicroSoft ---

9. : reading cursor position on vt100 terminal

10. Reading keys positions from keyboard

11. Reading terminal cursor position from the shell ?

12. Scrollwheels

13. mouse recommendation: 3 button, optical, *without* scrollwheel?