
    iQ                     D   S SK r S SKr S SKrS SKJrJrJr  S SKr\R                  S:w  a  \" S5      e \ R                  R                  R                  5          SrSrSr\\-   rSrS	r\\-   rS
rSr\\-   rSrSrSrS rSrS rSr " S S\ R<                  5      r " S S\ R<                  5      r  " S S\ R<                  5      r! " S S\ R<                  5      r" \#" \RH                   V s/ s H  o S4PM     sn 5      r%\%RM                  0 SS_SS_SS_SS_SS_SS_S S!_S"S!_S#S!_S$S	_S%S&_S'S(_S)S*_S+S,_S-S._S/S._S0S._0 S1S2_S3S4_S5S6_S7S6_S8S9_S:S9_S;S<_S=S>_S?S@_SASB_SCS
_SDS
_SESF_SGSH_SISF_SJSH_SKSL_E0 SMSN_SOSP_SQSR_SSST_SUSV_SWSX_SYSZ_S[S\_S]S^_S_S^_S`S^_SaS^_SbSc_SdSe_SfSe_SgSh_SiS_E0 SjS_SkSl_SmSn_SoSp_SqSr_SsSt_SuSv_SwSx_SySz_S{S|_S}S~_SS_SS_SS_SS_SS_SS_E0 SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_E0 SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_E0 SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_ESSS.E5        \'" S
S5       HP  r(\ R                  R                  RS                  \ RT                  RW                  \," \(5      5      5      \%\," \(5      '   MR     S r-S r.S r/S r0S r1S r2S r3S r4S r5GSS jr6GSS jr7S r8GS  r9g! \ a     GNf = fs  sn f (      N)LEFTMIDDLERIGHTwin32zCThe pyautogui_win module should only be loaded on a Windows system.                   @   i   i   i   c            	       L   \ rS rSrS\R
                  R                  4S\R
                  R                  4S\R
                  R                  4S\R
                  R                  4S\R
                  R                  4S\R                  " \R
                  R                  5      4/r
Srg	)

MOUSEINPUT>   dxdy	mouseDatadwFlagstimedwExtraInfo N)__name__
__module____qualname____firstlineno__ctypeswintypesLONGDWORDPOINTERULONG_fields___static_attributes__r       EC:\des-py\RoboSAPF\venv\Lib\site-packages\pyautogui/_pyautogui_win.pyr   r   >   s~    	v##$	v##$	foo++,	FOO))*	&&'	v'<'<=>Hr$   r   c                      \ rS rSrS\R
                  R                  4S\R
                  R                  4S\R
                  R                  4S\R
                  R                  4S\R                  " \R
                  R                  5      4/r
Srg)	
KEYBDINPUTH   wVkwScanr   r   r   r   N)r   r   r   r   r   r   WORDr   r    r!   r"   r#   r   r$   r%   r'   r'   H   sl    	$$%	&//&&'	FOO))*	&&'	v'<'<=>Hr$   r'   c                       \ rS rSrS\R
                  R                  4S\R
                  R                  4S\R
                  R                  4/rSr	g)HARDWAREINPUTQ   uMsgwParamLwParamHr   N)
r   r   r   r   r   r   r   r+   r"   r#   r   r$   r%   r-   r-   Q   s?    	&&'	FOO(()	FOO))*Hr$   r-   c                   z    \ rS rSr " S S\R
                  5      rSrS\R                  R                  4S\4/r
Srg)	INPUTX   c                   *    \ rS rSrS\4S\4S\4/rSrg)INPUT._IY   mikihir   N)	r   r   r   r   r   r'   r-   r"   r#   r   r$   r%   _Ir6   Y   s!    ::=!
r$   r;   )ityper<   r   N)r   r   r   r   r   Unionr;   _anonymous_r   r   r"   r#   r   r$   r%   r3   r3   X   s9    
V\\ 
 K	&&'	b	Hr$   r3   	backspacesuper[   tab	   	clear   enter   
returnshiftctrl   alt   pause   capslock   kana   hanguelhanguljunja   final   hanja   kanjiesc   escapeconvert   
nonconvert   accept   
modechange    spacepgup!   pgdn"   pageuppagedownend#   home$   left%   up&   right'   down(   select)   print*   execute+   prtsc,   prtscrprntscrnprintscreeninsert-   del.   deletehelp/   winwinleftwinright\   apps]   sleep_   num0`   num1a   num2b   num3c   num4d   num5e   num6f   num7g   num8h   num9i   multiplyj   addk   	separatorl   subtractm   decimaln   divideo   f1p   f2q   f3r   f4s   f5t   f6u   f7v   f8w   f9x   f10y   f11z   f12{   f13|   f14}   f15~   f16   f17   f18   f19   f20   f21   f22   f23   f24   numlock   
scrolllock   	shiftleft   
shiftright   ctrlleft   	ctrlright   altleft   altright   browserback   browserforward   browserrefresh   browserstop   browsersearch   browserfavorites   browserhome   
volumemute   
volumedown   volumeup   	nexttrack   	prevtrack   stop   	playpause   
launchmail   launchmediaselect         )
launchapp1
launchapp2c                 b   U [         ;  d
  [         U    c  g[        R                  " U 5      n [        [         U    S5      u  p#US-  S4US-  S4US-  =(       d    US44 H>  u  pEU(       d  M  [        R
                  R                  R                  US	[        S	5        M@     [        R
                  R                  R                  US	[        S	5        US-  =(       d    US4US-  S4US-  S44 H>  u  pEU(       d  M  [        R
                  R                  R                  US	[        S	5        M@     g)
aY  Performs a keyboard key press without the release. This will put that
key in a held down state.

NOTE: For some reason, this does not seem to cause key repeats like would
happen if a keyboard key was held down on a text field.

Args:
  key (str): The key to be pressed down. The valid names are listed in
  pyautogui.KEY_NAMES.

Returns:
  None
N   r	   rQ   r   rO   r   r   r   )
keyboardMapping	pyautoguiisShiftCharacterdivmodr   windlluser32keybd_eventKEYEVENTF_KEYDOWNKEYEVENTF_KEYUPkey
needsShiftmodsvkCode	apply_modvk_mods         r%   _keyDownr0     s    /!_S%9%A++C0J /#.6LD#ax.40@		Z&(	9MM  ,,VQ8I1M( MM$$VQ0A1E#ax5:t<tax>N	4	9MM  ,,VQKr$   c                 Z   U [         ;  d
  [         U    c  g[        R                  " U 5      n [        [         U    S5      u  p#US-  S4US-  S4US-  =(       d    US44 H:  u  pEU(       d  M  [        R
                  R                  R                  US	S	S	5        M<     [        R
                  R                  R                  US	[        S	5        US-  =(       d    US4US-  S4US-  S44 H>  u  pEU(       d  M  [        R
                  R                  R                  US	[        S	5        M@     g)
zPerforms a keyboard key release (without the press down beforehand).

Args:
  key (str): The key to be released up. The valid names are listed in
  pyautogui.KEY_NAMES.

Returns:
  None
Nr  r	   rQ   r   rO   r   r   r   )	r   r!  r"  r#  r   r$  r%  r&  r(  r)  s         r%   _keyUpr2  '  s    /!_S%9%A++C0J /#.6LD#ax.40@		Z&(	9MM  ,,VQ1=( MM$$VQC#ax5:t<tax>N	4	9MM  ,,VQKr$   c                      [         R                  R                  5       n [         R                  R                  R                  [         R                  " U 5      5        U R                  U R                  4$ )zReturns the current xy coordinates of the mouse cursor as a two-integer
tuple by calling the GetCursorPos() win32 function.

Returns:
  (x, y) tuple of the current xy coordinates of the mouse cursor.
)	r   r   POINTr$  r%  GetCursorPosbyrefxy)cursors    r%   	_positionr:  O  sJ     __""$F
MM%%fll6&:;HHfhhr$   c                      [         R                  R                  R                  S5      [         R                  R                  R                  S5      4$ )zReturns the width and height of the screen as a two-integer tuple.

Returns:
  (width, height) tuple of the screen size, in pixels.
r   r   r   r$  r%  GetSystemMetricsr   r$   r%   _sizer>  \  s:     MM  11!4fmm6J6J6[6[\]6^__r$   c                 V    [         R                  R                  R                  X5        g)a	  Send the mouse move event to Windows by calling SetCursorPos() win32
function.

Args:
  button (str): The mouse button, either 'left', 'middle', or 'right'
  x (int): The x position of the mouse event.
  y (int): The y position of the mouse event.

Returns:
  None
N)r   r$  r%  SetCursorPos)r7  r8  s     r%   _moveTorA  e  s     MM%%a+r$   c                     U[         [        [        4;  a  [        SU-  5      eU[         :X  a  [        nO!U[        :X  a  [
        nOU[        :X  a  [        n [        WX5        g! [        [        4 a     gf = f)a  Send the mouse down event to Windows by calling the mouse_event() win32
function.

Args:
  x (int): The x position of the mouse event.
  y (int): The y position of the mouse event.
  button (str): The mouse button, either 'left', 'middle', or 'right'

Returns:
  None
Jbutton arg to _click() must be one of "left", "middle", or "right", not %sN)
r   r   r   
ValueErrorMOUSEEVENTF_LEFTDOWNMOUSEEVENTF_MIDDLEDOWNMOUSEEVENTF_RIGHTDOWN_sendMouseEventPermissionErrorOSErrorr7  r8  buttonEVs       r%   
_mouseDownrN  w  sp     dFE**ehnnoo~!	6	#	5"A!W%    A$ $A76A7c                     U[         [        [        4;  a  [        SU-  5      eU[         :X  a  [        nO!U[        :X  a  [
        nOU[        :X  a  [        n [        WX5        g! [        [        4 a     gf = f)a
  Send the mouse up event to Windows by calling the mouse_event() win32
function.

Args:
  x (int): The x position of the mouse event.
  y (int): The y position of the mouse event.
  button (str): The mouse button, either 'left', 'middle', or 'right'

Returns:
  None
rC  N)
r   r   r   rD  MOUSEEVENTF_LEFTUPMOUSEEVENTF_MIDDLEUPMOUSEEVENTF_RIGHTUPrH  rI  rJ  rK  s       r%   _mouseUprT    sp     dFE**ehnnoo~	6	!	5 A!W% rO  c                     U[         [        [        4;  a  [        SU-  5      eU[         :X  a  [        nO!U[        :X  a  [
        nOU[        :X  a  [        n [        WX5        g! [        [        4 a     gf = f)a  Send the mouse click event to Windows by calling the mouse_event() win32
function.

Args:
  button (str): The mouse button, either 'left', 'middle', or 'right'
  x (int): The x position of the mouse event.
  y (int): The y position of the mouse event.

Returns:
  None
rC  N)
r   r   r   rD  MOUSEEVENTF_LEFTCLICKMOUSEEVENTF_MIDDLECLICKMOUSEEVENTF_RIGHTCLICKrH  rI  rJ  rK  s       r%   _clickrY    sp     dFE**ehnnoo~"	6	$	%#A!W% rO  c                  Z    [         R                  R                  R                  S5      S:g  $ )Nr[   r   r<  r   r$   r%   _mouse_is_swappedr[    s$     ==00499r$   c                    US:w  a  US:w  d   S5       e[        5       u  pESU-  U-  S-   nSU-  U-  S-   n[        R                  R                  R	                  U [        R
                  " U5      [        R
                  " U5      US5        g)a  The helper function that actually makes the call to the mouse_event()
win32 function.

Args:
  ev (int): The win32 code for the mouse event. Use one of the MOUSEEVENTF_*
  constants for this argument.
  x (int): The x position of the mouse event.
  y (int): The y position of the mouse event.
  dwData (int): The argument for mouse_event()'s dwData parameter. So far
    this is only used by mouse scrolling.

Returns:
  None
Nzx and y cannot be set to Nonei   r   r   )r>  r   r$  r%  mouse_eventc_long)evr7  r8  dwDatawidthheight
convertedX
convertedYs           r%   rH  rH    s     9dC$CC"  GMEe#a'Jf$q(J
MM$$Rz)BFMMR\D]_eghir$   c                     [        5       u  p4[        5       u  pVUc  UnOUS:  a  SnO
X:  a  US-
  nUc  UnOUS:  a  SnO
X&:  a  US-
  n [        [        XU S9  g! [        [
        4 a     gf = f)ak  Send the mouse vertical scroll event to Windows by calling the
mouse_event() win32 function.

Args:
  clicks (int): The amount of scrolling to do. A positive value is the mouse
  wheel moving forward (scrolling up), a negative value is backwards (down).
  x (int): The x position of the mouse event.
  y (int): The y position of the mouse event.

Returns:
  None
Nr   r   )r`  )r:  r>  rH  MOUSEEVENTF_WHEELrI  rJ  )clicksr7  r8  startxstartyra  rb  s          r%   _scrollrj    s     [NFGMEyq5AZ	Ayq5A[
A)1?W% s   A A/.A/c                     [        XU5      $ )aW  Send the mouse horizontal scroll event to Windows by calling the
mouse_event() win32 function.

Args:
  clicks (int): The amount of scrolling to do. A positive value is the mouse
  wheel moving right, a negative value is moving left.
  x (int): The x position of the mouse event.
  y (int): The y position of the mouse event.

Returns:
  None
rj  rg  r7  r8  s      r%   _hscrollrn     s     6a  r$   c                     [        XU5      $ )aF  A wrapper for _scroll(), which does vertical scrolling.

Args:
  clicks (int): The amount of scrolling to do. A positive value is the mouse
  wheel moving forward (scrolling up), a negative value is backwards (down).
  x (int): The x position of the mouse event.
  y (int): The y position of the mouse event.

Returns:
  None
rl  rm  s      r%   _vscrollrp  0  s     6a  r$   )r   )NN):r   ctypes.wintypesr!  r   r   r   sysplatform	Exceptionr$  r%  SetProcessDPIAwareAttributeErrorMOUSEEVENTF_MOVErE  rQ  rV  rG  rS  rX  rF  rR  rW  MOUSEEVENTF_ABSOLUTErf  MOUSEEVENTF_HWHEELr'  r(  INPUT_MOUSEINPUT_KEYBOARD	Structurer   r'   r-   r3   dict	KEY_NAMESr   updaterangec
VkKeyScanAr   WCHARchrr0  r2  r:  r>  rA  rN  rT  rY  r[  rH  rj  rn  rp  )r*  s   0r%   <module>r     s  
    ) ) 
<<G
Y
ZZ		==**,
_    ,/AA   .1DD   03GG       !! !! F$$ F "V y/B/BC/Bd/BCD    zz$z Tz 
4	z
 	$z Tz Tz 	$z dz Tz Dz 
4z Tz z Dz  t!z" d#z$ T%z& T'z( T)z* T+z, 
4-z. d/z0 t1z2 $3z4 d5z6 $7z8 9z: T;z< D=z> D?z@ dAzB CzD 
4EzF DGzH DIzJ 	$KzL TMzN DOzP dQzR TSzT tUzV TWzX dYzZ [z\ 4]z^ d_z` 
4azb dczd Dezf 
4gzh tizj kzl Dmzn Tozp Dqzr Dszt Duzv Dwzx Dyzz D{z| D}z~ Dz@ DAzB DCzD EzF 
4GzH IzJ KzL tMzN dOzP 	$QzR 	$SzT 	$UzV 	$WzX 	$YzZ 	$[z\ 	$]z^ 	$_z` 	$azb 
4czd 
4ezf 
4gzh 
4izj 
4kzl 
4mzn 
4ozp 
4qzr 
4szt 
4uzv 
4wzx 
4yzz 
4{z| 
4}z~ 
4z@ tAzB $CzD EzF $GzH IzJ KzL tMzN OzP 4QzR dSzT dUzV 4WzX TYzZ [z\ 4]z^ $_z` $azb czd ezf gzh Dizj kzl $mzn ozp sz zJ 
r3A$mm22==foo>S>STWXYTZ>[\OCF 
*LZ%LP
 `,$:8::
"jR"J! !}  		| Ds   $L )LLL