o
    'š£hÐ§  ã                
   @   s|  d Z dZddlZddlZddlZddlZddlZddlmZm	Z	m
Z
mZmZmZmZmZmZ ddlZddlZz
ddlmZ dZW n eyK   dZY nw ejdkršddlZer]dd	lmZ zejj ¡  W n	 eyn   Y nw ejj d¡ZG d
d„ dejƒZdd„ Z e Z!d>dd„Z"e"Z#dd„ Z$e$Z%dd„ Z&e&Z'nejdkrPddl(m)Z)m*Z* ddl+m,Z, e -e .d¡¡Z/e)dƒZ0e0 1d¡ e -e .d¡¡Z2eZ3eZ4e,de4ƒ eZ5e,de5ƒ eZ6eZ7eZ8eZ9eZ:eZ;e3ge2j<_=ee2j<_>e5e9ege2j?_=e4e2j?_>e5e7e*e:ge2j@_=e4e2j@_>e5e;ee	ge2jA_=e4e2jA_>e4e8e
ge2jB_=de2jB_>e4e7ge2jC_Dde2jC_>e6e4ge2jE_=de2jE_>g e2jF_=e3e2jF_>dd„ ZGeGZ!d>dd „ZHeHZ#d!d"„ ZIeIZ%d#d$„ ZJeJZ'nde K¡ d%kr´dd&lLmMZM ddlNZNdZOzejPd'd(gejQejQd)ZReR S¡ dkZOW n eTy“ ZU zeUjNeNjVkrˆn‚ W Y dZU[UndZU[Uww eMejWd* ƒZXd+d,„ ZYeYZ!d>d-d.„ZZeZZ#d/d0„ Z[e[Z%d1d2„ Z\e\Z'ej]d d3kZ^e K¡ d%kre^rãzddl_Z`e`Zadd4l_mbZb W nQ eyâ   e cd5¡ Y nCw zddl`Z`dd6l`maZa dd4l`mbZb W n/ ey   e cd7¡ Y n!w e^rddl_Z`e`Zadd4l_mbZb nddl`Z`dd6l`maZa dd4l`mbZb d8ZdG d9d:„ d:ƒZed;d<„ Zfegd=kr<eeƒ  dS dS )?aß  
Features we should consider adding:
* Register a global hotkey for copying/logging info. (Should this hotkey be configurable?)

Features that have been considered and rejected:

* The Save Log/Save Screenshot buttons should open a file dialog box.
* The Save Log button should append text, instead of overwrite it.
* The log text area should prepopulate itself with the contents of the given filename.
* The button delay should be configurable instead of just set to 3 seconds.
z0.1.3é    N)	Úc_boolÚc_int32Úc_int64Úc_size_tÚc_uint16Úc_uint32Úc_void_pÚcdllÚutil)ÚImageTFÚwin32)Ú	ImageGrabc                   @   s    e Zd ZdejfdejfgZdS )ÚPOINTÚxÚyN)Ú__name__Ú
__module__Ú__qualname__ÚctypesZc_longZ_fields_© r   r   úi/Users/merlin/projects/employee-monitoring-system/venv/lib/python3.10/site-packages/mouseinfo/__init__.pyr   <   s    ÿr   c                  C   s&   t ƒ } tjj t | ¡¡ | j| jfS ©N)r   r   ÚwindllÚuser32ZGetCursorPosZbyrefr   r   )Úcursorr   r   r   Ú_winPosition@   s   r   c                 C   s>   zt  ¡ }| d ur| | ¡ W |S W |S  ty   tdƒ‚w )NzGPillow module must be installed to use screenshot functions on Windows.)r   ZgrabÚsaveÚ	NameErrorÚImportError)ÚfilenameÚimr   r   r   Ú_winScreenshotG   s   üþÿr!   c                   C   s   t jj d¡t jj d¡fS )Nr   é   )r   r   r   ZGetSystemMetricsr   r   r   r   Ú_winSizeS   s   r#   c                 C   s@   t jj t| |¡}|d }|d }|d }|d }|}|||fS )Né   )r   r   Zgdi32ZGetPixelÚdc)r   r   ZcolorRefÚredÚgreenÚbluer   r   r   Ú_winGetPixelW   s   
r)   Údarwin)Ú	ObjCClassÚCGPoint)Úregister_preferred_encodingZAppKitÚNSEventÚmouseLocationZCoreGraphicss   ^{__CGEvent=}s   ^{__CGEventSource=}c                  C   s$   t j} t| jƒtt d¡| j ƒfS )Nr   )r.   r/   Úintr   Úcore_graphicsÚCGDisplayPixelsHighr   )Úlocr   r   r   Ú_macPosition«   s   r4   c                 C   sZ   | d ur| }n
dt j  ¡  d¡ }t dd|g¡ t |¡}| ¡  | d u r+t 	|¡ |S )Nzscreenshot%s.pngú%Y-%m%d_%H-%M-%S-%fZscreencapturez-x)
ÚdatetimeÚnowÚstrftimeÚ
subprocessÚcallr   ÚopenÚloadÚosÚunlink©r   ZtmpFilenamer    r   r   r   Ú_macScreenshot±   s   

r@   c                   C   s   t  t  ¡ ¡t  t  ¡ ¡fS r   )r1   ÚCGDisplayPixelsWideÚCGMainDisplayIDr2   r   r   r   r   Ú_macSizeÁ   s   þrC   c                 C   ó&   t ƒ  | |f¡}|d |d |d fS ©Nr   r"   é   ©Ú
screenshotZgetpixel©r   r   ZrgbValuer   r   r   Ú_macGetPixelÈ   ó   rJ   ÚLinux)ÚDisplayÚwhichÚscrot)ÚstdoutÚstderrZDISPLAYc                  C   s    t  ¡ j ¡ j} | d | d fS )NZroot_xZroot_y)Ú_displayÚscreenÚrootZquery_pointerÚ_data)Zcoordr   r   r   Ú_linuxPositioná   s   rV   c                 C   sr   t stdƒ‚| d ur| }n
dtj ¡  d¡ }t r5t dd|g¡ t |¡}| 	¡  | d u r3t
 |¡ |S tdƒ‚)Nz_"scrot" must be installed to use screenshot functions in Linux. Run: sudo apt-get install scrotz.screenshot%s.pngr5   rO   z-zzqThe scrot program must be installed to take a screenshot with PyScreeze on Linux. Run: sudo apt-get install scrot)ÚscrotExistsÚNotImplementedErrorr6   r7   r8   r9   r:   r   r;   r<   r=   r>   Ú	Exceptionr?   r   r   r   Ú_linuxScreenshotæ   s   

rZ   c                   C   s   t  ¡ jt  ¡ jfS r   )rR   rS   Zwidth_in_pixelsZheight_in_pixelsr   r   r   r   Ú
_linuxSizeý   s   r[   c                 C   rD   rE   rG   rI   r   r   r   Ú_linuxGetPixel  rK   r\   rF   )ÚEventzvNOTE: You must install tkinter on Linux to use MouseInfo. Run the following: sudo apt-get install python-tk python-dev)ÚttkzxNOTE: You must install tkinter on Linux to use MouseInfo. Run the following: sudo apt-get install python3-tk python3-devé   c                   @   s„   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	d
„ Zdd„ Zdd„ Z	dd„ Z
dd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ ZdS ) ÚMouseInfoWindowc                 C   s  t ƒ \}}| j d|| j || j f ¡ tƒ \}}ts#| j d¡ n=tj	dkr/| j d¡ n1d|  kr9|k rFn nd|  krE|k sMn | j d¡ nt
||ƒ\}}}| j d|||f ¡ tsi| j d¡ natj	dkru| j d¡ nUd|  kr|k rŒn nd|  kr‹|k s“n | j d¡ n7t|ƒdd …  ¡  dd	¡}t|ƒdd …  ¡  dd	¡}	t|ƒdd …  ¡  dd	¡}
d
||	|
f }| j |¡ trètj	dksèd|  krÛ|k rèn nd|  krç|k sðn | jjdd n| jj|d | jr| j d| j¡| _d S d S )Nz%s,%sZNA_Pillow_unsupportedr*   ZNA_on_macOSr   ZNA_on_multimonitor_setupsz%s,%s,%srF   Ú0z#%s%s%sÚblack)Ú
backgroundéd   )ÚpositionÚxyTextboxSVÚsetÚxOriginÚyOriginÚsizeÚ_PILLOW_INSTALLEDÚrgbSVÚsysÚplatformÚgetPixelÚrgbHexSVÚhexÚupperÚrjustÚ
colorFrameÚ	configureÚ	isRunningrT   ÚafterÚ_updateMouseInfoTextFieldsÚ_updateMouseInfoJob)Úselfr   r   ÚwidthÚheightÚrÚgÚbZrHexZgHexZbHexZhexColorr   r   r   rx   (  s8   
 

.
.<z*MouseInfoWindow._updateMouseInfoTextFieldsc              
   C   s†   zt  |¡ | j d| ¡ W d S  t jyB } z%t ¡ dkr&| j d¡ n| j dt|ƒ ¡ W Y d }~d S W Y d }~d S d }~ww )NzCopied rL   z-Copy failed. Run "sudo apt-get install xsel".zClipboard error: )Ú	pyperclipÚcopyÚstatusbarSVrg   ZPyperclipExceptionrn   ÚsystemÚstr)rz   Z
textToCopyÚer   r   r   Ú	_copyTextd  s   
"þ€þzMouseInfoWindow._copyTextc                 G   óî   t |ƒdkrt|d tƒrd}| j ¡ dkr-t |ƒdkr-| j d| jd¡ | j 	d¡ d S t |ƒdkrJ|d dkrJ| j d| jd¡ | j 	d¡ d S t |ƒdkrg|d dkrg| j d| jd¡ | j 	d	¡ d S |  
| j ¡ ¡ | j 	d
¡ d S )Nr   r   Úonéè  rF   ú	Copy in 3r"   ú	Copy in 2ú	Copy in 1úCopy XY)ÚlenÚ
isinstancer]   ÚdelayEnabledSVÚgetrT   rw   Ú_copyXyMouseInfoÚxyCopyButtonSVrg   r†   rf   ©rz   Úargsr   r   r   r’   o  ó   z MouseInfoWindow._copyXyMouseInfoc                 G   r‡   )Nr   r   rˆ   r‰   rF   rŠ   r"   r‹   rŒ   úCopy RGB)rŽ   r   r]   r   r‘   rT   rw   Ú_copyRgbMouseInfoÚrgbCopyButtonSVrg   r†   rl   r”   r   r   r   r˜   ˆ  r–   z!MouseInfoWindow._copyRgbMouseInfoc                 G   r‡   )Nr   r   rˆ   r‰   rF   rŠ   r"   r‹   rŒ   zCopy RGB Hex)rŽ   r   r]   r   r‘   rT   rw   Ú_copyRgbHexMouseInfoÚrgbHexCopyButtonSVrg   r†   rp   r”   r   r   r   rš   ¡  r–   z$MouseInfoWindow._copyRgbHexMouseInfoc                 G   s(  d| j  ¡ | j ¡ | j ¡ f }t|ƒdkrt|d tƒrd}| j ¡ dkr=t|ƒdkr=| j 	d| j
d¡ | j d¡ d S t|ƒdkrZ|d dkrZ| j 	d| j
d¡ | j d	¡ d S t|ƒdkrw|d dkrw| j 	d| j
d¡ | j d
¡ d S d| j  ¡ | j ¡ | j ¡ f }|  |¡ | j d¡ d S )Nú%s %s %sr   r   rˆ   r‰   rF   rŠ   r"   r‹   rŒ   úCopy All)rf   r‘   rl   rp   rŽ   r   r]   r   rT   rw   Ú_copyAllMouseInfoÚallCopyButtonSVrg   r†   )rz   r•   ÚtextFieldContentsr   r   r   rž   º  s*   
þ
þ
z!MouseInfoWindow._copyAllMouseInfoc                 G   ó&  t |ƒdkrt|d tƒrd}| j ¡ dkr-t |ƒdkr-| j d| jd¡ | j 	d¡ d S t |ƒdkrJ|d dkrJ| j d| jd¡ | j 	d¡ d S t |ƒdkrg|d dkrg| j d| jd¡ | j 	d	¡ d S | j
 d
d¡d| j ¡   }| j 	|¡ |  |¡ | j 	d| j ¡  ¡ | j 	d¡ d S )Nr   r   rˆ   r‰   rF   úLog in 3r"   úLog in 2úLog in 1ú1.0úend-1cú%s
úLogged úLog XY)rŽ   r   r]   r   r‘   rT   rw   Ú_logXyMouseInfoÚxyLogButtonSVrg   ÚlogTextarearf   ÚlogTextboxSVÚ_setLogTextAreaContentsr‚   ©rz   r•   ÚlogContentsr   r   r   rª   Ú  ó    
zMouseInfoWindow._logXyMouseInfoc                 G   r¡   )Nr   r   rˆ   r‰   rF   r¢   r"   r£   r¤   r¥   r¦   r§   r¨   úLog RGB)rŽ   r   r]   r   r‘   rT   rw   Ú_logRgbMouseInfoÚrgbLogButtonSVrg   r¬   rl   r­   r®   r‚   r¯   r   r   r   r³   ö  r±   z MouseInfoWindow._logRgbMouseInfoc                 G   r¡   )Nr   r   rˆ   r‰   rF   r¢   r"   r£   r¤   r¥   r¦   r§   r¨   zLog RGB Hex)rŽ   r   r]   r   r‘   rT   rw   Ú_logRgbHexMouseInfoÚrgbHexLogButtonSVrg   r¬   rp   r­   r®   r‚   r¯   r   r   r   rµ     r±   z#MouseInfoWindow._logRgbHexMouseInfoc                 G   s:  t |ƒdkrt|d tƒrd}| j ¡ dkr-t |ƒdkr-| j d| jd¡ | j 	d¡ d S t |ƒdkrJ|d dkrJ| j d| jd¡ | j 	d¡ d S t |ƒdkrg|d dkrg| j d| jd¡ | j 	d	¡ d S d
| j
 ¡ | j ¡ | j ¡ f }| j dd¡d|  }| j 	|¡ |  |¡ | j 	d| ¡ | j 	d¡ d S )Nr   r   rˆ   r‰   rF   r¢   r"   r£   r¤   rœ   r¥   r¦   r§   r¨   úLog All)rŽ   r   r]   r   r‘   rT   rw   Ú_logAllMouseInfoÚallLogButtonSVrg   rf   rl   rp   r¬   r­   r®   r‚   )rz   r•   r    r°   r   r   r   r¸   .  s(   
þ
z MouseInfoWindow._logAllMouseInfoc                 C   sŒ   |  ¡ }t| d¡ƒdkrd S | d¡\}}| ¡ }| ¡ }| ¡ r&| ¡ s(d S t|ƒ| _t|ƒ| _| j 	dt
| jƒ d t
| jƒ ¡ d S )Nú,rF   zSet XY Origin to z, )r‘   rŽ   ÚsplitÚstripÚ	isdecimalr0   rh   ri   r‚   rg   r„   )rz   ÚsvÚcontentsr   r   r   r   r   Ú_xyOriginChangedL  s   

(z MouseInfoWindow._xyOriginChangedc                 C   sV   t r| j dtj¡ | j tj|¡ n	| j dtj|¡ | j ¡ \}}| j |¡ d S )Nr¥   )	ÚRUNNING_PYTHON_2r¬   ÚdeleteÚtkinterZENDÚinsertÚreplaceÚyviewZyview_moveto)rz   r°   ZtopOfTextAreaZbottomOfTextArear   r   r   r®   Y  s   z'MouseInfoWindow._setLogTextAreaContentsc              
   G   sš   z"t | j ¡ dƒ}| | j ¡ ¡ W d   ƒ n1 sw   Y  W n ty? } z| j dt|ƒ ¡ W Y d }~d S d }~ww | j d| j ¡  ¡ d S )NÚwúERROR: zLog file saved to )	r;   ÚlogFilenameSVr‘   Úwriter­   rY   r‚   rg   r„   )rz   r•   Úfor…   r   r   r   Ú_saveLogFilee  s   ÿ€"€ÿzMouseInfoWindow._saveLogFilec              
   G   s|   t s
| j d¡ d S z	t| j ¡ ƒ W n ty0 } z| j dt|ƒ ¡ W Y d }~d S d }~ww | j d| j ¡  ¡ d S )NzERROR: NA_Pillow_unsupportedrÈ   zScreenshot file saved to )rk   r‚   rg   rH   ÚscreenshotFilenameSVr‘   rY   r„   )rz   r•   r…   r   r   r   Ú_saveScreenshotFiler  s   "€ÿz#MouseInfoWindow._saveScreenshotFilec                    sð	  dˆ _ t ¡ ˆ _ˆ j dt ¡ ˆ j dd¡ tr t ˆ j¡}nt	jˆ jdd}|j
ddtjtjtjtjfd |jdd	d
 |jdd	d
 d	}t ¡ ˆ _ˆ j d¡ t	j|dˆ jddd}|j
d	|dtjd t ¡ ˆ _ˆ j d¡ t	j|ˆ jtˆ jdˆ _ˆ jj
d|tjd ˆ j dˆ j¡ t ¡ ˆ _ˆ j d¡ t	j|ˆ jtˆ jdˆ _ˆ jj
d|tjd ˆ j dˆ j¡ t ¡ ˆ _t ¡ ˆ _t ¡ ˆ _ t ¡ ˆ _!t ¡ ˆ _"t ¡ ˆ _#t ¡ ˆ _$t ¡ ˆ _%|d	7 }t	j&|dˆ jdˆ _'ˆ j'j
d|tjtjfd t	j(|ddj
d	|tjd t ¡ ˆ _)ˆ j) d¡ t	j|ˆ j)tˆ j*dˆ _+ˆ j+j
d|tjd ˆ j+ dˆ j*¡ t ¡ ˆ _,ˆ j, d¡ t	j|ˆ j,tˆ j-dˆ _.ˆ j.j
d|tjd ˆ j. dˆ j-¡ |d	7 }t	j&|dˆ jdˆ _/ˆ j/j
d|tjtjfd t	j(|ddj
d	|tjd t ¡ ˆ _0ˆ j0 d¡ t	j|ˆ j0tˆ j1dˆ _2ˆ j2j
d|tjd ˆ j2 dˆ j1¡ t ¡ ˆ _3ˆ j3 d¡ t	j|ˆ j3tˆ j4dˆ _5ˆ j5j
d|tjd ˆ j5 dˆ j4¡ |d	7 }t	j&|dˆ j dˆ _6ˆ j6j
d|tjtjfd t	j(|d dj
d	|tjd t ¡ ˆ _7ˆ j7 d!¡ t	j|ˆ j7tˆ j8dˆ _9ˆ j9j
d|tjd ˆ j9 dˆ j8¡ t ¡ ˆ _:ˆ j: d"¡ t	j|ˆ j:tˆ j;dˆ _<ˆ j<j
d|tjd ˆ j< dˆ j;¡ |d	7 }tj|d#d#d$ˆ _=ˆ j=j
d|tjtjfd t	j(|d%dj
d	|tjd |d	7 }dˆ _>dˆ _?ˆ j! d&¡ t	j(|d'dj
d	|tjd ˆ j! @d(ˆ j!f‡ fd)d*„	¡ t	j&|dˆ j!dˆ _Aˆ jAj
d|tjtjfd |d	7 }tjB|d+d,d$ˆ _Cˆ jCj
d	|dtjtjtjtjfd t	jD|tjEˆ jCjFd-ˆ _Gˆ jGj
d.|tjtjfd ˆ jGjˆ jCd/< |d	7 }t	j&|dˆ j#dˆ _Hˆ jHj
d	|dtjtjfd t	j|d0tˆ jId1ˆ _Jˆ jJj
d|tjd ˆ jJ dˆ jI¡ ˆ j# tKjL MtK N¡ d2¡¡ |d	7 }t	j&|dˆ j$d}|j
d	|dtjtjfd t	j|d3tˆ jOd1ˆ _Pˆ jPj
d|tjd ˆ jP dˆ jO¡ ˆ j$ tKjL MtK N¡ d4¡¡ |d	7 }t	j(|tjQˆ j%d5}|j
d	|d.tjtjfd | R¡ D ]6}|ˆ jGkr·|jSddd6 q¦|ˆ jCkrÆ|jSd7dd6 q¦||krÔ|jSdd7d6 q¦|jSddd6 q¦ˆ j Td8tjU¡ t Vˆ j¡}ˆ jjW|d9 t V|¡}|jXd:ˆ jd;d.d< |jXd=ˆ j*d>d.d< |jXd?ˆ j1d@d.d< |jXdAˆ j8dBdCd< |jYdD|ddE t V|¡}	|	jXdFˆ jdGdd< |	jXdHˆ j-dIdd< |	jXdJˆ j4dKdd< |	jXdLˆ j;dMdNd< |jYdO|	ddE t V|¡}
|
jXdPdQd*„ d,dR |jYdS|
ddE ˆ j ZdTˆ j¡ ˆ j ZdUˆ j*¡ ˆ j ZdVˆ j1¡ ˆ j ZdWˆ j8¡ ˆ j ZdXˆ j¡ ˆ j ZdYˆ j-¡ ˆ j ZdZˆ j4¡ ˆ j Zd[ˆ j;¡ ˆ j [d\d\¡ ˆ j' \¡  ˆ j ]dˆ j^¡ˆ __ˆ j `d]d¡ ˆ j a¡  ˆ j b¡  ˆ j cˆ j_¡ d\ˆ _ zˆ j d¡  W d^S  tjey÷   Y d^S w )_zLaunches the MouseInfo window, which displays XY coordinate and RGB
        color information for the mouse's current position.Tz
MouseInfo i  rd   z	3 3 12 12)Úpaddingr   )ÚcolumnÚrowÚstickyr"   )Úweightrˆ   z3 Sec. Button DelayÚoff)ÚtextÚvariableZonvalueZoffvaluerF   )rÐ   rÑ   Z
columnspanrÒ   zCopy All (F1))Útextvariabler{   Úcommandé   z<Return>zLog All (F5)é   r_   )r{   r×   zXY Position)rÕ   zCopy XY (F2)zLog XY (F6)z	RGB ColorzCopy RGB (F3)zLog RGB (F7)z
RGB as HexzCopy RGB Hex (F4)zLog RGB Hex (F8)é2   )r{   r|   ÚColorz0, 0z	XY OriginrÇ   c                    s
   ˆ   |¡S r   )rÀ   )ÚnameÚindexÚmoder¾   ©rz   r   r   Ú<lambda>  ó   
 z*MouseInfoWindow.__init__.<locals>.<lambda>é   é   )ZorientrØ   é   ZyscrollcommandzSave Log)rÕ   r{   rØ   zmouseInfoLog.txtzSave ScreenshotzmouseInfoScreenshot.png)Zreliefr×   )ZpadxZpady)rÙ   r   z*tearOff)Úmenur   ZF1)ÚlabelrØ   ZacceleratorÚ	underliner   ZF2r—   ZF3zCopy RGB as HexZF4é   ZCopy)rç   ræ   rè   r·   ZF5r©   ZF6r²   ZF7zLog RGB as HexZF8é   ZLogzOnline Documentationc                   S   s
   t  d¡S )Nz https://mouseinfo.readthedocs.io)Ú
webbrowserr;   r   r   r   r   rá   V  râ   )rç   rØ   rè   ZHelpz<F1>z<F2>z<F3>z<F4>z<F5>z<F6>z<F7>z<F8>Fz-topmostN)frv   rÃ   ZTkrT   ÚtitleÚ__version__ZminsizerÁ   ÚFramer^   ÚgridÚNÚWÚEÚSZcolumnconfigureZrowconfigureZ	StringVarr   rg   ZCheckbuttonrŸ   ZButtonÚMOUSE_INFO_BUTTON_WIDTHrž   ZallCopyButtonÚbindr¹   r¸   ZallLogButtonrf   rl   rp   Z
xyOriginSVr­   rÉ   rÍ   r‚   ZEntryZxyInfoTextboxÚLabelr“   r’   ZxyCopyButtonr«   rª   ZxyLogButtonZrgbSV_entryr™   r˜   ZrgbCopyButtonr´   r³   ZrgbLogButtonZrgbHexSV_entryr›   rš   ZrgbHexCopyButtonr¶   rµ   ZrgbHexLogButtonrt   rh   ri   ÚtraceZxyOriginSV_entryÚTextr¬   Z	ScrollbarZVERTICALrÆ   ZlogTextareaScrollbarZlogFilenameTextboxrÌ   ZsaveLogButtonr=   ÚpathÚjoinÚgetcwdrÎ   ZsaveScreenshotButtonZSUNKENZwinfo_childrenZgrid_configureZ
option_addÚFALSEZMenuÚconfigZadd_commandZadd_cascadeZbind_allZ	resizableZfocusrw   rx   ry   Ú
attributesÚupdateZmainloopZafter_cancelÚdestroyZTclError)rz   Z	mainframeZCUR_ROWZdelayCheckboxZ&G_MOUSE_INFO_SCREENSHOT_FILENAME_entryZ	statusbarÚchildræ   ZcopyMenuZlogMenuZhelpMenur   rà   r   Ú__init__‚  s:  
 
















$






ÿzMouseInfoWindow.__init__N)r   r   r   rx   r†   r’   r˜   rš   rž   rª   r³   rµ   r¸   rÀ   r®   rÌ   rÎ   r  r   r   r   r   r`   '  s     < r`   c                   C   s
   t ƒ  dS )a  
    Launch the MouseInfo application in a new window.

    This exists as a shortcut instead of running MouseInfoWindow() because
    PyAutoGUI (which imports mouseinfo) is set up with a simple mouseInfo()
    function and I'd like to keep this consistent with that.
    N)r`   r   r   r   r   Ú	mouseInfoz  s   
r  Ú__main__r   )hÚ__doc__rí   r€   rm   r=   rn   rë   r   r   r   r   r   r   r   r   r	   r
   r6   r9   ZPILr   rk   r   r   r   r   ZSetProcessDPIAwareÚAttributeErrorZGetDCr%   Z	Structurer   r   re   r!   rH   r#   rj   r)   ro   Zrubicon.objcr+   r,   Zrubicon.objc.typesr-   ZLoadLibraryZfind_libraryZappkitr.   Zdeclare_class_propertyr1   ZCGDirectDisplayIDZ
CGEventRefZCGEventSourceRefZCGEventTapLocationZCGEventTypeZCGEventFieldZ	CGKeyCodeZCGMouseButtonZCGScrollEventUnitrA   ÚargtypesÚrestypeZCGEventCreateKeyboardEventZCGEventCreateMouseEventZCGEventCreateScrollWheelEventZCGEventSetIntegerValueFieldZCGEventSetTypeZargtypeZCGEventPostrB   r4   r@   rC   rJ   rƒ   ZXlib.displayrM   ÚerrnorW   ÚPopenÚPIPEZ	whichProcÚwaitÚOSErrorÚexÚENOENTÚenvironrR   rV   rZ   r[   r\   Úversion_inforÁ   ÚTkinterrÃ   r^   r]   Úexitrô   r`   r  r   r   r   r   r   Ú<module>   s  (,ÿ
ÿ

	




ÿþ€ü
ÿÿ    W


ÿ