Thursday Oct 11, 2007

Stupid nv_74 cursor tricks

For those who have already grabbed Nevada build 74 from the Solaris Express Community Edition downloads, you can try out the new cursor code available with the integration of libXcursor (which most XFree86 and Xorg platforms have had for a while).

If your graphics card supports the Render extension & 32-bit alpha cursors, (i.e. most x86 graphics, but not Sun Rays nor SPARC graphics yet - I've mainly used it on nvidia cards and my laptop with a ATI Radeon chipset), you can see them in action by doing:

% su -
# mkdir -p /etc/dt/config/C/
# cat > /etc/dt/config/C/styleModern
#include "/usr/dt/config/C/styleModern"
Xcursor.theme: whiteglass
\^D
# exit

% echo 'Xcursor.theme: whiteglass' >> ~/.Xresources

and then logout & log back in.

Change 'whiteglass' to 'redglass' in the above if you want something that stands out more.

Thursday May 04, 2006

Workaround and upcoming fix for Xorg scroll wheel bug

I sent a note to our internal lists today and already got a half dozen "I thought it was just my system..." responses, so for other people suffering in silence, and not recognizing this, I'll post it here too:

There's a bug in Xorg 6.9 (included in Nevada builds 28 & later, S10U2, and S10 patches) in which if you scroll the wheel too fast on your wheel mouse, you get left/right wheel events instead of up/down, which is particularly annoying in Firefox, which interprets left/right wheel as back/forward page history.

From recent conversation, it appears a lot more people have been suffering in silence with this bug than have reported it to us.

If you're one of those, you may not have noticed that bug 6372113 has been updated with both a fix-in-progress, based on the upstream fix from X.Org, and a simple workaround of:

Change or add this line in the "InputDevice" section for your mouse in /etc/X11/xorg.conf:
        Option      "ZAxisMapping" "4 5 4 5"
(The default ZAxisMapping in Xorg 6.9 is "4 5 6 7".)

With the workaround, Xorg will still think it's getting left/right events, but will report them to applications as simply more up/down events. This will break people actually using left/right capable devices, like the internal-frkit enabled Ferrari 3400 scroll pad/button/thingy. The actual fix will allow both types of scroll events to work correctly, and has been put into our sources for Nevada build 40.

[Technorati Tags: , , , ]

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"
      ddxHandler="ddxSUNWmouse.so.1"
      ddxInitFunc="ddxSUNWmouseProc";

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 http://koala.ilog.fr/colas/mouse-wheel-scroll/.

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.

About

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

Disclaimer

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

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today