]> Dogcows Code - chaz/openbox/blob - scripts/clicks.py
handle mouse clicks in the python scripts now
[chaz/openbox] / scripts / clicks.py
1 def def_click_client(action, win, type, modifiers, button, time):
2 client = Openbox_findClient(openbox, win)
3 if not client: return
4
5 if button == Button1 and type == Type_CloseButton:
6 OBClient_close(client)
7 elif button <= Button3 and type == Type_MaximizeButton:
8 print "OBClient_maximize(client)"
9 elif button == Button1 and type == Type_IconifyButton:
10 print "OBClient_iconify(client)"
11 elif button == Button1 and type == Type_StickyButton:
12 print "OBClient_sendtodesktop(client, 0xffffffff)"
13 elif type == Type_Titlebar or type == Type_CloseButton or \
14 type == Type_MaximizeButton or type == Type_IconifyButton or \
15 type == Type_StickyButton or type == Type_Label:
16 if button == Button4:
17 print "OBClient_shade(client)"
18 elif button == Button5:
19 print "OBClient_unshade(client)"
20
21 def def_click_model(action, win, type, modifiers, button, time):
22 if button != Button1: return
23 client = Openbox_findClient(openbox, win)
24 if not client: return
25 print "OBClient_focus(client)"
26 print "OBClient_raise(client)"
27
28 def def_click_root(action, win, type, modifiers, button, time):
29 if type == Type_Root:
30 if button == Button1:
31 print "nothing probly.."
32 elif button == Button2:
33 print "workspace menu"
34 elif button == Button3:
35 print "root menu"
36 elif button == Button4:
37 print "next workspace"
38 elif button == Button5:
39 print "previous workspace"
40
41 def def_doubleclick_client(action, win, type, modifiers, button, time):
42 client = Openbox_findClient(openbox, win)
43 if not client: return
44
45 if button == Button1 and (type == Type_Titlebar or type == Type_Label):
46 print "OBClient_toggleshade(client)"
47
48
49 register(Action_Click, def_click_model)
50 register(Action_Click, def_click_client)
51 register(Action_Click, def_click_root)
52 register(Action_DoubleClick, def_doubleclick_client)
53
54 print "Loaded clicks.py"
This page took 0.040362 seconds and 5 git commands to generate.