dc740 / AutoHotPy

AutoHotKey replacement using Incerception driver
GNU Lesser General Public License v3.0
59 stars 23 forks source link

Activate Macro Without Key 2 #8

Closed lekary closed 5 years ago

lekary commented 5 years ago

https://github.com/dc740/AutoHotPy/issues/6

Hello, I studied multiprocessing, but I could not find complex examples to study this topic well. Now I have an idea of how you run the macro in AutoHotPy.py, and after reading the code from AutoHotPy.py, I discovered how you can run the macro using this method.

I found this function here.

def fireLastRecordedMacro(self):
      self.recording_macro = False
      self.macro_queue.put(Task(self,self.runMacro,self.last_macro))

I realized that it runs a macro, which is written to last_macro (my guess). After that, I tried to understand what is written in last_macro after recording the macro through the macroStartStop () function using

print (self.last_macro)

But, alas, it gives me information about InterceptionWrapper.InterceptionMouseStroke and its object, because last_macro is specified in def __init __ (self).

Sample message from print (self.last_macro):

[(1558182004.8547325, <InterceptionWrapper.InterceptionMouseStroke object at 0x00000129F8942E48>), 
(1558182004.8608642, <InterceptionWrapper.InterceptionMouseStroke object at 0x00000129F8942EC8>), 
(1558182004.8618531, <InterceptionWrapper.InterceptionMouseStroke object at 0x00000129F8942DC8>), 
(1558182004.8669028, <InterceptionWrapper.InterceptionMouseStroke object at 0x00000129F8B95248>)]

I tried to translate last_macro to __str__, __repr__, __dict__(failed)

You may have some recommendations.

lekary commented 5 years ago

I found an example of calling such functions, did everything with an example, now everything works. Thank you topic is closed

zkghost commented 4 years ago

@lekary can you share your example? I am trying to figure out how to do the same thing