From eb0108e5c7833236f5a6f43a013a4050d78d58c1 Mon Sep 17 00:00:00 2001 From: Maximilien Rigaut Date: Fri, 1 Oct 2021 15:27:46 +0200 Subject: [PATCH] Added most of the functions testing to do, now I must update the handler --- README.md | 3 ++- mapping/keystrokes.py | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index f9bad4a..0f70c2f 100644 --- a/README.md +++ b/README.md @@ -41,5 +41,6 @@ To do so add a custom patch (or use a currently defined one, but chances are pat * Add asynchroneous mode ? * URGENT : Crash when assigning to an existing trigger * TODO: Make a @armtake decorator -* TODO: Async and Disconection protect for VPs +* TODO: Async and Disconnection protect for VPs * TODO: Disconnect: 'NoneType' object has no attribute 'groups' : Should handle disconnct & Crashes +* TODO: Color and uncolor VP as it connects diff --git a/mapping/keystrokes.py b/mapping/keystrokes.py index 209f52e..1b4b206 100644 --- a/mapping/keystrokes.py +++ b/mapping/keystrokes.py @@ -260,14 +260,14 @@ def _onload(self): ### def pressKeys(*keys): + "Press a key sequence" def _action(trigger,i,j,val,*params): pyautogui.hotkey(*keys) - return _action def controllpress(trigger,val,note,*params): + "A key was pressed on the control area" i=note-_BASE_NOTE_CTRL - if i==0: # pyautogui.hotkey("ctrl","fn","S") return @@ -276,16 +276,16 @@ def controllpress(trigger,val,note,*params): # _ACTIONS[vars.page][i+8*j](trigger,i,j,val,*params) # # dprint("[Info] : Action received ({}:{}) - Note {:2} ({:3})".format(i,j,note,val)) # except TypeError as e: - dprint("[Error] : Unassigned action ({}) - Note {:2} ({:3})".format(i,note,val)) + dprint("[Error] : Unassigned control ({}) - Note {:2} ({:3})".format(i,note,val)) def pagepress(trigger,val,note,*params): - "Analise a press on the pagebuttons" + "A key was pressed on the pagebuttons area" i,j=noteToPos(note) try: _ACTIONS[vars.page][i+8*j](trigger,i,j,val,*params) # dprint("[Info] : Action received ({}:{}) - Note {:2} ({:3})".format(i,j,note,val)) except TypeError as e: - dprint("[Error] : Unassigned action ({}:{}) - Note {:2} ({:3})".format(i,j,note,val)) + dprint("[Error] : Unassigned pagebutton ({}:{}) - Note {:2} ({:3})".format(i,j,note,val)) dprint(e) #################################################