diff options
| author | Dana Jansens <danakj@orodu.net> | 2003-03-21 18:42:39 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2003-03-21 18:42:39 +0000 |
| commit | a52a6d96d701c993896f276e4198003317632aaf (patch) | |
| tree | be2f51e6a433d1fdf9a7c8248b343cb3f6297212 /python/buttonmap.py | |
| parent | a36c7543d4eedaa9e10bfd9f4d9b81279b1bb7e6 (diff) | |
rm the old code including the .pys and the c++ shit
Diffstat (limited to 'python/buttonmap.py')
| -rw-r--r-- | python/buttonmap.py | 76 |
1 files changed, 0 insertions, 76 deletions
diff --git a/python/buttonmap.py b/python/buttonmap.py deleted file mode 100644 index 1a20281e..00000000 --- a/python/buttonmap.py +++ /dev/null @@ -1,76 +0,0 @@ -from input import Pointer - -def set(map): - """Set your buttonmap. Functions in the button map should all take a single - argument, a Client object, except for functions for Action_Motion events, - who should take 2 arguments, a PointerData object and a Client object.""" - global _press_map, _release_map, _click_map, _doubleclick_map, _motion_map - Pointer.clearBinds() - _press_map = [] - _release_map = [] - _click_map = [] - _doubleclick_map = [] - _motion_map = [] - for button, context, action, func in map: - if (action == Pointer.Action_Press): - _press_map.append((button, context, func)) - mapfunc = press_run - if (action == Pointer.Action_Release): - _release_map.append((button, context, func)) - mapfunc = release_run - if (action == Pointer.Action_Click): - _click_map.append((button, context, func)) - mapfunc = click_run - if (action == Pointer.Action_DoubleClick): - _doubleclick_map.append((button, context, func)) - mapfunc = doubleclick_run - if (action == Pointer.Action_Motion): - _motion_map.append((button, context, func)) - mapfunc = motion_run - Pointer.bind(button, context, action, mapfunc) - -def press_run(ptrdata, client): - """Run a button press event through the buttonmap""" - button = ptrdata.button - context = ptrdata.context - for but, cont, func in _press_map: - if (but == button and cont == context): - func(client) - -def release_run(ptrdata, client): - """Run a button release event through the buttonmap""" - button = ptrdata.button - context = ptrdata.context - for but, cont, func in _release_map: - if (but == button and cont == context): - func(client) - -def click_run(ptrdata, client): - """Run a button click event through the buttonmap""" - button = ptrdata.button - context = ptrdata.context - for but, cont, func in _click_map: - if (but == button and cont == context): - func(client) - -def doubleclick_run(ptrdata, client): - """Run a button doubleclick event through the buttonmap""" - button = ptrdata.button - context = ptrdata.context - for but, cont, func in _doubleclick_map: - if (but == button and cont == context): - func(client) - -def motion_run(ptrdata, client): - """Run a pointer motion event through the buttonmap""" - button = ptrdata.button - context = ptrdata.context - for but, cont, func in _motion_map: - if (but == button and cont == context): - func(ptrdata, client) - -_press_map = () -_release_map = () -_click_map = () -_doubleclick_map = () -_motion_map = () |
