
# ---------------------------------------------------------------------------
# 1. Title bar and border
# ---------------------------------------------------------------------------

# Mouse on the window buttons are defined in the window theme (via
# bindings-functions)

Mouse 1 T A AFuncWindowTitleBarMouse1
#Mouse 1 T M AFuncWindowTitleBarMouse1Mod1
#Mouse 1 T S AFuncWindowTitleBarMouse1Mod2
#Mouse 1 T C AFuncWindowTitleBarMouse1Mod3
Mouse 1 T 4 AFuncWindowTitleBarMouse1Mod4

Mouse 2 T A AFuncWindowTitleBarMouse2
Mouse 3 T A AFuncWindowTitleBarMouse3
Mouse 4 T A AFuncWindowTitleBarMouse4
Mouse 5 T A AFuncWindowTitleBarMouse5

# Borders
Mouse 1 [  A  AFuncWindowLeftBorderMouse1 West
Mouse 1 <  A  AFuncWindowTopLeftCornerMouse1 NorthWest
Mouse 1 -  A  AFuncWindowTopBorderMouse1 North
Mouse 1 ^  A  AFuncWindowTopRightCornerMouse1 NorthEast
Mouse 1 ]  A  AFuncWindowRightBorderMouse1 East
Mouse 1 >  A  AFuncWindowBottomRightCornerMouse1 SouthEast
Mouse 1 _  A  AFuncWindowBottomBorderMouse1 South
Mouse 1 v  A  AFuncWindowBottomLeftCornerMouse1 SouthWest

Mouse 2 [  A  AFuncWindowBordersMouse2 West
Mouse 2 <  A  AFuncWindowBordersMouse2 NorthWest
Mouse 2 -  A  AFuncWindowBordersMouse2 North
Mouse 2 ^  A  AFuncWindowBordersMouse2 NorthEast
Mouse 2 ]  A  AFuncWindowBordersMouse2 East
Mouse 2 >  A  AFuncWindowBordersMouse2 SouthEast
Mouse 2 _  A  AFuncWindowBordersMouse2 South
Mouse 2 v  A  AFuncWindowBordersMouse2 SouthWest

Mouse 3 [  A  AFuncWindowBordersMouse3 West
Mouse 3 <  A  AFuncWindowBordersMouse3 NorthWest
Mouse 3 -  A  AFuncWindowBordersMouse3 North
Mouse 3 ^  A  AFuncWindowBordersMouse3 NorthEast
Mouse 3 ]  A  AFuncWindowBordersMouse3 East
Mouse 3 >  A  AFuncWindowBordersMouse3 SouthEast
Mouse 3 _  A  AFuncWindowBordersMouse3 South
Mouse 3 v  A  AFuncWindowBordersMouse3 SouthWest

AFuncWindowBordersMouse1Mod1

AFuncWindowBordersMouse1Mod2

AFuncWindowBordersMouse1Mod4

AFuncWindowBordersLeftRightMouse1Mod3
AFuncWindowBordersLeftRightMouse1Mod3Mod4
AFuncWindowBordersTopBottomMouse1Mod3
AFuncWindowBordersTopBottomMouse1Mod3Mod4
AFuncWindowBordersCornersMouse1Mod3
AFuncWindowBordersCornersMouse1Mod3Mod4

Mouse 1 I A AFuncWindowIconMouse1
Mouse 2 I A AFuncWindowIconMouse2
Mouse 3 I A AFuncWindowIconMouse3

# ---------------------------------------------------------------------------
#  2. Mouse on the root window, a ewmh desktop and on a normal window
# ---------------------------------------------------------------------------

Mouse 1 R A AFuncRootMouse1
Mouse 2 R A AFuncRootMouse2
Mouse 3 R A AFuncRootMouse3
Mouse 4 R A AFuncRootMouse4
Mouse 5 R A AFuncRootMouse5

# EWMH desktop
AFuncDesktopMouse 1
AFuncDesktopMouse 2
AFuncDesktopMouse 3
AFuncDesktopMouse 4
AFuncDesktopMouse 5

# Window: For UI Facade
AFuncMouseMetisseCmd     1 W "AFuncSelectRegion"
AFuncMouseMetisseCmdMore 1 W "AFuncAddSelectRegion"

AFuncMouseWindowCmd 1 "AFuncWindowTitleBarMouse1"
AFuncMouseWindowCmdMore 1 "AFuncResizeOrShade"

AFuncMouseWindowCmd 2 "AFuncWindowMouseRoot 2"
AFuncMouseWindowCmd 3 "AFuncWindowMouseRoot 3"
AFuncMouseWindowCmd 4 "AFuncWindowMouseRoot 4"
AFuncMouseWindowCmd 5 "AFuncWindowMouseRoot 5"

AFuncMouseMetisseCmd 5 R "sma PagerMode On"
AFuncMouseMetisseCmd 4 R "sma PagerMode Off"
AFuncMouseMetisseCmd 5 D "sma PagerMode On"
AFuncMouseMetisseCmd 4 D "sma PagerMode Off"
AFuncMouseMetisseCmd 5 W "sma PagerMode On"
AFuncMouseMetisseCmd 4 W "sma PagerMode Off"

AFuncMouseMetisseCmdMore  5 W "sma Scale 0.9"
AFuncMouseMetisseCmdMore  4 W "sma Scale 1.11111111111"

# FIXME
Silent Mouse 8 A A SendToModule FvwmCompositor PagerMode

# Window Specific (ok)
Mouse (FvwmPager) 4 W A sma PagerMode Off
Mouse (FvwmPager) 5 W A sma PagerMode On

AFuncMouseMetisseCmd  3 W  "sma ActionOnWidget"

# ---------------------------------------------------------------------------
#  3. key bindings
# ---------------------------------------------------------------------------

FuncKeyCompositorWinCmd F1 A AFuncReset

FuncKeyCompositorWinCmd s "sma Scale 0.9"
FuncKeyCompositorWinCmd z "sma Scale 1.1111111"
#
FuncKeyCompositorWinCmd F2 "sma Rotate -1 0 0 1"
FuncKeyCompositorWinCmd F3 "sma Rotate 1 0 0 1"
#
FuncKeyCompositorWinCmd F4 "sma Rotate -1 0 1 0"
FuncKeyCompositorWinCmd F5 "sma Rotate 1 0 1 0"
#
FuncKeyCompositorWinCmd F6 "sma Rotate -1 1 0 0"
FuncKeyCompositorWinCmd F7 "sma Rotate 1 1 0 0"
#
# backward compatibilty :o)
AFuncPointerKeyCompositorCmd F8 A  "sma RootScale 0.9"
AFuncPointerKeyCompositorCmd F9 A  "sma RootScale 1.1111111"

# For what??
#AFuncPointerKeyCompositorCmd F10 A 	"sma RootRotate -1 1 0 0"
#AFuncPointerKeyCompositorCmd F11 A  	"sma RootRotate 1 1 0 0"
#
FuncKeyCompositorWinCmd F10 "sma LessTransparency"
FuncKeyCompositorWinCmd F11 "sma MoreTransparency
FuncKeyCompositorWinCmd t   "sma SetOrRemoveTransparency 0.5"

AFuncPointerKeyCompositorCmd F12   A  "sma RootReset"
AFuncPointerKeyCompositorCmd Next  A "sma RootScale 0.9"
AFuncPointerKeyCompositorCmd Prior A  "sma RootScale 1.1111111"

FuncKeyCompositorWinCmd v "sma CreateFacade"
FuncKeyCompositorWinCmd b "sma CreateAllFacade"
FuncKeyCompositorWinCmd n "sma CutWindow"
FuncKeyCompositorWinCmd m "sma UnCutWindow"
FuncKeyCompositorWinCmd l "sma rmFacade"

AFuncPointerKeyCompositorCmd Down	A  "sma RootTranslate 0 10 0" 
AFuncPointerKeyCompositorCmd Up		A  "sma RootTranslate 0 -10 0"
AFuncPointerKeyCompositorCmd Left	A  "sma RootTranslate 10 0 0"
AFuncPointerKeyCompositorCmd Right	A  "sma RootTranslate -10 0 0"

#
#AFuncPointerKeyCompositorCmd F12 A  "sma GlobalTransparency"

FuncKeyCompositorWinCmd c "sma CropToCircule" 

FuncKeyCompositorWinCmd a "sma Animate"
#AFuncPointerKeyCompositorCmd a A  "All AFuncReset"

FuncKeyCompositorWinCmd w "sma Shadow"
FuncKeyCompositorWinCmd i "AFuncCompositorIconify"

FuncKeyCompositorWinCmd o "AFuncDragRotateWindow DragRotateXY RotateXY"

# Broken ...
#AFuncPointerKeyCompositorCmd e A  "sma ExposeMode"

AFuncPointerKeyCompositorCmd r A "All (CurrentPage CirculateHit !Sticky !Iconified) AFuncReset"

# a kind of vertical tilling
AFuncPointerKeyCompositorCmd v A "All (!Sticky CurrentPage CirculateHit !Iconified) AFuncScaleMaximize 0 150 0.6666667"
AFuncPointerKeyCompositorCmd h A "All (!Sticky CurrentPage CirculateHit !Iconified) AFuncScaleMaximize 0 150 0.6666667"

AFuncPointerKeyCompositorCmd   f  A "sma SaveFrame"
AFuncPointerKeyCompositorCmd   d  A "sma PagerMode"

FuncKeyCompositorWinCmd x  AFuncScaleFullScreen

# Normal window operation
FuncKeyWindowWinCmd F4 "Close"
FuncKeyWindowWinCmd F5 "RaiseLower"
FuncKeyWindowWinCmd F6 "AFuncRestore"
FuncKeyWindowWinCmd F7 "AFuncMove"
FuncKeyWindowWinCmd F8 "Resize"
FuncKeyWindowWinCmd F9 "Iconify"
FuncKeyWindowWinCmd F10 "Maximize 100 0"
FuncKeyWindowWinCmd F11 "Maximize 0 100"

AFuncPointerKeyWindowCmd F12 A  "AFuncStartOrActivate FvwmConsole FuncFvwmConsole"

# Normal global operations
# FIXME: Meta F1 and F2 are used by KDE and GNOME ...
Test (!EnvIsSet SESSION_MANAGER) AFuncPointerKeyWindowCmd F1  A  "Menu AMenuRoot"
# FIXME: run a "run application apps"
#Test (!EnvIsSet SESSION_MANAGER) 
AFuncPointerKeyWindowCmd F3  A  "Menu AMenuWinOps"

AFuncPointerKeyWindowCmd Tab A  "FuncWindowListKey"

# does not work well
#PointerKey r  A 4M sma StartVideoCapture buffered:file:$[HOME]/metisse.vss?maxt=10000&blast
#PointerKey t  A 4M sma StopVideoCapture

AFuncPointerKeyGlobalCmd Next A  "GotoDesk 1 0 $[FVWM_LAST_DESK]"
AFuncPointerKeyGlobalCmd Prior A "GotoDesk -1 0 $[FVWM_LAST_DESK]"

AFuncPointerKeyGlobalCmd  Left	A	"AFuncGotoPage -1p +0p"
AFuncPointerKeyGlobalCmd  Right	A	"AFuncGotoPage +1p +0p"
AFuncPointerKeyGlobalCmd  Up  	A	"AFuncGotoPage +0p -1p"
AFuncPointerKeyGlobalCmd  Down	A	"AFuncGotoPage +0p +1p"

AFuncPointerKeyGlobalCmd  z	A	"AFuncGotoPage Prev"

AFuncPointerKeyGlobalCmd  Tab 	A "WindowList Root c c OnlyListSkip, NoDeskSort, SelectOnRelease"

Key P W MS Pick PlaceAgain anim
Key A A MS All (CurrentPage !Sticky) PlaceAgain anim

Key Left  WSTF123456789 CSM FuncMoveToPage -1p  0p
Key Right WSTF123456789 CSM FuncMoveToPage  1p  0p
Key Up    WSTF123456789 CSM FuncMoveToPage  0p -1p
Key Down  WSTF123456789 CSM FuncMoveToPage  0p  1p

AFuncPointerKeyGlobalCmd d A M ShowDesktop

# Should be fixed in Xmetisse?

key XF86Mail	A 	A 	AFuncStartOrActivateMailer
key XF86WWW	A 	A 	AFuncStartOrActivateWebBrowser
