Mouse wheel support

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

3 posts / 0 new
Last post
Mouse wheel support

Submitted by Anonymous on Fri, 12/26/2003 - 15:12.

Hello all.

We are thinking about adding mouse wheel support to OpenMotif.

It seems, that translation tables of XmText, XmScrollBar and XmScrolledWindow should be changed to support new mouse controls.

We should determine default behaviour of the mouse wheels we want to see in OpenMotif.

I investigated this functionality in other toolkits and found the following:

GTK2:
Scrolling 1st wheel
in text widget scrolls text by 3 lines
in vertical and horizontal scroll bars scrolls by 5 steps
Scrolling 1st wheel with Shift, Control or Meta(Alt) key pressed
in text widget scrolls text by 5 lines
in vertical and horizontal scroll bars scrolls by 5 steps
Scrolling 2nd wheel
in text widget scrolls text horizontaly by 30 chars
in vertical and horizontal scroll bars scrolls by 5 steps
Scrolling 2nd wheel with Shift, Control or Meta(Alt) key pressed
in text widget scrolls text horizontaly by 30 chars
in vertical and horizontal scroll bars scrolls by 5 steps

Qt:
Scrolling 1st wheel
in text widget scrolls text by 3 lines
in vertical and horizontal scroll bars scrolls by 3 steps
Scrolling 1st whell with Shift or Control key pressed
in text widget scrolls text by 5 lines
in vertical and horizontal scroll bars scrolls by 5 steps
Scrolling 1st wheel with Meta(Alt) key pressed
in text widget scrolls text horizontally by 3 lines
in vertical and horizontal scroll bars scrolls by 3 steps
Scrolling 2nd wheel
in text widget scrolls text horizontaly by 8 chars
in vertical and horizontal scroll bars scrolls by 3 steps
Scrolling 2nd wheel with Shift or Control key pressed
in text widget scrolls text horizontaly by 1 page
in vertical and horizontal scroll bars scrolls by 5 steps
Scrolling 2nd wheel with Meta(Alt) key pressed
in text widget scrolls text horizontaly by 8 chars
in vertical and horizontal scroll bars scrolls by 3 steps

Windows XP
Scrolling 1st wheel
in text widget scrolls text by 3 lines
in vertical and horizontal scroll bars does nothing
Scrolling 1st wheel with Shift or Control key pressed
in text widget scrolls text does nothing
in vertical and horizontal scroll bars does nothing
Scrolling 1st wheel with Meta(Alt) key pressed
in text widget scrolls text horizontally by 3 lines
in vertical and horizontal scroll bars does nothing
Scrolling 2nd wheel
does the same as the 1st wheel

So, I wonder what the behaviour will be the best _default_ behaviour for OM.

Any ideas?

 

 

Thu, 01/29/2004 - 20:39#1

Anonymous

Mouse wheel support

The amount of scrolling that occurs via mouse wheel support in GTK2 and Qt seems to be fine when no modifier keys are pressed. When one modifier is down, the scrolling proceeds with a larger jump size. And that's it. There are no higher "gears". You can either scroll at the base rate or one rate higher than that.

Having worked on an embedded test equipment (TTC's TBerd 310), I found it to be a good idea to include "gears" when dealing with a large amount of scrolling. In the case of very big HTML pages or even text files, a lot of scrolling can be required. This will quickly get tiring on a mouse wheel.

To keep the wheel useful in such situations, I suggest that a 2nd modifier key be configured so that scrolling begins using a much larger jump size, perhaps a single windowfull per scroll. This arrangement could be taken one last step farther by having both modifiers (or a third) down, and the jump increases 10-fold. That would allow very fast scrolling and thus become useful when the page is big.

As for the TBerd 310, its scrolling was time-based. I had to scroll through 100 items in a menu using a single line maybe 20 chars wide. The first 4 scrolls occurred once per second. If the down button was still pressed, the scrolling jumped to one item per 1/4 second. After another 4 seconds, the last rate would begin, scrolling maybe 20 items per second. This type of scrolling, if it were adapted to Open Motif, could be applied to the up and down arrows of a scrollbar.

Jim Olson

 

 I'm a little late to this

 I'm a little late to this party, but ... Ever since I got my first mouse with a wheel on it, probably using LessTif, I have loaded the following translations via xrdb

<code>

*XmContainer.baseTranslations: #augment <Btn5Down>: ContainerMoveCursor(Down)\n<Btn4Down>: ContainerMoveCursor(Up)\n
*XmList.baseTranslations:       #augment <Btn5Down>: ListNextPage()\n<Btn4Down>: ListPrevPage()\n
*XmScrollBar.baseTranslations:  #augment <Btn4Down>: IncrementUpOrLeft(0) IncrementUpOrLeft(1)\n <Btn5Down>: IncrementDownOrRight(0) IncrementDownOrRight(1)\n
*XmSpinBox.accelerators:        #override <Btn5Down>: SpinBPrior()\n<Btn5Up>: SpinBDisarm()\n<Btn4Down>: SpinBNext()\n<Btn4Up>: SpinBDisarm()\n<Key>osfUp: SpinBNext()\n<Key>osfDown: SpinBPrior()\n<KeyUp>osfUp: SpinBDisarm()\n<KeyUp>osfDown: SpinBDisarm()\n<Key>osfLeft: SpinBLeft()\n<Key>osfRight: SpinBRight()\n<KeyUp>osfLeft: SpinBDisarm()\n<KeyUp>osfRight: SpinBDisarm()\n<Key>osfBeginLine: SpinBFirst()\n<Key>osfEndLine: SpinBLast()
*XmText.baseTranslations:       #augment Shift<Btn4Down>: page-left()\nShift<Btn5Down>: page-right()\n<Btn5Down>: next-line()\n<Btn4Down>: previous-line()\n
*XmComboBox*baseTranslations:   #augment <Btn5Down>: CBListAction(Down)\n<Btn4Down>: CBListAction(Up)\n
*toolTipEnable: True
*Sounds:        False
*background:    #bfbfbf
*lircEnable:    False
*strokeSound:   /usr/local/sounds/chord.wav
*SoundCommand:  play
*toolTipString: no tip
XTerm.vt100.scrollBar:  False
XTerm.vt100.translations:       #override <Btn4Down>,<Btn4Up>:scroll-back(1,line)\n<Btn5Down>,<Btn5Up>:scroll-forw(1,line)\n
Mgdiff*form2.text.translations: #overfide <Btn4Down>: Scroll(Up)\n<Btn5Down>: Scroll(Down)\n
MGv*Ghostview.translations:     #augment <Btn4Down>: mgvScroll(up, magical)\n<Btn5Down>: mgvScroll(down, magical)
MGv.wlShowSplashScreen: False
 

</code>