
    ^jc                        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
 d dlZd dlmZ d dlmZmZmZmZ d dlmZmZmZmZ d dlmZmZ d dlmZmZmZmZ d dlmZm Z m!Z! d d	lm"Z"m#Z#m$Z$ e j%        d
k    Z&ej'        (                    d          Z)d Z*dZ+dZ,dZ-dZ.dZ/dZ0dZ1dZ2dZ3dZ4dZ5dZ6dZ7dZ8dZ9dZ:dZ;dZ<dZ=dZ>dZ?d Z@d!ZAd"ZBd#ZCeZDe	ZEeZFeZGe&re	neZHeDe)jI        _J        eeEge)jI        _K        ee)jL        _J        ee	e	ge)jL        _K        ee)jM        _J        eeeEge)jM        _K        ee)jN        _J        eege)jN        _K        ee)jO        _J        g e)jO        _K        eDe)jP        _J        eeege)jP        _K        eDe)jQ        _J        eeEge)jQ        _K        de)jR        _J        eeege)jR        _K        de)jS        _J        eeege)jS        _K        de)jT        _J        eeege)jT        _K        eGe)jU        _J        ege)jU        _K        eHe)jV        _J        ege)jV        _K        ee)jW        _J        ege)jW        _K        ee)jX        _J        ege)jX        _K        ee)jY        _J        ege)jY        _K        ee)jZ        _J        ege)jZ        _K        ee)j[        _J        ege)j[        _K        e	e)j\        _J        ege)j\        _K        e	e)j]        _J        ege)j]        _K        e	e)j^        _J        ege)j^        _K        eFe)j_        _J        ege)j_        _K        ee)j`        _J        g e)j`        _K        e	e)ja        _J        ege)ja        _K        e	e)jb        _J        ege)jb        _K        e	e)jc        _J        ege)jc        _K        e	e)jd        _J        ege)jd        _K        ee)je        _J        ege)je        _K        ee)jf        _J        ege)jf        _K        ee)jg        _J        ege)jg        _K        ee)jh        _J        ege)jh        _K        ee)ji        _J        ege)ji        _K        ee)jj        _J        ege)jj        _K        ee)jk        _J        ege)jk        _K        ee)jl        _J        e eEge)jl        _K        ee)jm        _J        ege)jm        _K        de)jn        _J        eeege)jn        _K        de)jo        _J        eeege)jo        _K        ee)jp        _J        eeege)jp        _K        de)jq        _J        eege)jq        _K        ee)jr        _J        ege)jr        _K        ee)js        _J        ege)js        _K        ee)jt        _J        ege)jt        _K        e
e)ju        _J        ege)ju        _K        ee)jv        _J        g e)jv        _K         edeeee          Zw edeee          Zx edeeee          Zyi Zz G d$ d%          Z{ G d& d'          Z| G d( d)          Z} G d* d+e          Z~e~                    d,           e~                    d-           e|j        ee)O                                <   e}j        ee)`                                <   d.d/d0d1d1d2d2d3d4d5d6
Zi e3e5fd7e3e6fd8e3e7fd9e3e8fd:e3e9fd;e3e:fd<e3e;fd=e3e<fd>e4e>fd?e4e?fd@e4e=fdAdBdCe4e@fdDe4eAfdEe4eBfdFe4eCfdGZ G dH dIe          Z e~            Z G dJ dKe          ZdQdLZdQdMZdQdNZdO ZdQdPZdS )R    N)	CFUNCTYPEbyrefc_void_pc_intc_ubytec_boolc_uint32c_uint64)EventDispatcher)DeviceAbsoluteAxisRelativeAxisButton)Joystick
ControllerAppleRemoteControllerManager)get_mappingcreate_guid)CFSTRCFIndexCFTypeIDknown_cftypes)kCFRunLoopDefaultModeCFAllocatorRefcf)cfset_to_setcftype_to_valuecfarray_to_listl        IOKit)	framework               i  i                             @                     c                       e Zd Zd ZdS )HIDValuec                    |sJ t          j        |          t                                          k    sJ || _        t                              |          | _        t                              |          | _        | j        dk    r t          	                    |          | _
        nd | _
        t          t                              |                    }t                              |          | _        d S )Nr%   )r   CFGetTypeIDiokitIOHIDValueGetTypeID	value_refIOHIDValueGetTimeStamp	timestampIOHIDValueGetLengthlengthIOHIDValueGetIntegerValueintvaluer   IOHIDValueGetElementHIDDeviceElementget_elementelement)selfr=   element_refs      X/home/agentuser/manim-venv/lib/python3.11/site-packages/pyglet/input/macos/darwin_hid.py__init__zHIDValue.__init__   s    y~i((E,E,E,G,GGGGG"55i@@//	::;!!;;IFFDMM
 !DMu99)DDEE'33K@@    N)__name__
__module____qualname__rK    rL   rJ   r8   r8      s(        A A A A ArL   r8   c                       e Zd Zed             Zd 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S )	HIDDevicec                 d    |j         t          v rt          |j                  S t          |          }|S N)value_device_lookuprR   )cls
device_refdevices      rJ   
get_devicezHIDDevice.get_device   s2     ~--!*"233z**FMrL   c                    | t           |j        <   || _        |                     d          | _        |                     d          | _        |                     d          | _        |                     d          | _        |                     d          | _        |                     d          | _	        |                     d          | _
        |                     d          | _        |                     d	          | _        |                     d
          | _        |                     d          | _        |                                 | _        t#                      | _        |                                 | _        d S )N	TransportVendorIDVendorIDSource	ProductIDVersionNumberManufacturerProductSerialNumber
LocationIDPrimaryUsagePrimaryUsagePage)rV   rU   rX   get_property	transportvendorIDvendorIDSource	productIDversionNumbermanufacturerproductserialNumber
locationIDprimaryUsageprimaryUsagePage_get_elementselementssetvalue_observers_register_input_value_callbackvalue_callback)rH   rX   s     rJ   rK   zHIDDevice.__init__   s>   +/z'($**;77))*55"//0@AA**;77!..?? --n==((33 --n==++L99 --n== $ 1 12D E E**,,"uu"AACCrL   c           	      x    d}| j         pd}| j        pd}| j        pd}| j        pd}t	          |||||dd          S )z2Generate an SDL2 style GUID from the product guid.r$   r    )ri   rk   rl   rn   r   )rH   bustypevendorrn   versionnames         rJ   get_guidzHIDDevice.get_guid  sT    
 #!.%A$)|!r7FGWdAqIIIrL   c                     t          |          }t          t                              | j        |                    }t          j        |           t          |          S rT   )r   r   r;   IOHIDDeviceGetPropertyrX   r   	CFReleaser   )rH   r~   cfnamecfvalues       rJ   rg   zHIDDevice.get_property  sJ    t577PPQQ
Vw'''rL   Fc                 ~    |rt           }nt          }t          t                              | j        |                    S rT   )kIOHIDOptionsTypeSeizeDevicekIOHIDOptionsTypeNoneboolr;   IOHIDDeviceOpenrX   )rH   exclusive_modeoptionss      rJ   openzHIDDevice.open  s6     	,2GG+GE))$/7CCDDDrL   c                 f    t          t                              | j        t                              S rT   )r   r;   IOHIDDeviceCloserX   r   rH   s    rJ   closezHIDDevice.close  s#    E**4?<QRRSSSrL   c                     t                               | j        t          t	          j                              t                     d S rT   )r;   IOHIDDeviceScheduleWithRunLooprX   r   r   CFRunLoopGetCurrentr   r   s    rJ   schedule_with_run_loopz HIDDevice.schedule_with_run_loop  s@    ,,OR+--..!	# 	# 	# 	# 	#rL   c                     t                               | j        t          t	          j                              t                     d S rT   )r;    IOHIDDeviceUnscheduleFromRunLooprX   r   r   r   r   r   s    rJ   unschedule_from_run_loopz"HIDDevice.unschedule_from_run_loop%  s@    ..OR+--..!	# 	# 	# 	# 	#rL   c                     t          t                              | j        d d                    }|sg S t	          |          }t          j        |           |S )Nr   )r   r;   IOHIDDeviceCopyMatchingElementsrX   r   r   r   )rH   cfarrayrt   s      rJ   rs   zHIDDevice._get_elements+  sT    5@@RVXYZZ[[ 	I"7++
WrL   c                 ^    t          t                              | j        ||                    S rT   )r   r;   IOHIDDeviceConformsTorX   )rH   pageusages      rJ   conforms_tozHIDDevice.conforms_to6  s$    E//uMMNNNrL   c                 .    |                      dd          S )Nr"   r   r   s    rJ   
is_pointerzHIDDevice.is_pointer9      d+++rL   c                 .    |                      dd          S )Nr"   r#   r   r   s    rJ   is_mousezHIDDevice.is_mouse<  r   rL   c                 .    |                      dd          S )Nr"   r%   r   r   s    rJ   is_joystickzHIDDevice.is_joystick?  r   rL   c                 .    |                      dd          S )Nr"      r   r   s    rJ   
is_gamepadzHIDDevice.is_gamepadB  r   rL   c                 .    |                      dd          S )Nr"      r   r   s    rJ   is_keyboardzHIDDevice.is_keyboardE  r   rL   c                 .    |                      dd          S )Nr"      r   r   s    rJ   	is_keypadzHIDDevice.is_keypadH  r   rL   c                 .    |                      dd          S )Nr"      r   r   s    rJ   is_multi_axiszHIDDevice.is_multi_axisK  r   rL   c                     t          t          |                    }| j        D ](}t          |d          r|                    | |           )d S )Ndevice_value_changed)r8   r   rv   hasattrr   )rH   contextresultsenderrU   vxs          rJ   py_value_callbackzHIDDevice.py_value_callbackN  s[    Xe__%%% 	0 	0Aq011 0&&tQ///	0 	0rL   c                 p    t          | j                  }t                              | j        |d            |S rT   )HIDDeviceValueCallbackr   r;   %IOHIDDeviceRegisterInputValueCallbackrX   )rH   rx   s     rJ   rw   z(HIDDevice._register_input_value_callbackU  s3    /0FGG33DO^UYZZZrL   c                 :    | j                             |           d S rT   )rv   add)rH   observers     rJ   add_value_observerzHIDDevice.add_value_observerZ  s      *****rL   c                     t                      }t                              | j        |j        t          |                     |rt          |          S d S rT   )r   r;   IOHIDDeviceGetValuerX   rI   r   r8   )rH   rG   r=   s      rJ   	get_valuezHIDDevice.get_value]  sK    JJ	!!$/73FiHXHXYYY 	I&&&4rL   c                 0    | j         j         d| j         dS )Nz(name=))	__class__rM   rn   r   s    rJ   __repr__zHIDDevice.__repr__f  s     .)@@@@@@rL   N)F)rM   rN   rO   classmethodrZ   rK   r   rg   r   r   r   r   rs   r   r   r   r   r   r   r   r   r   rw   r   r   r   rP   rL   rJ   rR   rR      s         [D D D*
J 
J 
J( ( (E E E ET T T# # ## # #  O O O, , ,, , ,, , ,, , ,, , ,, , ,, , ,0 0 0  
+ + +  A A A A ArL   rR   c                   *    e Zd Zed             Zd ZdS )rE   c                      t          |          S rT   )rE   )rW   rI   s     rJ   rF   zHIDDeviceElement.get_elementl  s      ,,,rL   c                 h   || _         t                              |          | _        t                              |          | _        | j        t          k    r t                              |          | _        nd | _        t          	                    |          | _
        t                              |          | _        t          t                              |                    | _        t          t                              |                    | _        t          t                              |                    | _        t          t                              |                    | _        t          t                              |                    | _        t          t                              |                    | _        t          t                              |                    | _        t9          t                              |                    | _        t                              |          | _         t          !                    |          | _"        t          #                    |          | _$        t          %                    |          | _&        t          '                    |          | _(        t          )                    |          | _*        t          +                    |          | _,        t          -                    |          | _.        t          /                    |          | _0        d S rT   )1rI   r;   IOHIDElementGetCookiecookieIOHIDElementGetTypetypekIOHIDElementTypeCollectionIOHIDElementGetCollectionTypecollectionTypeIOHIDElementGetUsagePage	usagePageIOHIDElementGetUsager   r   IOHIDElementIsVirtual	isVirtualIOHIDElementIsRelative
isRelativeIOHIDElementIsWrapping
isWrappingIOHIDElementIsArrayisArrayIOHIDElementIsNonLinearisNonLinearIOHIDElementHasPreferredStatehasPreferredStateIOHIDElementHasNullStatehasNullStater   IOHIDElementGetNamer~   IOHIDElementGetReportIDreportIDIOHIDElementGetReportSize
reportSizeIOHIDElementGetReportCountreportCountIOHIDElementGetUnitunitIOHIDElementGetUnitExponentunitExponentIOHIDElementGetLogicalMin
logicalMinIOHIDElementGetLogicalMax
logicalMaxIOHIDElementGetPhysicalMinphysicalMinIOHIDElementGetPhysicalMaxphysicalMax)rH   rI   s     rJ   rK   zHIDDeviceElement.__init__q  s?   &11+>>--k::	9333"'"E"Ek"R"RD"&D77DD//<<
e99+FFGGu;;KHHIIu;;KHHIIE55kBBCC = =k J JKK!%e&I&I+&V&V!W!W !?!?!L!LMM#E$=$=k$J$JKK	55kBB99+FF ;;KHH--k::	!==kJJ99+FF99+FF ;;KHH ;;KHHrL   N)rM   rN   rO   r   rF   rK   rP   rL   rJ   rE   rE   j  sA        - - [-I I I I IrL   rE   c                   J    e 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 )
HIDManagerc                 (   t          t                              dt                              | _        |                                  |                                 | _        |                                 | _	        | 
                                | _        dS )z$Create an instance of an HIDManager.N)r   r;   IOHIDManagerCreater   manager_refr   _get_devicesdevices_register_matching_callbackmatching_callback_register_removal_callbackremoval_callbackr   s    rJ   rK   zHIDManager.__init__  sv    #E$<$<TCX$Y$YZZ##%%%((**!%!A!A!C!C $ ? ? A ArL   c                    	 t                               | j        d            t          t                               | j                            }t          |          }t          j        |           n#  t                      cY S xY w|S rT   )	r;   IOHIDManagerSetDeviceMatchingr   r   IOHIDManagerCopyDevicesr   r   r   ru   )rH   cfsetr   s      rJ   r   zHIDManager._get_devices  s{    		 //0@$GGGU::4;KLLMME"5))GL	55LLLs   A/A2 2Bc                 P    t                               | j        t                     d S rT   )r;   IOHIDManagerOpenr   r   r   s    rJ   r   zHIDManager.open  s"    t/1FGGGGGrL   c                 P    t                               | j        t                     d S rT   )r;   IOHIDManagerCloser   r   r   s    rJ   r   zHIDManager.close  s"     02GHHHHHrL   c                     t                               | j        t          t	          j                              t                     d S rT   )r;   IOHIDManagerScheduleWithRunLoopr   r   r   r   r   r   s    rJ   r   z!HIDManager.schedule_with_run_loop  sA    --R+--..!	# 	# 	# 	# 	#rL   c                     t                               | j        t          t	          j                              t                     d S rT   )r;   !IOHIDManagerUnscheduleFromRunLoopr   r   r   r   r   r   s    rJ   r   z#HIDManager.unschedule_from_run_loop  sA    //R+--..!	# 	# 	# 	# 	#rL   c                     t                               t          |                    }|| j        vr2| j                            |           |                     d|           d S d S N
on_connect)rR   rZ   r   r   r   dispatch_eventrH   r   r   r   rY   ds         rJ   _py_matching_callbackz HIDManager._py_matching_callback  sd      &!1!122DL  LQa00000 ! rL   c                 p    t          | j                  }t                              | j        |d            |S rT   )HIDManagerCallbackr  r;   *IOHIDManagerRegisterDeviceMatchingCallbackr   )rH   r  s     rJ   r  z&HIDManager._register_matching_callback  s6    .t/IJJ889IK\^bccc  rL   c                     t                               t          |                    }|                                 || j        v r2| j                            |           |                     d|           d S d S Non_disconnect)rR   rZ   r   r   r   remover  r  s         rJ   _py_removal_callbackzHIDManager._py_removal_callback  sq      &!1!122				L"""33333 rL   c                 p    t          | j                  }t                              | j        |d            |S rT   )r  r  r;   )IOHIDManagerRegisterDeviceRemovalCallbackr   )rH   r  s     rJ   r  z%HIDManager._register_removal_callback  s6    -d.GHH778HJZ\`aaarL   N)rM   rN   rO   rK   r   r   r   r   r   r  r  r  r  rP   rL   rJ   r   r     s        B B B  H H HI I I# # ## # #1 1 1! ! !
4 4 4         rL   r   r  r  r   yzrxryrzwheelhat)
)r"   0   )r"   1   )r"   2   )r"   3   )r#      )r"   4   )r#      )r"   5   )r"   8   )r"   9   sleepwakeupmenuselectrightleftupdown
right_hold	left_hold	menu_hold)i  #   select_holdejectmute	volume_upvolume_downc                   ^     e Zd ZdZd fd	Zd fd	Z fdZd Zd Zd	 Z	d
 Z
d Zd Z xZS )PygletDevicead  
    Represents a device in the Pyglet input system.
    
    :param display: The display the device is attached to.
    :param device: The HIDDevice object.
    :param axis_filter: A list of usage_pages to include
                        (e.g. [0x1]).
    :param button_filter: A list of usage_pages to include
                          (e.g. [0x1]).
    Nc                     t                                          ||j                   || _        | j                            |            || _        || _        |                                  d S )N)displayr~   )superrK   rn   rY   r   _axis_filter_button_filter_create_controls)rH   rG  rY   axis_filterbutton_filterr   s        rJ   rK   zPygletDevice.__init__  sg    v~>>>&&t,,,'+rL   Fc                     t                                          ||           | j                            |           |                                  d S rT   )rH  r   rY   _set_initial_control_values)rH   window	exclusiver   s      rJ   r   zPygletDevice.open  sI    VY'''###((*****rL   c                 z    t                                                       | j                                         d S rT   )rH  r   rY   )rH   r   s    rJ   r   zPygletDevice.close  s.    rL   c                 N    t          | j                                                  S rT   )list	_controlsvaluesr   s    rJ   get_controlszPygletDevice.get_controls"  s    DN))++,,,rL   c                 4    | j                                         S rT   )rY   r   r   s    rJ   r   zPygletDevice.get_guid%  s    {##%%%rL   c                 L    | j         |j        j                 }|j        |_        d S rT   )rU  rG   r   rC   rU   )rH   
hid_device	hid_valuecontrols       rJ   r   z!PygletDevice.device_value_changed(  s"    .!2!9:!*rL   c                    g }| j         j        D ],}|j        pd|j        |j        fz  }|j        t          t          fv rq| j        |j        | j        vrFt          
                    |j        |j        f          }|j        rt          ||          }n{t          ||j        |j        |          }n^|j        t           k    rM| j        |j        | j        vrt$          
                    |j        |j        f          }t'          ||          }n|j        |_        |j        |_        |                    |           .|                    d            d |D             | _        d S )Nz0x%x:%xc                     | j         S rT   )_usage)cs    rJ   <lambda>z/PygletDevice._create_controls.<locals>.<lambda>L  s    AH rL   )keyc                     i | ]
}|j         |S rP   )_cookie).0r\  s     rJ   
<dictcomp>z1PygletDevice._create_controls.<locals>.<dictcomp>M  s    KKKw'/7KKKrL   )rY   rt   r~   r   r   r   kIOHIDElementTypeInput_MisckIOHIDElementTypeInput_AxisrI  _axis_namesgetr   r   r   r   r   kIOHIDElementTypeInput_ButtonrJ  _button_namesr   r   rd  r_  appendsortrU  )rH   controlsrG   raw_namer~   r\  s         rJ   rK  zPygletDevice._create_controls-  sr   {+ 	% 	%G|UyG4Ew}3U'UH| ;=XYYY $0W5FdN_5_5_"(97='IJJ% c*4::GG*41CWEWYabbGG!>>> &2w7HPTPc7c7c$(('*;W])KLL x00%nGO$]GNOOG$$$$,,---KK(KKKrL   c                     | j         j        D ]J}|j        | j        v r:| j        |j                 }| j                             |          }|r|j        |_        Kd S rT   )rY   rt   r   rU  r   rC   rU   )rH   rG   r\  r[  s       rJ   rO  z(PygletDevice._set_initial_control_valuesO  se    {+ 	7 	7G~//.8 K11'::	 7$-$6GM	7 	7rL   c                 0    | j         j         d| j         dS )N(r   )r   rM   rY   r   s    rJ   r   zPygletDevice.__repr__X  s     .)::DK::::rL   )NN)NF)rM   rN   rO   __doc__rK   r   r   rW  r   r   rK  rO  r   __classcell__)r   s   @rJ   rE  rE    s        	 	           + + + + + +
    - - -& & &+ + +
 L  L  LD7 7 7; ; ; ; ; ; ;rL   rE  c                       e Zd ZddZd ZdS )DarwinControllerManagerNc                      i  _         t          j        D ]}t          |          x}r
| j         |<   t          j         fd            }t          j         fd            }d S )Nc                     t          |           x}r2|j        | <   t          j        j                            d|           d S d S r  )_create_controller_controllerspygletappplatform_event_loop
post_event)	hiddevice_controllerrG  rH   s     rJ   r  z4DarwinControllerManager.__init__.<locals>.on_connectj  sW    0GDDD{ [/:!),
.99$kZZZZZ[ [rL   c                     | j         v r=j         |          }j         | = t          j        j                            d|           d S d S r  )r{  r|  r}  r~  r  )r  r  rH   s     rJ   r  z7DarwinControllerManager.__init__.<locals>.on_disconnectp  sU    D---"/	:%i0
.99$Q\]]]]] .-rL   )r{  _hid_managerr   rz  event)rH   rG  rY   
controllerr  r  s   ``    rJ   rK   z DarwinControllerManager.__init__c  s    "* 	7 	7F/@@@z 7,6!&)			[ 	[ 	[ 	[ 	[ 
		[
 
		^ 	^ 	^ 	^ 
		^ 	^ 	^rL   c                 N    t          | j                                                  S rT   )rT  r{  rV  r   s    rJ   get_controllersz'DarwinControllerManager.get_controllersw  s    D%,,..///rL   rT   )rM   rN   rO   rK   r  rP   rL   rJ   rw  rw  a  s;        ^ ^ ^ ^(0 0 0 0 0rL   rw  c                 4      fdt           j        D             S )Nc                 0    g | ]}t          |          S rP   )rE  re  rY   rG  s     rJ   
<listcomp>zget_devices.<locals>.<listcomp>|  s#    MMMfL&))MMMrL   r  r   rG  s   `rJ   get_devicesr  {  s     MMMM8LMMMMrL   c                 4      fdt           j        D             S )Nc                     g | ][}|                                 s(|                                s|                                >t          t	          |                    \S rP   )r   r   r   r   rE  r  s     rJ   r  z!get_joysticks.<locals>.<listcomp>  s|     V V V!!##V'-'8'8':':V>D>R>R>T>TVH\'62233 V V VrL   r  r  s   `rJ   get_joysticksr    s8    V V V V,BV V V V VrL   c                 x    t           j        D ],}|j        dk    rt          t	          | |                    c S -d S )NzApple IR)r  r   rn   r   rE  )rG  rY   s     rJ   get_apple_remoter    sN    & > >>Z''|GV<<===== (> >rL   c                    | j         r| j                                         dvrd S |                                 s(|                                 s|                                 rtt          |                                           x}r"t          t          || ddg          |          S t          j
        d|  d|                                  d           d S d S )N)USB	BLUETOOTHzBLUETOOTH LOW ENERGYr"   r#   )rL  z	Warning: z (GUID: zG) has no controller mappings. Update the mappings in the Controller DB.)rh   upperr   r   r   r   r   r   rE  warningswarn)rY   rG  mappings      rJ   rz  rz    s    6#3#9#9#;#;?k#k#k dv0022 df6J6J6L6L d!&//"3"34447 	dl7Fc
SSSU\]]]M cf c cfoo6G6G c c c d d d d dd drL   c                 H     d  fdt           j        D             D             S )Nc                     g | ]}||S rT   rP   )re  r  s     rJ   r  z#get_controllers.<locals>.<listcomp>  s+     ' ' ': %  &%%rL   c                     g | ]N}|                                 s(|                                s|                                >t          |          OS rP   )r   r   r   rz  r  s     rJ   r  z#get_controllers.<locals>.<listcomp>  su     W W WV""$$W(.(9(9(;(;W?E?S?S?U?UW00 W W WrL   r  r  s   `rJ   r  r    sP    ' 'W W W W|?S W W W' ' ' 'rL   rT   )sysr  ctypesr   r   r   r   r   r   r	   r
   r|  pyglet.eventr   pyglet.input.baser   r   r   r   r   r   r   r   pyglet.input.controllerr   r   pyglet.libs.darwin.cocoapyr   r   r   r   r   r   r   r   r   r   maxsize__LP64__libload_libraryr;   r   r   rg  rk  rh   kIOHIDElementTypeInput_ScanCodeskIOHIDElementTypeOutputkIOHIDElementTypeFeaturer   kHIDPage_GenericDesktopkHIDPage_ConsumerkHIDUsage_GD_SystemSleepkHIDUsage_GD_SystemWakeUpkHIDUsage_GD_SystemAppMenukHIDUsage_GD_SystemMenukHIDUsage_GD_SystemMenuRightkHIDUsage_GD_SystemMenuLeftkHIDUsage_GD_SystemMenuUpkHIDUsage_GD_SystemMenuDownkHIDUsage_Csmr_MenukHIDUsage_Csmr_FastForwardkHIDUsage_Csmr_RewindkHIDUsage_Csmr_EjectkHIDUsage_Csmr_MutekHIDUsage_Csmr_VolumeIncrementkHIDUsage_Csmr_VolumeDecrementIOReturnIOOptionBitsIOHIDElementTypeIOHIDElementCollectionTypeIOHIDElementCookier   restypeargtypesr   r   r   IOHIDDeviceGetTypeIDr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   IOHIDElementGetTypeIDr   r   r   r   r   r   r   r   r   r   r   r   r  r  r!  r  r  rD   rB   r@   r>   r<   r  HIDDeviceCallbackr   rV   r8   rR   rE   r   register_event_typerZ   rF   ri  rl  rE  r  rw  r  r  r  rz  r  rP   rL   rJ   <module>r     s
   



  Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y Y  ( ( ( ( ( ( H H H H H H H H H H H H R R R R R R R R R R R R < < < < < < < < N N N N N N N N N N N N P P P P P P P P P P U U U U U U U U U U K'! 	
'22 " # #$ #$ #$ #$  #& #& #&  "& !% !% !% !% !% !% !% !% !% !% !% !% " !% !% !%   " !)7XXx !)  #+\":  &-  #(0(H'E  $08 % -2:Hl1S % .'/  $)18(<  %%-  "&(  #$,  !&.(%C  " (  "*L!9  6: + 38@(H7U + 4/3 $ ,198X0N $ -15 & .3;Xx2P & /.H # +08z # ,&8  #(0z  $*1  ',4:  (*1  ',4:  ($,  !&.Z  "+2   (-5J   )+2   (-5J   )+3   (-5J   )(0  %*2  &*2  ',4:  ($4  !&.Z  "&.  #')  $$,  !&.Z  ",4 ! ).6Z ! *%-  "'/j  #)1  &+3*  ')/  &+3*  '.4 # +08z # ,$*  !&.Z  "(.  %*2  &'-  $)1
  %&,  #(0z  $'-  $)1
  %#+   %3\$B  !(0  %*2  &;? 0 8=ExQY<Z 0 9:> / 7<DhPX;Y / 808 % -2:Hh1O % ..2 # +08(/C # ,%-  "'/j  #*1  ',4:  ($+  !&.Z  "'/  $)1
  %$,  !%'  " YtXuhII IdHeX>> "45(HMM  A A A A A A A A&CA CA CA CA CA CA CA CAL"I "I "I "I "I "I "I "IJ@  @  @  @  @  @  @  @ F   | , , , 
   / / / /8.Be((** +/?/Ke))++ ,  6778( 896 56	
 :;W 9:F 78$ 9:F 23\ -. +,k M ,-w +,f 67  67!(W; W; W; W; W;6 W; W; W;x z||0 0 0 0 0/ 0 0 04N N N NV V V V
> > > >d d d' ' ' ' ' 'rL   