/etc/X11/XF86Config の Section "Pointer" を
Section "Pointer"
Protocol "IMPS/2"
Device "/dev/mouse"
Resolution 100
ZAxisMapping 4 5
Buttons 5
EndSection
とする。
各userのホームに以下の内容の .mscroll というファイルをつくる。
proc mscroll {bindtag} {
bind $bindtag <Button-5> [list %W yview scroll 5 units]
bind $bindtag <Button-4> [list %W yview scroll -5 units]
bind $bindtag <Shift-Button-5> [list %W yview scroll 1 units]
bind $bindtag <Shift-Button-4> [list %W yview scroll -1 units]
bind $bindtag <Control-Button-5> [list %W yview scroll 1 pages]
bind $bindtag <Control-Button-4> [list %W yview scroll -1 pages]
}
各userの .Xdefaults には
!# KTerm
kterm*vt100.translations : #override\n\
<KeyPress>Prior : scroll-back(1,page)\n\
<KeyPress>Next : scroll-forw(1,page)\n\
<Btn4Down>,<Btn4Up> : scroll-back(1,halfpage)\n\
<Btn5Down>,<Btn5Up> : scroll-forw(1,halfpage)\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\
Ctrl Meta<KeyPress>y : insert-selection(PRIMARY, CUT_BUFFER0) \n\
Shift<Key>space : open-im(XMODIFIERS) \n\
Ctrl<Key>Kanji : open-im(XMODIFIERS)
kterm*vt100.Scrollbar.translations : #override\n\
<Btn5Down> : StartScroll(Forward)\n\
<Btn4Down> : StartScroll(Backward)
!# 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> : ColumnLeft()\n\
Shift<Btn5Down> : ColumnRight()\n\
None<Btn4Down> : LineUp()LineUp()LineUp()\n\
None<Btn5Down> : LineDown()LineDown()LineDown()\n\
Alt<Btn4Down> : xfeDoCommand(forward)\n\
Alt<Btn5Down> : xfeDoCommand(back)\n
Netscape*globalNonTextTranslations : #override\
~Meta ~Alt ~Ctrl<Key>space : xfeDoCommand(spacebar)\n\
~Meta ~Alt ~Ctrl<Key>Delete : PageUp()\n\
~Meta ~Alt ~Ctrl<Key>BackSpace : PageUp()\n\
~Meta ~Alt ~Ctrl<Key>Up : LineUp()\n\
~Meta ~Alt ~Ctrl<Key>Down : LineDown()\n\
~Meta ~Alt ~Ctrl<Key>Left : ColumnLeft()\n\
~Meta ~Alt ~Ctrl<Key>Right : ColumnRight()\n\
~Meta ~Alt ~Ctrl<Key>osfDelete : PageUp()\n\
~Meta ~Alt ~Ctrl<Key>osfBackSpace : PageUp()\n\
Meta Ctrl<Key>f : fishcam()\n\
Alt Ctrl<Key>f : fishcam()\n\
Meta Ctrl<Key>t : net_showstatus()\n\
Alt Ctrl<Key>t : net_showstatus()\n\
~Meta ~Alt ~Ctrl<Key>osfUp : LineUp()\n\
~Meta ~Alt ~Ctrl<Key>osfDown : LineDown()\n\
~Meta ~Alt ~Ctrl<Key>osfLeft : ColumnLeft()\n\
~Meta ~Alt ~Ctrl<Key>osfRight : ColumnRight()\n\
~Meta ~Alt ~Ctrl<Key>Prior : PageUp()\n\
~Meta ~Alt ~Ctrl<Key>Next : PageDown()\n\
~Meta ~Alt ~Ctrl<Key>osfPageUp : PageUp()\n\
~Meta ~Alt ~Ctrl<Key>osfPageDown : PageDown()\n\
None<Btn4Down> : LineUp()LineUp()LineUp()\n\
None<Btn5Down> : LineDown()LineDown()LineDown()\n\
Shift<Btn4Down> : ColumnLeft()\n\
Shift<Btn5Down> : ColumnRight()\n\
Alt<Btn4Down> : xfeDoCommand(back)\n\
Alt<Btn5Down> : xfeDoCommand(forward)\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
xdvi*translations : #override\n\
<Btn4Down>,<Btn4Up> :
<Btn5Down>,<Btn5Up> :
Shift<Btn4Down>,<Btn4Up> :
Shift<Btn5Down> :
xdvi*Scrollbar.translations : #override\n\
<Btn5Down> : StartScroll(Forward)\n\
<Btn4Down> : StartScroll(Backward)
などが必要。
Emacsは .emacs (or .emacs.el) に
;;; スクロールマウスの設定 GNU Emacs
(defun up-slightly () (interactive) (scroll-up 5))
(defun down-slightly () (interactive) (scroll-down 5))
(global-set-key [mouse-4] 'down-slightly)
(global-set-key [mouse-5] 'up-slightly)
(defun up-one () (interactive) (scroll-up 1))
(defun down-one () (interactive) (scroll-down 1))
(global-set-key [S-mouse-4] 'down-one)
(global-set-key [S-mouse-5] 'up-one)
(defun up-a-lot () (interactive) (scroll-up))
(defun down-a-lot () (interactive) (scroll-down))
(global-set-key [C-mouse-4] 'down-a-lot)
(global-set-key [C-mouse-5] 'up-a-lot)
;;;If you want to scroll by half a page instead of only 5 lines as above,
;;;John Rowe sent this GNU Emacs code:
;(defun scroll-up-half ()
; "Scroll up half a page."
; (interactive)
; (scroll-up (/ (window-height) 2))
;)
;
;(defun scroll-down-half ()
; "Scroll down half a page."
; (interactive)
; (scroll-down (/ (window-height) 2))
;)
;(global-set-key [(mouse-5)] 'scroll-up-half)
;(global-set-key [(mouse-4)] 'scroll-down-half)
などが必要。