- in the /etc/X11/XF86Config file uner the Pointer section I
have:
Protocol “imps/2”
Device “/dev/mouse”
ZAxisMapping 4 5
with all the button emulation stuff commented out.
# Emulate3Buttons is an option for 2-button Microsoft mice
# Emulate3Timeout is the timeout in milliseconds (default is 50ms)
# Emulate3Buttons
# Emulate3Timeout 50 \
actually everything but the 3 lines above are commented out in the pointe section
- I ran imwheel
- I added this to the bottom of my .Xdefaults file in my home dir (this gets xterms to work right).
!# Scrolling on wheel mouse: half a page normally, line per line with
shift
XTerm.vt100.translations: #override\n\
Shift <Btn4Down> , <Btn4Up> :scroll-back(1,line)\n\
Shift <Btn5Down> , <Btn5Up> :scroll-forw(1,line)\n\
Ctrl <Btn4Down> , <Btn4Up> :scroll-back(1,page)\n\
Ctrl <Btn5Down> , <Btn5Up> :scroll-forw(1,page)\n\
<Btn4Down> , <Btn4Up> :scroll-back(1,halfpage)\n\
<Btn5Down> , <Btn5Up> :scroll-forw(1,halfpage)\n\
!# In the scrollbar we map buttons 5 & 4 to 1 and 2 otherwise, core dump
!# This will move proportionnaly to cursor position but we
dont know how
to
!# program the same exact behavior as in the text widget.
XTerm.vt100.Scrollbar.translations: #override\n\
<Btn5Down> : StartScroll(Forward)\n\
<Btn4Down> : StartScroll(Backward)\n\!## NETSCAPE
Netscape*drawingArea.translations: #replace \
<Btn1Down> : ArmLink() \n\
<Btn2Down> : ArmLink() \n\
~Shift <Btn1Up> : ActivateLink() \n\
~Shift <Btn2Up> : ActivateLink(new-window) \
DisarmLink() \n\
Shift <Btn1Up> : ActivateLink(save-only) \
DisarmLink() \n\
Shift <Btn2Up> : ActivateLink(save-only) \
DisarmLink() \n\
<Btn1Motion> : DisarmLinkIfMoved() \n\
<Btn2Motion> : DisarmLinkIfMoved() \n\
<Btn3Motion> : DisarmLinkIfMoved() \n\
<Motion> : DescribeLink() \n\
<Btn3Down> : xfeDoPopup() \n\
<Btn3Up> : ActivatePopup() \n\
Ctrl <Btn4Down> : PageUp()\n\
Ctrl <Btn5Down> : PageDown()\n\
Shift <Btn4Down> : LineUp()\n\
Shift <Btn5Down> : LineDown()\n\
None <Btn4Down> :
LineUp()LineUp()LineUp()LineUp()LineUp()LineUp()\n\
None <Btn5Down> :
LineDown()LineDown()LineDown()LineDown()LineDown()LineDown()\n\
Alt <Btn4Down> : xfeDoCommand(forward)\n\
Alt <Btn5Down> : xfeDoCommand(back)\n
Netscape*globalNonTextTranslations: #override\n\
Shift <Btn4Down> : LineUp()\n\
Shift <Btn5Down> : LineDown()\n\
None < Btn4Down> :LineUp()LineUp()LineUp()LineUp()LineUp()LineUp()\n\
None < Btn5Down> :LineDown()LineDown()LineDown()LineDown()LineDown()LineDown()\n\
Alt < Btn4Down> : xfeDoCommand(forward)\n\
Alt < Btn5Down> : xfeDoCommand(back)\n
< Key> KP_9: PageUp()\n\
< Key> KP_3: PageDown()\n\
< Key> KP_8: LineUp()\n\
< Key> KP_2: LineDown()\n\
< Key> KP_4: ColumnLeft()\n\
< Key> KP_6: ColumnRight()\n - I added this to the bottom of my .emacs in my home dir to get it
to work:
;;================================================================
;; scroll on mouse wheel
;;================================================================
;; scroll on wheel of mouses
(define-key global-map ‘button4
   ‘(lambda (&rest args)
     (interactive)
     (let ((curwin (selected-window)))
       (select-window (car (mouse-pixel-position)))
       (scroll-down 5)
       (select-window curwin)
)))
(define-key global-map [(shift button4)]
   ‘(lambda (&rest args)
     (interactive)
     (let ((curwin (selected-window)))
       (select-window (car (mouse-pixel-position)))
       (scroll-down 1)
       (select-window curwin)
)))
(define-key global-map [(control button4)]
   ‘(lambda (&rest args)
     (interactive)
     (let ((curwin (selected-window)))
       (select-window (car (mouse-pixel-position)))
       (scroll-down)
       (select-window curwin)
)))
(define-key global-map ‘button5
   ‘(lambda (&rest args)
     (interactive)
     (let ((curwin (selected-window)))
       (select-window (car (mouse-pixel-position)))
       (scroll-up 5)
       (select-window curwin)
)))
(define-key global-map [(shift button5)]
   ‘(lambda (&rest args)
     (interactive)
     (let ((curwin (selected-window)))
       (select-window (car (mouse-pixel-position)))
       (scroll-up 1)
       (select-window curwin)
)))
(define-key global-map [(control button5)]
   ‘(lambda (&rest args)
 &nbs  p (interactive)
     (let ((curwin (selected-window)))
       (select-window (car (mouse-pixel-position)))
       (scroll-up)
       (select-window curwin)
))) - for numpad
;;================================================================
;; scroll on numpad
;;================================================================
(define-key global-map ‘kp_9 ‘scroll-down)
(define-key global-map ‘kp_3 ‘scroll-up)
(define-key global-map ‘kp_6
   ‘(lambda (&rest args) (interactive) (other-window 1)))
(define-key global-map ‘kp_4
   ‘(lambda (&rest args) (interactive) (other-window -1)))
(define-key global-map ‘kp_2
   ‘(lambda (&rest args) (interactive) (scroll-up 1)))
(define-key global-map ‘kp_8
   ‘(lambda (&rest args) (interactive) (scroll-down 1)))
(define-key global-map ‘kp_7 ‘beginning-of-buffer)
(define-key global-map ‘kp_1 ‘end-of-buffer)
(define-key global-map ‘kp_5
   ‘(lambda (&rest args) (interactive) (recenter
0)))
April 9, 2004
Setup scrollable mouse in Linux
Comments Off on Setup scrollable mouse in Linux
No Comments
No comments yet.
RSS feed for comments on this post.
Sorry, the comment form is closed at this time.