
    i                     L   d Z ddlZddlmZmZ  ee      Zej                  Zej                  Zej                  Zej                  Z	[ej                  ej                  j                  ffej                  ej                  j                  ej                  j                  ej                  j                  ffej                  ej                  j                  ej                   j                  ej"                  j                  ffej$                  ej$                  j                  ej&                  j                  ej(                  j                  ffej*                  ej*                  j                  ej,                  j                  ej.                  j                  fffZeD  ci c]-  }  e ej4                  | d   f      | d         D ]  \  }}||
 / c}}} Zej8                  ej8                  ej:                  dZ G d de      Z G d d	e      Z  G d
 de	      Z!yc c}}} w )zV
The module containing keyboard classes.

See the documentation for more information.
    N)backendEvents   )
	c                   z     e Zd ZdZeZ G d dej                        Z G d dej                        Z	 fdZ
 xZS )r   zA keyboard event listener supporting synchronous iteration over the
    events.

    Possible events are:

    :class:`Events.Press`
        A key was pressed.

    :class:`Events.Release`
        A key was released.
    c                       e Zd ZdZd Zy)Events.PresszA key press event.
        c                      || _         || _        y Nkeyinjectedselfr   r   s      b/home/obispo/Crisostomo_bridge/mision_env/lib/python3.12/site-packages/pynput/keyboard/__init__.py__init__zEvents.Press.__init__R       DH %DM    N__name__
__module____qualname____doc__r    r   r   Pressr   O       		%r   r   c                       e Zd ZdZd Zy)Events.ReleasezA key release event.
        c                      || _         || _        y r   r   r   s      r   r   zEvents.Release.__init__\   r   r   Nr   r   r   r   Releaser    Y   r   r   r"   c                 X    t         t        |   | j                  | j                         y N)on_press
on_release)superr   r   r   r"   )r   	__class__s    r   r   zEvents.__init__c   s%    fd$ZZ|| 	% 	%r   )r   r   r   r   Listener	_Listenerr   Eventr   r"   r   __classcell__r(   s   @r   r   r   A   s9    
 I% %%&,, %% %r   r   c                   2    e Zd ZdZd Zed        Zd Zd Zy)HotKeya  A combination of keys acting as a hotkey.

    This class acts as a container of hotkey state for a keyboard listener.

    :param set keys: The collection of keys that must be pressed for this
        hotkey to activate. Please note that a common limitation of the
        hardware is that at most three simultaneously pressed keys are
        supported, so using more keys may not work.

    :param callable on_activate: The activation callback.
    c                 P    t               | _        t        |      | _        || _        y r   )set_state_keys_on_activate)r   keyson_activates      r   r   zHotKey.__init__u   s    eY
'r   c                       fd}d }t         |             }|D cg c]
  } ||       }}t        |      t        t        |            k7  rt               |S c c}w )a  Parses a key combination string.

        Key combination strings are sequences of key identifiers separated by
        ``'+'``. Key identifiers are either single characters representing a
        keyboard key, such as ``'a'``, or special key names identified by names
        enclosed by brackets, such as ``'<ctrl>'``.

        Keyboard keys are case-insensitive.

        :raises ValueError: if a part of the keys string is invalid, or if it
            contains multiple equal parts
        c               3      K   d} t              D ]  \  }}|dk(  s|| k7  s| |  |dz   }  | t              k(  rt              | d   y w)Nr   +r   )	enumeratelen
ValueError)starticr5   s      r   partszHotKey.parse.<locals>.parts   sj     E!$ "18U
uQ-'EE" D	! &&56l"s   AA/Ac                    t        |       dk(  r#t        j                  | j                               S t        |       dkD  rk| d   | d   fdk(  r^| dd }	 t        |j                            }|t
        j                         v r|S t        j                  |j                  j                        S t        |       # t        $ r: 	 t        j                  t        |            cY S # t        $ r t        |       w xY ww xY w)Nr      r   )<>)r;   KeyCode	from_charlowerKey_NORMAL_MODIFIERSvaluesfrom_vkvaluevkKeyErrorintr<   )spr   s      r   parsezHotKey.parse.<locals>.parse   s    1v{((33Q!1qu ;aG, aggi.C/6688"
&syy||<< !m#   ,,&s1v66% ,(m+,,s*   .B6 (B6 6	C9 C C9 C55C9)listr;   r1   r<   )r5   r@   rS   	raw_partsrQ   parsed_partss   `     r   rS   zHotKey.parsez   sl    		#	$, M	   !H   
 |C$5 66T"" s   Ac                     || j                   v rU|| j                  vrF| j                  j                  |       | j                  | j                   k(  r| j                          yyyy)aQ  Updates the hotkey state for a pressed key.

        If the key is not currently pressed, but is the last key for the full
        combination, the activation callback will be invoked.

        Please note that the callback will only be invoked once.

        :param key: The key being pressed.
        :type key: Key or KeyCode
        N)r3   r2   addr4   r   r   s     r   presszHotKey.press   sT     $**DKK!7KKOOC {{djj(!!# ) "8r   c                 X    || j                   v r| j                   j                  |       yy)zUpdates the hotkey state for a released key.

        :param key: The key being released.
        :type key: Key or KeyCode
        N)r2   removerY   s     r   releasezHotKey.release   s'     $++KKs# r   N)	r   r   r   r   r   staticmethodrS   rZ   r]   r   r   r   r/   r/   i   s+    
(
 7  7 r$ $r   r/   c                   .     e Zd ZdZ fdZd Zd Z xZS )GlobalHotKeysa_  A keyboard listener supporting a number of global hotkeys.

    This is a convenience wrapper to simplify registering a number of global
    hotkeys.

    :param dict hotkeys: A mapping from hotkey description to hotkey action.
        Keys are strings passed to :meth:`HotKey.parse`.

    :raises ValueError: if any hotkey description is invalid
    c           	          |j                         D cg c]$  \  }}t        t        j                  |      |      & c}}| _        t	        t
        |   || j                  | j                  d| y c c}}w r$   )	itemsr/   rS   _hotkeysr'   r`   r   	_on_press_on_release)r   hotkeysargskwargsr   rM   r(   s         r   r   zGlobalHotKeys.__init__   sp     &mmo/U 6<<$e,/ 	mT+  ^^''	 		/s   )A2c                 l    |s2| j                   D ]"  }|j                  | j                  |             $ yy)zThe press callback.

        This is automatically registered upon creation.

        :param key: The key provided by the base class.
        :param injected: Whether the event was injected.
        N)rc   rZ   	canonicalr   r   r   hotkeys       r   rd   zGlobalHotKeys._on_press   s4     -- 2T^^C012 r   c                 l    |s2| j                   D ]"  }|j                  | j                  |             $ yy)zThe release callback.

        This is automatically registered upon creation.

        :param key: The key provided by the base class.
        :param injected: Whether the event was injected.
        N)rc   r]   rj   rk   s       r   re   zGlobalHotKeys._on_release   s4     -- 4t~~c234 r   )r   r   r   r   r   rd   re   r,   r-   s   @r   r`   r`      s    	
2
4r   r`   )"r   	itertoolspynput._utilr   r   r   rF   rI   
Controllerr)   alt_grrM   altalt_lalt_rcmdcmd_lcmd_rctrlctrl_lctrl_rshiftshift_lshift_r_MODIFIER_KEYSzipcyclerJ   entertab_CONTROL_CODESobjectr/   r`   )combinationr   rM   s   000r   <module>r      s  "  ( (

//kk
 	ZZ#**""$%WW#''--399??ciiooFGWW#''--399??ciiooFGXX#((..3::#3#3cjj6F6FGHYY#))//3;;#4#4ckk6G6GHIK & 	Q)*A 	U 
3J	  ))
))
''%%V %%Pb$V b$J+4H +4ys   "2H