Wanted to help (have a gioteck VX1PS3 controller), but I am receiving this
error:
(Note: using Pyglet 1.2.3 x64 version, Python 2.7, windows 8. I simply
added that print line in the function at
"C:\Python27\Lib\site-packages\pyglet\input\directinput.py", then run cmd,
typed python, then imported pyglet, and finnaly pyglet.input.get_devices()
I am too sleepy at this moment to be able to find a solution or what I did
wrong, ideas?)
>>> pyglet.input.get_devices()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python27\lib\site-packages\pyglet\__init__.py", line 357, in
__getatt
r__
__import__(import_name)
File "C:\Python27\lib\site-packages\pyglet\input\__init__.py", line 165,
in <m
odule>
from directinput import get_devices, get_joysticks
File "C:\Python27\lib\site-packages\pyglet\input\directinput.py", line 7,
in <
module>
from pyglet.input import base
ImportError: cannot import name base
>>>
terça-feira, 17 de Novembro de 2015 às 03:58:21 UTC, Benjamin Moran
escreveu:
>
> Hi guys,
>
> I'm hard at work on my SDL2-style GameController implementation for
> pyglet. If you're not familar with this, it's basically a way to
> automatically map all common game controllers to a standard internal
> layout. This means that your users controllers will just work as expected,
> out of the box.
>
> Part of this implementation requires figuring out a unique ID for each
> pyglet joystick, and checking it against a mapping database. On Linux, this
> GUID comes from the devices bustype/product/vendor/version IDs. On Windows,
> it comes from the DirectInput guidProduct string. That's where I need help.
>
> If anyone has a joystick/controller (that is not an Xbox 360 controller),
> it would help me greatly if you could substitute the function below in the
> pyglet\input\directinput.py file. (It's the same function, except with a
> print statement that prints out the device GUID details). After
> substituting the function, open up a Python interpreter and simply do:
> >>> import pyglet
> >>> pyglet.input.get_devices()
>
> Then, copy and paste the output you receive. This will allow me to confirm
> that my code is working, and I can release an actual test shortly. The
> Linux implementation is already working. I'll need OSX users to help out in
> the near future, but not quite yet.
>
> Thanks in advance!
>
> def get_devices(display=None):
> _init_directinput()
> _devices = []
>
> def _device_enum(device_instance, arg):
> device = dinput.IDirectInputDevice8()
> _i_dinput.CreateDevice(device_instance.contents.guidInstance,
> ctypes.byref(device), None)
> _devices.append(DirectInputDevice(display, device,
> device_instance.contents))
> print(device_instance.contents.tszProductName,
> device_instance.contents.guidProduct)
> return dinput.DIENUM_CONTINUE
>
> _i_dinput.EnumDevices(dinput.DI8DEVCLASS_ALL,
> dinput.LPDIENUMDEVICESCALLBACK(_device_enum),
> None, dinput.DIEDFL_ATTACHEDONLY)
> return _devices
>
>
>
>
--
You received this message because you are subscribed to the Google Groups
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.