Monday Jul 19, 2004

Followup notes on Solaris wheel mouse support

Jürgen Keil pointed out on the Solaris x86 mailing list that the wheelmaps syntax I covered earlier works with his driver as well and that you may need to override the number of buttons set by kdmconfig on Solaris x86 for certain customizations.

Someone posting as "fogh" on comp.unix.cde provided wheel mouse bindings for CDE's dtwm window manager. I never thought of using the mouse wheel to change workspaces, but that seems like a cool use of it.

Friday Jul 16, 2004

Wheel Mouse support for Solaris: Part 3: Configuring the mouse events

In my previous two posts I've described how to get the software to support the mouse scroll wheel and how to use it with applications. This post finishes up the series on the new wheel mouse support with a description of how to change the way the Xsun server reports the scroll wheel rolls to the applications. For almost all users, the default configuration will be what they want and there will be no need to change it. However, if the default settings don't quite match what you want, there are a variety of changes you can make to the scroll wheel handling by editing the class="XINPUT" entries in the OWconfig file. (Note that these instructions only cover the wheel mouse support in Xsun for directly connected PS/2 & USB mice, not Sun Rays or other X servers.)

For example, to make the mouse on a SPARC system roll in the opposite direction of the usual, you would change the "IMOUSE" entry in /usr/openwin/server/etc/OWconfig to look like this:

   # Sun Mouse module
   class="XINPUT" name="IMOUSE"
      wheelmaps="1=buttons 5 4"

On x86, the mouse XINPUT entry is usually found in /etc/openwin/server/etc/OWconfig and would be changed in a similar fashion.

The format of the wheelmaps option is:

wheelmaps="wheel id=[times x ]action[,wheel id2=[times2 x ]action2...]mappings"

wheel id is an integer in the range 1-255 to specify a specific wheel or a \* to match all wheels without a specific entry.

An action of "axis X" or "axis Y" maps wheel rolls to movement along the specified axis. An action of "buttons A B " maps negative deltas to presses & releases of button A, and positive deltas to presses & releases of button B. A value of "keycodes A B " maps negative deltas to presses & releases of a key with keycode A, and positive deltas to presses & releases of a key with keycode B. (Mapping these keycodes to keysyms is left to the user, sysadmin, and/or desktop defaults.) An action of "discard" discards the events.

The optional times modifier specifies number of times a button or keyboard event should be generated for each delta unit of wheel motion, or the number of pixels the delta should be multiplied by when generating motion events. The value must be a positive number for button and keyboard events, but may be negative for motion events. (Normally rolling the wheel "up" generates motion towards the origin, so specifying a negative pixels value reverses the direction of the motion.) If the times modifier is not specifed, the default value of 1.0 is used for all types of event. If a non-integer value is specified, events may be buffered until enough are accumulated to represent a whole event. For example, if a value of 0.25 is specified, only one out of every 4 single-delta wheel events will be reported.

If not specified for a given mouse device, the default is equivalent to:

   wheelmaps="\*=1.0 x buttons 4 5"
for compatibility with the XFree86 defaults, Sun Ray implementation, and existing wheel mouse aware X applications. When one or more wheels on a mouse device are mapped to buttons, the mouse DDX will, if necessary, increase the number of buttons the mouse is reported as having to at least as many as the highest button id assigned to a wheel action.

For example, when testing with the Logitech MouseMan Wheel, I found it worked better with a slightly modified configuration. This mouse has 3 buttons plus a wheel, which can also be pressed as a button. In the default configuration, pressing the wheel button is reported as button 2, while the button on the side where the thumb normally rests is button 4. The default configuration resulted in the thumb button presses scrolling up, just as rolling the scroll wheel up did. To make the buttons more usable it was simply necessary to set the wheelmap action to "buttons 5 6" and then run

    xmodmap -e "pointer = 1 6 3 2 4 5"
which mapped the "thumb" button to button id 2, the wheel as a button to button 6, and the turns of the wheel to buttons 4 & 5 where the clients expect them.

Thursday Jul 15, 2004

Wheel Mouse support for Solaris: Part 2: Using it with applications

The default configuration of the wheel mouse support in Solaris (both the new support for workstations in my previous post and the existing support in the Sun Ray 2.0 software) is to map the wheel rolls to presses of buttons 4 & 5, as done in XFree86 and other X servers. Because of this, software written to support scroll wheels in those other servers often just starts working on Solaris as soon as you install the wheel mouse support, and much other software can be easily configured to do so as well. Software that should just work includes GNOME 2.0 and other software using the GTK+ toolkit, Mozilla, Netscape 7.0, and StarOffice 7. The Xsun patch for Solaris 9 that introduces workstation wheel mouse support also includes an update to the Solaris xterm to support scroll wheels as well.

There's an existing site with tips for many applications, including older versions of Netscape, at

Additionally, you can add scroll wheel support to some of the existing CDE & X applications on Solaris by adding entries to your $HOME/.Xdefaults file such as these:

\*DtTerm\*Translations: #override \\
        Shift<Btn4Down>:        scroll(-1,page) \\n\\
        Shift<Btn5Down>:        scroll(1,page) \\n\\
        None<Btn4Down>:         scroll(-5,line) \\n\\
        None<Btn5Down>:         scroll(5,line)

\*DtEditor.textTranslations: #override \\
        Shift<Btn4Down>:        previous-page() \\n\\
        Shift<Btn5Down>:        next-page() \\n\\
        None<Btn4Down>:        process-up()process-up()process-up()process-up()process-up() \\n\\
        None<Btn5Down>:        process-down()process-down()process-down()process-down()process-down()

\*DtHelpDialog\*textTranslations: \\
           <Btn4Down>:	       PageUpOrDown(1)\\n\\
           <Btn5Down>:	       PageUpOrDown(0)

Xman\*help\*Paned.manualPage.translations:#override \\
				<Key>Prior: Page(Back) \\n\\
				<Key>Next : Page(Forward)  \\n\\
      				Shift<Btn4Down>,<Btn4Up>: Page(Line,-1) \\n\\
			        Shift<Btn5Down>,<Btn5Up>: Page(Line,1) \\n\\
			        Ctrl<Btn4Down>,<Btn4Up>: Page(Back) \\n\\
				Ctrl<Btn5Down>,<Btn5Up>: Page(Forward) \\n\\
				None<Btn4Down>,<Btn4Up>: Page(Line,-5) \\n\\
				None<Btn5Down>,<Btn5Up>: Page(Line,5)

Xman\*manualBrowser\*manualPage.translations:  #override \\
				<Key>Prior: Page(Back) \\n\\
				<Key>Next : Page(Forward) \\n\\
				Ctrl<Key>s: PopupSearch() \\n\\
      				Shift<Btn4Down>,<Btn4Up>: Page(Line,-1) \\n\\
			        Shift<Btn5Down>,<Btn5Up>: Page(Line,1) \\n\\
			        Ctrl<Btn4Down>,<Btn4Up>: Page(Back) \\n\\
				Ctrl<Btn5Down>,<Btn5Up>: Page(Forward) \\n\\
				None<Btn4Down>,<Btn4Up>: Page(Line,-5) \\n\\
				None<Btn5Down>,<Btn5Up>: Page(Line,5)

(You won't need any of these entries on Solaris Express 5/04 and later, or Solaris 10, since they're already included in the default X resource sets for those applications in those releases. You can add them though if you want to customize the rates at which the wheel scrolls the text in those applications, or mappings of the modifier keys to effects.)

Tuesday Jul 13, 2004

Wheel Mouse support for Solaris: Part 1: Getting the software

After years of talking about it, we finally got the input device driver group and the X group together late last year to add support for mouse scroll wheels to Solaris. The support first appeared in Solaris Express 4/04 for USB mice on SPARC systems, and Solaris Express 5/04 for USB & PS/2 mice on x86 systems, and has now been backported to patches for Solaris 9 (which will be incorporated in the next Solaris 9 update release).

To get the support for Solaris 9, you need to install these patches or later releases, which should all be on SunSolve soon:

Solaris 9 sparc
112785-36X11 6.6.1: Xsun patch
115553-08SunOS 5.9: USB Drivers and Framework Patch
115004-02SunOS 5.9: /kernel/misc/kbtrans patch
117418-01SunOS 5.9: consms patch
S9 x86Needed for
112786-25X11 6.6.1_x86: Xsun patchUSB or PS/2
115554-10SunOS 5.9_x86: USB Drivers and Framework patchUSB
117417-01SunOS 5.9_x86: consms patchUSB
115003-02SunOS 5.9_x86: kbtrans patchUSB
117419-01SunOS 5.9_x86: wheel mouse support vuid PatchPS/2

If you use the Xorg or XFree86 servers instead of Xsun, you should already have support for PS/2 wheel mice from the raw PS/2 support in those servers directly. To get support for USB wheel mice, you'll need the updated drivers from the above patches or Solaris Express, and either get the latest Xorg source from CVS or apply the patch from Xorg Bugzilla #434.

For Sun Rays, the support was included directly in Sun Ray Server Software 2.0, and none of the above is needed.

For Solaris 8, there are freeware drivers written by two members of the Solaris community:

Later this week I'll write more about how to configure it and using it in applications.

Monday Jul 12, 2004

Solaris Express 7/04

The release notes for Solaris Express 7/04 (aka Solaris 10 Beta 5) have gone up on in preparation for the release later this week. Of the features they highlight, I think pstack support for Java programs is the coolest (but as noted previously, I look at these things from the developer point of view, so features like Zones that appeal to sysadmins don't excite me as much).

Of those not listed in the release notes, the features & fixes I find most interesting are:

Of course, there's much much more than that - the full list of bug & RFE id's that went into this release (including those from bundled products such as the Java (1.)5.0 Beta) is over 1000 lines long.

Tuesday Jul 06, 2004

It's a small world...

I grew up in Ely, a small town in eastern Nevada of around 5,000 people (among several other places). Since leaving in 1990, I don't often hear much about it - I occasionally check the website of the local paper to see what's up, but otherwise rarely hear much about it or see it in the news or on other web sites.

So you can imagine my surprise when I was reading Rich Burridge's blog right here on Sun's blog site and found out that the Millenium Clock project plans to build their clock near there. I had heard of the project before, but not that they'd chosen a location so near my hometown - it took a coworker who came from the other side of the planet to let me know about that.

Of course, Rich is a bit more than just a random co-worker - even as Rich moves from group to group inside Sun it seems he's always nearby. We are both members of one of Sun's architectural review committees, and have both put in many hours the last few months working on projects for Solaris desktop support on the upcoming, semi-announced Opteron workstations.

And since we've both joined the Sun blog craze, I've learned Rich wrote one of my favorite programs when I was first using Unix — faces. It provides a icon for each user in your inbox or logged into the machine. It used to be quite popular on the main Unix machine of the CS undergrad group at Berkeley. Users provided their own icons, and you can see here what I came up with given my lack of scanner and artistic talent to serve as mine.

Quite a few of us used it as an early form of "buddy list" to see who was logged in - we used the standard Unix "write" and "wall" commands on that machine to communicate with each other (and eventually a customized version of write called nwrite which we found more suited to heavy use as a chat facility). This was of course long before all the current instant messenger protocols now in use, though IRC was starting to get popular at that time - but even today there's still people on that machine using the old tools.


Engineer working on Oracle Solaris and with the X.Org open source community.


The views expressed on this blog are my own and do not necessarily reflect the views of Oracle, the X.Org Foundation, or anyone else.

See Also
Follow me on twitter


« July 2004 »