@@ -942,6 +942,45 @@ def __get_configured_pyautogui(self, pyautogui_copy):
942
942
)
943
943
return pyautogui_copy
944
944
945
+ def gui_press_key (self , key ):
946
+ self .__install_pyautogui_if_missing ()
947
+ import pyautogui
948
+ pyautogui = self .__get_configured_pyautogui (pyautogui )
949
+ gui_lock = fasteners .InterProcessLock (
950
+ constants .MultiBrowser .PYAUTOGUILOCK
951
+ )
952
+ with gui_lock :
953
+ pyautogui .press (key )
954
+ time .sleep (0.0375 )
955
+ self .__slow_mode_pause_if_set ()
956
+ self .loop .run_until_complete (self .page .wait ())
957
+
958
+ def gui_press_keys (self , keys ):
959
+ self .__install_pyautogui_if_missing ()
960
+ import pyautogui
961
+ pyautogui = self .__get_configured_pyautogui (pyautogui )
962
+ gui_lock = fasteners .InterProcessLock (
963
+ constants .MultiBrowser .PYAUTOGUILOCK
964
+ )
965
+ with gui_lock :
966
+ for key in keys :
967
+ pyautogui .press (key )
968
+ time .sleep (0.0375 )
969
+ self .__slow_mode_pause_if_set ()
970
+ self .loop .run_until_complete (self .page .wait ())
971
+
972
+ def gui_write (self , text ):
973
+ self .__install_pyautogui_if_missing ()
974
+ import pyautogui
975
+ pyautogui = self .__get_configured_pyautogui (pyautogui )
976
+ gui_lock = fasteners .InterProcessLock (
977
+ constants .MultiBrowser .PYAUTOGUILOCK
978
+ )
979
+ with gui_lock :
980
+ pyautogui .write (text )
981
+ self .__slow_mode_pause_if_set ()
982
+ self .loop .run_until_complete (self .page .wait ())
983
+
945
984
def __gui_click_x_y (self , x , y , timeframe = 0.25 , uc_lock = False ):
946
985
self .__install_pyautogui_if_missing ()
947
986
import pyautogui
0 commit comments