Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ynsta/steamcontroller.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBuildTools <unconfigured@null.spigotmc.org>2015-12-09 00:56:57 +0300
committerBuildTools <unconfigured@null.spigotmc.org>2015-12-09 00:56:57 +0300
commitcfc44afa07eccc52d769ec2d51ff10dbed8211c7 (patch)
tree9b28d428ca2502425449f9534e0bc2859a77c657 /scripts
parentd2afb558c478d1f4d7ba6176dd1d997419037a5f (diff)
added callback mode for pad touch events
Diffstat (limited to 'scripts')
-rw-r--r--scripts/sc-callbacks.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/sc-callbacks.py b/scripts/sc-callbacks.py
index 4d234e8..7482faa 100644
--- a/scripts/sc-callbacks.py
+++ b/scripts/sc-callbacks.py
@@ -37,8 +37,11 @@ def button_pressed_callback(evm, btn, pressed):
print "pressing the STEAM button terminates the programm"
sys.exit()
-def touchpad_click_callback(evm, pos, pressed):
- print "Tochpad {} was {}".format(pos, 'pressed' if pressed else 'released')
+def touchpad_click_callback(evm, pad, pressed):
+ print "Tochpad {} was {}".format(pad, 'pressed' if pressed else 'released')
+
+def touchpad_touch_callback(evm, pad, x, y):
+ print "Tochpad {} was touched @{},{}".format(pad, x, y)
def evminit():
evm = EventMapper()
@@ -55,8 +58,8 @@ def evminit():
evm.setButtonCallback(SCButtons.RGRIP, button_pressed_callback)
evm.setButtonCallback(SCButtons.START, button_pressed_callback)
evm.setButtonCallback(SCButtons.BACK, button_pressed_callback)
- evm.setPadButtonCallback(Pos.LEFT, touchpad_click_callback)
- evm.setPadButtonCallback(Pos.RIGHT, touchpad_click_callback)
+ evm.setPadButtonCallback(Pos.LEFT, touchpad_touch_callback)
+ evm.setPadButtonCallback(Pos.RIGHT, touchpad_click_callback, clicked=True)
return evm