
(setq left 1)
(setq middle 2)
(setq right 3)

(setq grabs 
      (list
       (button any with-alt)
       (button any (together with-alt with-control))
       (button any (together with-alt with-lock))))

(setq standard-behavior
      (state-make))
       
(setq window-icon-behavior
      (state-make
	(on (buttonpress left with-alt)
	    (if (deltabutton) (uwm.new-iconify-window) (lower-window)))
	(on (buttonpress right with-alt)
	    (if (deltabutton) (move-window) (raise-window)))
	(on (buttonpress left (together with-alt with-control))
	    (uwm.iconify-window))
	(on (buttonpress left (together with-alt with-lock))
	    (uwm.new-iconify-window))
	(on (buttonpress middle (together with-alt with-control))
	    (pushdown))
	(on (buttonpress middle (together with-alt with-lock))
	    (pushup))
	(on (buttonpress right (together with-alt with-control))
	    (pushleft))
	(on (buttonpress right (together with-alt with-lock))
	    (pushright))
	))
       

(setq window-fsm
      (fsm-make
       (state-make
	(on (buttonpress middle with-alt)
	    (if (deltabutton) (resize-window) (nil)))
	window-icon-behavior
	)))

(setq icon-fsm
      (fsm-make
       (state-make
	(on (buttonrelease middle with-alt)
	    (uwm.iconify-window))
	window-icon-behavior
	)))

(setq root-fsm
      (fsm-make
       (state-make)))
