Added most of the functions

testing to do, now I must update the handler
This commit is contained in:
Maximilien Rigaut 2021-10-01 15:27:46 +02:00
parent 8330d98eff
commit eb0108e5c7
2 changed files with 7 additions and 6 deletions

View File

@ -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

View File

@ -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)
#################################################