1 #-----------------------------------------------------------------------------#
3 # 9. Mouse, frame buttons and keyboard bindings
5 #-----------------------------------------------------------------------------#
8 #------------------------------------------------------------------------------
9 # First, for the mouse in the root window (Context=R)
10 # Button 1 gives the Utilities menu
11 # Button 2 gives the Window Ops menu
12 # Button 3 gives the WindowList (like TwmWindows)
13 # I use the AnyModifier (A) option for the modifier field, so you can hold down
14 # any Shift-Ctrl-whatever combination you want!
15 # Moreover on a window the same bindings are defined with the Alt modifier
16 #------------------------------------------------------------------------------
19 # Button Context Modifi Function
21 Mouse 1 R A Menu Utilities mouse -1p -1p
22 Mouse 2 R A Menu Window mouse -1p -1p
23 Mouse 3 R A WindowList mouse -1p -1p
24 Mouse 3 R C WindowList mouse -1p -1p OnlyListSkip
26 #Mouse 1 W M Menu Utilities mouse -1p -1p
27 #Mouse 2 W M Menu Window mouse -1p -1p
28 #Mouse 3 W M WindowList mouse -1p -1p
29 #Mouse 3 W CM WindowList mouse -1p -1p OnlyListSkip
32 #G_SESSION 3 bind Shift Mouse * to gnomebutton
33 #Mouse 1 R S GnomeButton
34 #Mouse 2 R S GnomeButton
35 #Mouse 3 R S GnomeButton
37 #------------------------------------------------------------------------------
38 # Now the rest of the frame
39 # Here I invoke my complex functions for Move-or-lower, Move-or-Raise-Shade,
40 # and Resize-or-Raise.
41 #------------------------------------------------------------------------------
43 # Button 1 in the corners or sides, with any modifiers, gives resize or raise
44 Mouse 1 FS A Function "Resize-or-Raise-or-Shade"
46 # Button 1 in the title, sides, w/ any modifiers, gives move or raise or shade
47 Mouse 1 T A Function "Move-or-Raise-or-Shade"
48 Mouse 1 FS C Function "Move-or-Raise-or-Shade"
50 # Button 1 in an icons gives move for a drag, de-iconify for a double-click,
51 # raiselower for a single click
52 Mouse 1 I A Function "Move-or-Iconify-or-Raise"
53 # Alt Button 1 on an icons raise all icons
54 Mouse 1 I M All (CurrentPage Iconic) Raise
56 # Button 2 in an icon, w/ any modifiers, gives de-iconify
59 # Button 2 in the corners, sides, or title-bar gives the window ops menu
60 Mouse 2 FST A Menu Window-Ops2
62 # Button 3 anywhere in the decoration (except the title-bar buttons)
64 Mouse 3 TSF A RaiseLower
67 Mouse 3 I A Menu Window-Ops3 c+0 -101m
69 # Button 3 in the window, with the Modifier-1 key (usually alt or diamond)
70 # gives Raise-Lower. Used to use control here, but that interferes with xterm
71 Mouse 3 W SM RaiseLower
74 #-----------------------------------------------------------------------------
75 # Mouse windows buttons binding
76 # buttons: 1 3 5 7 9 8 6 4 2
77 #------------------------------------------------------------------------------
80 # Button Context Modif Function
81 Mouse 1 1 A Function "window_ops_func"
82 Mouse 2 1 A Menu WindowGroupOps
83 Mouse 3 1 A Menu Move-Window
85 Mouse 2 2 A All ($c) Close
87 Mouse 1 4 A Maximize 100 100
88 Mouse 2 4 A Maximize 0 100
89 Mouse 3 4 A Maximize 100 0
91 Mouse 2 6 A All ($c) Iconify On
92 Mouse 3 6 A All ($c) WindowShade On
94 #------------------------------------------------------------------------------
95 # Now some keyboard shortcuts.
96 #------------------------------------------------------------------------------
98 #------------------------------------------------------------------------------
99 # press arrow + Shift anywhere, and scroll by 1 page
100 #------------------------------------------------------------------------------
102 #Key Left A S Scroll -100 0
103 #Key Right A S Scroll +100 +0
104 #Key Up A S Scroll +0 -100
105 #Key Down A S Scroll +0 +100
107 #------------------------------------------------------------------------------
108 # press arrow + Alt key, and scroll by 1/10 of a page
109 #------------------------------------------------------------------------------
111 #Key Left A M Scroll -10 +0
112 #Key Right A M Scroll +10 +0
113 #Key Up A M Scroll +0 -10
114 #Key Down A M Scroll +0 +10
116 #------------------------------------------------------------------------------
117 # press arrow + control-meta anywhere, and move the pointer by 1% of a page
118 #------------------------------------------------------------------------------
120 #Key Left A MC CursorMove -1 0
121 #Key Right A MC CursorMove +1 +0
122 #Key Up A MC CursorMove +0 -1
123 #Key Down A MC CursorMove +0 +1
125 #------------------------------------------------------------------------------
126 # press arrow + Shift-Alt key, and move the pointer by 1/10 of a page
127 #------------------------------------------------------------------------------
129 #Key Left A SM CursorMove -10 +0
130 #Key Right A SM CursorMove +10 +0
131 #Key Up A SM CursorMove +0 -10
132 #Key Down A SM CursorMove +0 +10
134 #------------------------------------------------------------------------------
135 # Page Up/Page Down keys are used to scroll by one desktop page
136 # in any context, press page up/down + control + alt
137 # in root context, just pressing page up/down is OK
138 #------------------------------------------------------------------------------
140 #Key Next A CM Desk -1 0 0 3
141 #Key Next R M Desk -1 0 0 3
142 #Key Prior A CM Desk +1 0 0 3
143 #Key Prior R M Desk +1 0 0 3
145 #------------------------------------------------------------------------------
146 # Alt-Shift-Fx window operations
147 #------------------------------------------------------------------------------
149 #Key F5 A MS RaiseLower
150 #Key F6 A MS All (Iconic) Raise # originally Restore
154 #Key F10 A MS Maximize 100 100
155 #Key F11 A MS FvwmIdent
156 #Key F12 A MS FvwmConsole
158 #------------------------------------------------------------------------------
159 # The menus via Alt-Shift-Fx
160 #------------------------------------------------------------------------------
161 #Key F1 A MS Menu Utilities mouse -1p -1p
162 #Key F2 A MS Menu Window mouse -1p -1p
163 #Key F3 A MS WindowList mouse -1p -1p
166 #------------------------------------------------------------------------------
167 # The famous Alt-tab binding
168 #------------------------------------------------------------------------------
170 DestroyFunc my_dbltab2
172 + I WindowListFunc $w
173 DestroyFunc my_dbltab_prev
174 AddToFunc my_dbltab_prev
177 #Key Tab A M WindowList Root c c NoGeometry, NoDeskSort, SelectOnRelease Alt_L my_dbltab_prev
178 #Key Tab A CM WindowList Root c c NoGeometry, OnlyListSkip, SelectOnRelease
181 #------------------------------------------------------------------------------
183 #------------------------------------------------------------------------------
185 # You need fvwm compiled with stroke support and libstroke installed
186 # See the Stroke and StrokeFunc entries in fvwm2 man page
187 # We use mostly simple stroke motion. For complex stroke motions we need
188 # to consider many sloppy stroke motions for each action.
191 Mouse 3 R N StrokeFunc FeedBack DrawMotion
192 Mouse 3 W M StrokeFunc FeedBack DrawMotion
194 #STROKE 2 We need to redefine the default bindings
195 Stroke 0 0 R N WindowList mouse -1p -1p
196 Stroke 0 0 W M WindowList mouse -1p -1p
199 #STROKE 2 A | from the top to the bottom
200 Stroke N852 0 R N Exec exec aterm
201 Stroke N852 0 W M Exec exec aterm
203 #STROKE 2 A | from the bottom to the top
204 Stroke N258 0 R N Exec exec gvim
205 Stroke N258 0 W M Exec exec gvim
207 #STROKE 2 A / from the bottom to the top
208 Stroke N159 0 R N Exec exec aterm -g 80x35 -e mc
209 Stroke N159 0 W M Exec exec aterm -g 80x35 -e mc
211 #STROKE 2 A C from the top
212 Stroke N9874123 0 R N Exec exec xcalc
213 Stroke N9874123 0 W M Exec exec xcalc
215 #STROKE 11 A N (from the bottom)
216 Stroke 7415963 0 R N Exec exec netscape
217 Stroke 74148963 0 R N Exec exec netscape
218 Stroke 74158963 0 R N Exec exec netscape
219 Stroke 7418963 0 R N Exec exec netscape
220 Stroke 415963 0 R N Exec exec netscape
222 Stroke 7415963 0 W M Exec exec netscape
223 Stroke 74148963 0 W M Exec exec netscape
224 Stroke 74158963 0 W M Exec exec netscape
225 Stroke 7418963 0 W M Exec exec netscape
226 Stroke 415963 0 W M Exec exec netscape
228 #STROKE 4 A clockwise box from the top left
229 Stroke N78963214 0 R N FvwmForm FvwmForm-QuitVerify
230 Stroke N789632147 0 R N FvwmForm FvwmForm-QuitVerify
231 Stroke N78963214 0 W M FvwmForm FvwmForm-QuitVerify
232 Stroke N789632147 0 W M FvwmForm FvwmForm-QuitVerify