
    \
j                     D    d Z ddlZddlmZ ddlmZ  G d d          ZdS )zxEvents for :py:mod:`pyglet.window`.

See :py:class:`~pyglet.window.Window` for a description of the window event types.
    N)key)mousec                       e Zd ZdZddZd Zd Zd Zd Zd Z	d	 Z
d
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd ZdS )WindowEventLoggera,  Print all events to a file.

    When this event handler is added to a window it prints out all events
    and their parameters; useful for debugging or discovering which events
    you need to handle.

    Example::

        win = window.Window()
        win.push_handlers(WindowEventLogger())

    Nc                 0    |t           j        }|| _        dS )zCreate a `WindowEventLogger` which writes to `logfile`.

        :Parameters:
            `logfile` : file-like object
                The file to write to.  If unspecified, stdout will be used.

        N)sysstdoutfile)selflogfiles     M/DATA/AppData/hermes/venv/lib/python3.11/site-packages/pyglet/window/event.py__init__zWindowEventLogger.__init__<   s     ?jG			    c                     t          dt          j        |          dt          j        |          d| j                   d S )Nzon_key_press(symbol=, modifiers=)r
   printr   symbol_stringmodifiers_stringr
   r   symbol	modifierss      r   on_key_presszWindowEventLogger.on_key_pressH   ]    f%%%%s';I'F'F'F'FHNRi	Y 	Y 	Y 	Y 	Y 	Yr   c                     t          dt          j        |          dt          j        |          d| j                   d S )Nzon_key_release(symbol=r   r   r   r   r   s      r   on_key_releasez WindowEventLogger.on_key_releaseL   r   r   c                 8    t          d|z  | j                   d S )Nzon_text(text=%r)r   r   r
   )r   texts     r   on_textzWindowEventLogger.on_textP   s#     4'di888888r   c                 \    t          dt          j        |          z  | j                   d S )Nzon_text_motion(motion=%s)r   r   r   motion_stringr
   r   motions     r   on_text_motionz WindowEventLogger.on_text_motionS   s>    )f%%'-1Y	8 	8 	8 	8 	8 	8r   c                 \    t          dt          j        |          z  | j                   d S )Nz on_text_motion_select(motion=%s)r   r$   r&   s     r   on_text_motion_selectz'WindowEventLogger.on_text_motion_selectW   s>    0f%%'-1Y	8 	8 	8 	8 	8 	8r   c                 @    t          d||||fz  | j                   d S )Nz)on_mouse_motion(x=%d, y=%d, dx=%d, dy=%d)r   r    r   xydxdys        r   on_mouse_motionz!WindowEventLogger.on_mouse_motion[   >    9q"b=  $		+ 	+ 	+ 	+ 	+ 	+r   c                     t          d||||t          j        |          t          j        |          fz  | j                   d S )NzAon_mouse_drag(x=%d, y=%d, dx=%d, dy=%d, buttons=%s, modifiers=%s)r   r   r   buttons_stringr   r   r
   )r   r-   r.   r/   r0   buttonsr   s          r   on_mouse_dragzWindowEventLogger.on_mouse_drag_   s\    QBE0993;OPY;Z;ZU\ \9	 	 	 	 	 	r   c           	          t          d||t          j        |          t          j        |          fz  | j                   d S )Nz3on_mouse_press(x=%d, y=%d, button=%r, modifiers=%s)r   r4   r   r-   r.   buttonr   s        r   on_mouse_pressz WindowEventLogger.on_mouse_pressd   s^    Cq%&v..0DY0O0OGQ QW[W`	b 	b 	b 	b 	b 	br   c           	          t          d||t          j        |          t          j        |          fz  | j                   d S )Nz5on_mouse_release(x=%d, y=%d, button=%r, modifiers=%s)r   r4   r9   s        r   on_mouse_releasez"WindowEventLogger.on_mouse_releaseh   s^    Eq%&v..0DY0O0OIQ QW[W`	b 	b 	b 	b 	b 	br   c                 @    t          d||||fz  | j                   d S )Nz)on_mouse_scroll(x=%f, y=%f, dx=%f, dy=%f)r   r    r,   s        r   on_mouse_scrollz!WindowEventLogger.on_mouse_scrolll   r2   r   c                 2    t          d| j                   d S )Nz
on_close()r   r    r   s    r   on_closezWindowEventLogger.on_closep   s    l++++++r   c                 <    t          d||fz  | j                   d S )Nzon_mouse_enter(x=%d, y=%d)r   r    r   r-   r.   s      r   on_mouse_enterz WindowEventLogger.on_mouse_enters   '    *aV3$)DDDDDDr   c                 <    t          d||fz  | j                   d S )Nzon_mouse_leave(x=%d, y=%d)r   r    rD   s      r   on_mouse_leavez WindowEventLogger.on_mouse_leavev   rF   r   c                 2    t          d| j                   d S )Nzon_expose()r   r    rA   s    r   	on_exposezWindowEventLogger.on_exposey   s    m$),,,,,,r   c                 <    t          d||fz  | j                   d S )Nzon_resize(width=%d, height=%d)r   r    )r   widthheights      r   	on_resizezWindowEventLogger.on_resize|   s'    .%@tyQQQQQQr   c                 <    t          d||fz  | j                   d S )Nzon_move(x=%d, y=%d)r   r    rD   s      r   on_movezWindowEventLogger.on_move   s'    #q!f,49======r   c                 2    t          d| j                   d S )Nzon_activate()r   r    rA   s    r   on_activatezWindowEventLogger.on_activate   s    oDI......r   c                 2    t          d| j                   d S )Nzon_deactivate()r   r    rA   s    r   on_deactivatezWindowEventLogger.on_deactivate   s    di000000r   c                 2    t          d| j                   d S )Nz	on_show()r   r    rA   s    r   on_showzWindowEventLogger.on_show       k	******r   c                 2    t          d| j                   d S )Nz	on_hide()r   r    rA   s    r   on_hidezWindowEventLogger.on_hide   rW   r   c                 2    t          d| j                   d S )Nzon_context_lost()r   r    rA   s    r   on_context_lostz!WindowEventLogger.on_context_lost   s    !	222222r   c                 2    t          d| j                   d S )Nzon_context_state_lost()r   r    rA   s    r   on_context_state_lostz'WindowEventLogger.on_context_state_lost   s    'di888888r   c                 2    t          d| j                   d S )Nz	on_draw()r   r    rA   s    r   on_drawzWindowEventLogger.on_draw   rW   r   )N)__name__
__module____qualname____doc__r   r   r   r"   r(   r*   r1   r7   r;   r=   r?   rB   rE   rH   rJ   rN   rP   rR   rT   rV   rY   r[   r]   r_    r   r   r   r   /   s        
 
 
 
Y Y YY Y Y9 9 98 8 88 8 8+ + +  
b b bb b b+ + +, , ,E E EE E E- - -R R R> > >/ / /1 1 1+ + ++ + +3 3 39 9 9+ + + + +r   r   )rc   r   pyglet.windowr   r   r   rd   r   r   <module>rf      s{   H 
 


            f+ f+ f+ f+ f+ f+ f+ f+ f+ f+r   