From 3eab5b9626d16cdc5cf8366098f0343e1a0020e2 Mon Sep 17 00:00:00 2001 From: Kevin Matz Date: Mon, 22 Oct 2018 17:18:46 -0400 Subject: [PATCH] button state constants --- OscMacroDefinitions.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/OscMacroDefinitions.py b/OscMacroDefinitions.py index c3e24e9..3c3ebe1 100644 --- a/OscMacroDefinitions.py +++ b/OscMacroDefinitions.py @@ -22,15 +22,19 @@ from time import sleep logger = logging.getLogger("CommentMacro") +# button state constants +buttonDOWN = 1 +buttonUP = 0 + class HogDevice(): def __init__(self, servers): self.servers = servers def button_press(self, device, path, delay=0.05): - self.send_message(device, path, 1) # button down + self.send_message(device, path, buttonDOWN) # button down sleep(delay) - self.send_message(device, path, 0) # button up + self.send_message(device, path, buttonUP) # button up # utility function to send simple messages with one argument def send_message(self, device, path, arg):