Fix missing import, and add docstring template function.
@@ -133,6 +133,18 @@ if _is_pyglet_doc_run:
:rtype: list of :py:class:`Joystick`
"""
+ def get_game_controllers(display=None):
+ """Get a list of attached game controllers.
+
+ :Parameters:
+ display : `~pyglet.canvas.Display`
+ The display device to query for input devices. Ignored on Mac
+ OS X and Windows. On Linux, defaults to the default display
+ device.
+
+ :rtype: list of :py:class:`GameController`
+ """
+
def get_tablets(display=None):
"""Get a list of tablets.
@@ -158,15 +170,14 @@ else:
from pyglet import compat_platform
if compat_platform.startswith('linux'):
- from .x11_xinput import get_devices as xinput_get_devices
from .x11_xinput_tablet import get_tablets
+ from .x11_xinput import get_devices as xinput_get_devices
from .evdev import get_devices as evdev_get_devices
from .evdev import get_joysticks
from .evdev import get_game_controllers
def get_devices(display=None):
- return (evdev_get_devices(display) +
- xinput_get_devices(display))
+ return evdev_get_devices(display) + xinput_get_devices(display)
elif compat_platform in ('cygwin', 'win32'):
from .directinput import get_devices
@@ -178,4 +189,7 @@ else:
pass
elif compat_platform == 'darwin':
- from .darwin_hid import get_devices, get_joysticks, get_apple_remote
+ from .darwin_hid import get_devices
+ from .darwin_hid import get_joysticks
+ from .darwin_hid import get_apple_remote
+ from .darwin_hid import get_game_controllers
