
    ^j                       d Z ddlmZ ddlZddlmZ ddlmZmZm	Z	m
Z
mZ ddlmZmZmZmZmZ ddlmZmZmZ erdd	lmZ  eed
          oej        Zd$d%dZerd$d&dZd$d'dZd$d(dZd$d)dZnddlmZ  ej         d          rddl!mZ ddl!mZ ddl!mZ ddl!mZ ddl!mZ nMedv rddl"mZ ddl"mZ ddl"mZ ddl"mZ dd l"m#Z n*ed!k    r$ddl$mZ ddl$mZ dd"l$mZ ddl$mZ ddl$mZ ddl$mZ g d#Z%dS )*a3
  Joystick, Game Controller, Tablet and USB HID device support.

This module provides a unified interface to almost any input device, besides
the regular mouse and keyboard support provided by
:py:class:`~pyglet.window.Window`.  At the lowest
level, :py:func:`get_devices` can be used to retrieve a list of all supported
devices, including joysticks, tablets, game controllers, wheels, pedals, remote
controls, keyboards and mice.  The set of returned devices varies greatly
depending on the operating system (and, of course, what's plugged in).  

At this level pyglet does not try to interpret *what* a particular device is,
merely what controls it provides.  A :py:class:`Control` can be either a button,
whose value is either ``True`` or ``False``, or a relative or absolute-valued
axis, whose value is a float.  Sometimes the name of a control can be provided
(for example, ``x``, representing the horizontal axis of a joystick), but often
not.  In these cases the device API may still be useful -- the user will have
to be asked to press each button in turn or move each axis separately to
identify them.

Higher-level interfaces are provided for joysticks, game controllers, tablets
and the Apple remote control. These devices can usually be identified by pyglet
positively, and a base level of functionality for each one provided through a
common interface.

To use an input device:

1. Call :py:func:`get_devices`, :py:func:`get_apple_remote`,
   :py:func:`get_controllers` or :py:func:`get_joysticks` to retrieve and
   identify the device.
2. For low-level devices (retrieved by :py:func:`get_devices`), query the
   devices list of controls and determine which ones you are interested in. For
   high-level interfaces the set of controls is provided by the interface.
3. Optionally attach event handlers to controls on the device. For high-level
   interfaces, additional events are available.
4. Call :py:meth:`Device.open` to begin receiving events on the device.  You can
   begin querying the control values after this time; they will be updated
   asynchronously.
5. Call :py:meth:`Device.close` when you are finished with the device (not
   needed if your application quits at this time).

To use a tablet, follow the procedure above using :py:func:`get_tablets`, but
note that no control list is available; instead, calling :py:meth:`Tablet.open`
returns a :py:class:`TabletCanvas` onto which you should set your event
handlers.

For game controllers, the :py:class:`ControllerManager` is available. This
provides a convenient way to handle hot-plugging of controllers.

.. versionadded:: 1.2

    )annotationsN)TYPE_CHECKING   )DeviceControlRelativeAxisAbsoluteAxisControllerManager)ButtonJoystickAppleRemoteTablet
Controller)DeviceExceptionDeviceOpenExceptionDeviceExclusiveException)Displayis_pyglet_doc_rundisplayDisplay | NonereturnAppleRemote | Nonec                    dS )a   Get the Apple remote control device, if it exists.

    The Apple remote is the small white 6-button remote control that
    accompanies most recent Apple desktops and laptops.  The remote can only
    be used with Mac OS X.

    Args:
        display:
            Currently ignored.
    N r   s    P/home/agentuser/manim-venv/lib/python3.11/site-packages/pyglet/input/__init__.pyget_apple_remoter   D   s	     4    list[Device]c                    dS )zGet a list of all attached input devices.

        Args:
            display:
                The display device to query for input devices.  Ignored on Mac
                OS X and Windows.  On Linux, defaults to the default display device.
        Nr   r   s    r   get_devicesr!   S         r   list[Joystick]c                    dS )zGet a list of attached joysticks.

        Args:
            display:
                The display device to query for input devices.  Ignored on Mac
                OS X and Windows.  On Linux, defaults to the default display device.
        Nr   r   s    r   get_joysticksr%   ]   r"   r   list[Controller]c                    dS )zGet a list of attached controllers.

        Args:
            display:
                The display device to query for input devices.  Ignored on Mac
                OS X and Windows.  On Linux, defaults to the default display device.
        Nr   r   s    r   get_controllersr(   g   r"   r   list[Tablet]c                    dS )aN  Get a list of tablets.

        This function may return a valid tablet device even if one is not
        attached (for example, it is not possible on Mac OS X to determine if
        a tablet device is connected).  Despite returning a list of tablets,
        pyglet does not currently support multiple tablets, and the behaviour
        is undefined if more than one is attached.

        Args:
            display:
                The display device to query for input devices.  Ignored on Mac
                OS X and Windows.  On Linux, defaults to the default display device.
        Nr   r   s    r   get_tabletsr+   p   r"   r   )compat_platformlinux)r!   )r%   )r(   )r+   )r
   )cygwinwin32)Win32ControllerManagerdarwin)r   )r!   r%   r(   r+   r   r
   r   r   r   r	   r   r   r   r   r   r   r   r   )N)r   r   r   r   )r   r   r   r   )r   r   r   r#   )r   r   r   r&   )r   r   r   r)   )&__doc__
__future__r   systypingr   baser   r   r   r	   r
   r   r   r   r   r   r   r   r   pyglet.displayr   hasattrr   _is_pyglet_doc_runr   r!   r%   r(   r+   pygletr,   
startswithr-   r/   r0   macos__all__r   r   r   <module>r>      s  2 2f # " " " " " 



             P P P P P P P P P P P P P P C C C C C C C C C C C C C C P P P P P P P P P P '&&&&&&WS"566P3;P       E-                 " '&&&&&!!'** -&&&&&&((((((******&&&&&&,,,,,,,	/	/	/&&&&&&((((((******&&&&&&FFFFFFF	H	$	$&&&&&&((((((++++++******&&&&&&,,,,,,  r   