@@ -37,7 +37,7 @@ def __init__(self):
3737 super ().__init__ ()
3838 self .state = State ()
3939 self .maestro = BotMaestroSDK () if MAESTRO_AVAILABLE else None
40-
40+ self . _interval = 0.005 if platform . system () == "Darwin" else 0.0
4141 # For parity with Java
4242 self .addImage = self .add_image
4343 self .getImageFromMap = self .get_image_from_map
@@ -74,6 +74,7 @@ def __init__(self):
7474 self .rightClickAt = self .right_click_at
7575 self .rightClickRelative = self .right_click_relative
7676 self .moveAndRightClick = self .right_click
77+ pyperclip .determine_clipboard ()
7778
7879 ##########
7980 # Display
@@ -830,10 +831,7 @@ def paste(self, text=None, wait=0):
830831 """
831832 if text :
832833 pyperclip .copy (text )
833- self .sleep (500 )
834834 self .control_v ()
835- delay = max (0 , wait or config .DEFAULT_SLEEP_AFTER_ACTION )
836- self .sleep (delay )
837835
838836 def copy_to_clipboard (self , text , wait = 0 ):
839837 """
@@ -992,7 +990,7 @@ def alt_space(self, wait=0):
992990 wait (int, optional): Wait interval (ms) after task
993991
994992 """
995- pyautogui .hotkey ('alt' , 'space' , interval = 0.25 )
993+ pyautogui .hotkey ('alt' , 'space' , interval = self . _interval )
996994 delay = max (0 , wait or config .DEFAULT_SLEEP_AFTER_ACTION )
997995 self .sleep (delay )
998996
@@ -1031,7 +1029,7 @@ def alt_e(self, wait=0):
10311029 wait (int, optional): Wait interval (ms) after task
10321030
10331031 """
1034- pyautogui .hotkey ('alt' , 'e' , interval = 0.25 )
1032+ pyautogui .hotkey ('alt' , 'e' , interval = self . _interval )
10351033 delay = max (0 , wait or config .DEFAULT_SLEEP_AFTER_ACTION )
10361034 self .sleep (delay )
10371035
@@ -1043,7 +1041,7 @@ def alt_r(self, wait=0):
10431041 wait (int, optional): Wait interval (ms) after task
10441042
10451043 """
1046- pyautogui .hotkey ('alt' , 'r' , interval = 0.25 )
1044+ pyautogui .hotkey ('alt' , 'r' , interval = self . _interval )
10471045 delay = max (0 , wait or config .DEFAULT_SLEEP_AFTER_ACTION )
10481046 self .sleep (delay )
10491047
@@ -1055,7 +1053,7 @@ def alt_f(self, wait=0):
10551053 wait (int, optional): Wait interval (ms) after task
10561054
10571055 """
1058- pyautogui .hotkey ('alt' , 'f' , interval = 0.25 )
1056+ pyautogui .hotkey ('alt' , 'f' , interval = self . _interval )
10591057 delay = max (0 , wait or config .DEFAULT_SLEEP_AFTER_ACTION )
10601058 self .sleep (delay )
10611059
@@ -1067,7 +1065,7 @@ def alt_u(self, wait=0):
10671065 wait (int, optional): Wait interval (ms) after task
10681066
10691067 """
1070- pyautogui .hotkey ('alt' , 'u' , interval = 0.25 )
1068+ pyautogui .hotkey ('alt' , 'u' , interval = self . _interval )
10711069 delay = max (0 , wait or config .DEFAULT_SLEEP_AFTER_ACTION )
10721070 self .sleep (delay )
10731071
@@ -1079,7 +1077,7 @@ def alt_f4(self, wait=0):
10791077 wait (int, optional): Wait interval (ms) after task
10801078
10811079 """
1082- pyautogui .hotkey ('alt' , 'f4' , interval = 0.25 )
1080+ pyautogui .hotkey ('alt' , 'f4' , interval = self . _interval )
10831081 delay = max (0 , wait or config .DEFAULT_SLEEP_AFTER_ACTION )
10841082 self .sleep (delay )
10851083
@@ -1094,7 +1092,7 @@ def control_c(self, wait=0):
10941092 key = 'ctrl'
10951093 if platform .system () == 'Darwin' :
10961094 key = 'command'
1097- pyautogui .hotkey (key , 'c' , interval = 0.25 )
1095+ pyautogui .hotkey (key , 'c' , interval = self . _interval )
10981096 delay = max (0 , wait or config .DEFAULT_SLEEP_AFTER_ACTION )
10991097 self .sleep (delay )
11001098 return self .get_clipboard ()
@@ -1110,7 +1108,7 @@ def control_v(self, wait=0):
11101108 key = 'ctrl'
11111109 if platform .system () == 'Darwin' :
11121110 key = 'command'
1113- pyautogui .hotkey (key , 'v' , interval = 0.25 )
1111+ pyautogui .hotkey (key , 'v' , interval = self . _interval )
11141112 delay = max (0 , wait or config .DEFAULT_SLEEP_AFTER_ACTION )
11151113 self .sleep (delay )
11161114
@@ -1125,7 +1123,7 @@ def control_a(self, wait=0):
11251123 key = 'ctrl'
11261124 if platform .system () == 'Darwin' :
11271125 key = 'command'
1128- pyautogui .hotkey (key , 'a' , interval = 0.25 )
1126+ pyautogui .hotkey (key , 'a' , interval = self . _interval )
11291127 delay = max (0 , wait or config .DEFAULT_SLEEP_AFTER_ACTION )
11301128 self .sleep (delay )
11311129
@@ -1140,7 +1138,7 @@ def control_f(self, wait=0):
11401138 key = 'ctrl'
11411139 if platform .system () == 'Darwin' :
11421140 key = 'command'
1143- pyautogui .hotkey (key , 'f' , interval = 0.25 )
1141+ pyautogui .hotkey (key , 'f' , interval = self . _interval )
11441142 delay = max (0 , wait or config .DEFAULT_SLEEP_AFTER_ACTION )
11451143 self .sleep (delay )
11461144
@@ -1155,7 +1153,7 @@ def control_p(self, wait=0):
11551153 key = 'ctrl'
11561154 if platform .system () == 'Darwin' :
11571155 key = 'command'
1158- pyautogui .hotkey (key , 'p' , interval = 0.25 )
1156+ pyautogui .hotkey (key , 'p' , interval = self . _interval )
11591157 delay = max (0 , wait or config .DEFAULT_SLEEP_AFTER_ACTION )
11601158 self .sleep (delay )
11611159
@@ -1170,7 +1168,7 @@ def control_u(self, wait=0):
11701168 key = 'ctrl'
11711169 if platform .system () == 'Darwin' :
11721170 key = 'command'
1173- pyautogui .hotkey (key , 'u' , interval = 0.25 )
1171+ pyautogui .hotkey (key , 'u' , interval = self . _interval )
11741172 delay = max (0 , wait or config .DEFAULT_SLEEP_AFTER_ACTION )
11751173 self .sleep (delay )
11761174
@@ -1185,7 +1183,7 @@ def control_r(self, wait=0):
11851183 key = 'ctrl'
11861184 if platform .system () == 'Darwin' :
11871185 key = 'command'
1188- pyautogui .hotkey (key , 'r' , interval = 0.25 )
1186+ pyautogui .hotkey (key , 'r' , interval = self . _interval )
11891187 delay = max (0 , wait or config .DEFAULT_SLEEP_AFTER_ACTION )
11901188 self .sleep (delay )
11911189
@@ -1200,7 +1198,7 @@ def control_t(self, wait=0):
12001198 key = 'ctrl'
12011199 if platform .system () == 'Darwin' :
12021200 key = 'command'
1203- pyautogui .hotkey (key , 't' , interval = 0.25 )
1201+ pyautogui .hotkey (key , 't' , interval = self . _interval )
12041202 delay = max (0 , wait or config .DEFAULT_SLEEP_AFTER_ACTION )
12051203 self .sleep (delay )
12061204
@@ -1215,7 +1213,7 @@ def control_end(self, wait=0):
12151213 key = 'ctrl'
12161214 if platform .system () == 'Darwin' :
12171215 key = 'command'
1218- pyautogui .hotkey (key , 'end' , interval = 0.25 )
1216+ pyautogui .hotkey (key , 'end' , interval = self . _interval )
12191217 delay = max (0 , wait or config .DEFAULT_SLEEP_AFTER_ACTION )
12201218 self .sleep (delay )
12211219
@@ -1230,7 +1228,7 @@ def control_home(self, wait=0):
12301228 key = 'ctrl'
12311229 if platform .system () == 'Darwin' :
12321230 key = 'command'
1233- pyautogui .hotkey (key , 'home' , interval = 0.25 )
1231+ pyautogui .hotkey (key , 'home' , interval = self . _interval )
12341232 delay = max (0 , wait or config .DEFAULT_SLEEP_AFTER_ACTION )
12351233 self .sleep (delay )
12361234
@@ -1245,7 +1243,7 @@ def control_w(self, wait=0):
12451243 key = 'ctrl'
12461244 if platform .system () == 'Darwin' :
12471245 key = 'command'
1248- pyautogui .hotkey (key , 'w' , interval = 0.25 )
1246+ pyautogui .hotkey (key , 'w' , interval = self . _interval )
12491247 delay = max (0 , wait or config .DEFAULT_SLEEP_AFTER_ACTION )
12501248 self .sleep (delay )
12511249
@@ -1260,7 +1258,7 @@ def control_shift_p(self, wait=0):
12601258 key = 'ctrl'
12611259 if platform .system () == 'Darwin' :
12621260 key = 'command'
1263- pyautogui .hotkey (key , 'shift' , 'p' , interval = 0.25 )
1261+ pyautogui .hotkey (key , 'shift' , 'p' , interval = self . _interval )
12641262 delay = max (0 , wait or config .DEFAULT_SLEEP_AFTER_ACTION )
12651263 self .sleep (delay )
12661264
@@ -1275,7 +1273,7 @@ def control_shift_j(self, wait=0):
12751273 key = 'ctrl'
12761274 if platform .system () == 'Darwin' :
12771275 key = 'command'
1278- pyautogui .hotkey (key , 'shift' , 'j' , interval = 0.25 )
1276+ pyautogui .hotkey (key , 'shift' , 'j' , interval = self . _interval )
12791277 delay = max (0 , wait or config .DEFAULT_SLEEP_AFTER_ACTION )
12801278 self .sleep (delay )
12811279
@@ -1287,7 +1285,7 @@ def shift_tab(self, wait=0):
12871285 wait (int, optional): Wait interval (ms) after task
12881286
12891287 """
1290- pyautogui .hotkey ('shift' , 'tab' , interval = 0.25 )
1288+ pyautogui .hotkey ('shift' , 'tab' , interval = self . _interval )
12911289 delay = max (0 , wait or config .DEFAULT_SLEEP_AFTER_ACTION )
12921290 self .sleep (delay )
12931291
0 commit comments