Re: [Sikuli-driver] [Question #272075]: Using multiple hotkeys without popups? Is this possible?
Question #272075 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/272075 Sam posted a new comment: This works exactly how I'd like now. Thanks so much! -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #272075]: Using multiple hotkeys without popups? Is this possible?
Question #272075 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/272075 Status: Answered => Solved Sam confirmed that the question is solved: Thanks RaiMan, that solved my question. -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #272075]: Using multiple hotkeys without popups? Is this possible?
Question #272075 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/272075 Sam posted a new comment: Thanks so much RaiMan. Next time I have time to work on the script I'll give this a try and report back -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #272075]: Using multiple hotkeys without popups? Is this possible?
Question #272075 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/272075 Sam gave more information on the question: Actually, I stand corrected. I can only run the second script after I have pressed Okay to the first script. Is there anyway to be able to run both of them at any time? -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #272075]: Using multiple hotkeys without popups? Is this possible?
Question #272075 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/272075 Status: Open => Needs information RaiMan requested more information: how does your current script look like? What do you mean by hot-keys? -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #272075]: Using multiple hotkeys without popups? Is this possible?
Question #272075 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/272075 Sam gave more information on the question: scr2 = Screen(2) #scr2.click("1443724310615.png") data= [None]*33 # creating a list full of 0s def CopyPage(event): scr2.click("1444047041130.png") # data= [None]*34 # creating a list full of 0s # data[12]= "Unknown" # should reset clipboard like stated below - temp fix x = 0 for x in range(0, len(data),1): # App.setClipboard(data[x]) # sends data to keyboard # wasn't using e== before that's why swap wasn't working but != was type(Key.TAB) type("c", KeyModifier.CTRL) data[x] = Env.getClipboard() App.setClipboard("0") # should clear clipboard or set to known value here - this would avoid repeats in front of no copies like heating system ++x print data[x] print x scr2.click("1444055393604.png") type(Key.TAB) type(Key.TAB) type(Key.TAB) x=0 print data[0] for x in range(0, len(data),1): # App.setClipboard(data[x]) # sends data to keyboard # wasn't using e== before that's why swap wasn't working but != was if data[x] == "0" : type(Key.TAB) ++x else: paste(data[x]) type(Key.TAB) ++x print data[x] #Passive Hotkeys Env.addHotkey(Key.NUM1,KeyModifier.CTRL, CopyPage) popup("Press Ctrl+num1 instead of clicking a button") # need this popup to run in the background and the script can continue to run in the background def PasteCalendar(event): paste(data[17]) type(",") paste(data[11]) type(",") paste(data[23]) type(",") paste( data[24]) Env.addHotkey(Key.NUM2,KeyModifier.CTRL, PasteCalendar) popup("Press Ctrl+num2 instead of clicking a button") Thanks for the reply RaiMan. I can press all my hotkeys at once now. I thought there was something wrong with the popups and I'd rather not have them, but I suppose I do need some way to exit the script. Everything is working now, but I've posted my (very sloppy) code above. Thanks again for the reply -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #272075]: Using multiple hotkeys without popups? Is this possible?
Question #272075 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/272075 Status: Needs information => Open Sam gave more information on the question: Eh, I guess I can run them all at the same time. I messed up the first few times I suppose, but now it seems to be working. I don't really mind having a few popups in the background I suppose. -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #272075]: Using multiple hotkeys without popups? Is this possible?
Question #272075 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/272075 Status: Open => Answered RaiMan proposed the following answer: ok, I think, I understand your problem. If you want to run a script, that only implements hotkeys and does nothing else, then this is a possible generic structure: shouldRun = True def handler1(event): # do something if the corresponding hotkey is pressed def handler2(event): # do something if the corresponding hotkey is pressed ... more of them if needed def handlerStop(): global shouldRun shouldRun = False Env.addHotkey(Key.NUM1,KeyModifier.CTRL, handler1) Env.addHotkey(Key.NUM2,KeyModifier.CTRL, handler2) ... more of them if needed Env.addHotkey("x",KeyModifier.CTRL + KeyModifier.ALT, handlerStop) # press ctrl-alt-x to stop the script # if you want: popup("hotkeys are active now - click OK") while shouldRun: # keep the script alive until the stop key is pressed wait(1) # if you want: popup("hotkeys will be deactivated after clicking ok") activated hotkeys are auto-inactivated when the script ends. -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp