Thanks Paulo,

but it doesn't seem like the print statements were in there the second 
time... No worries though. 
Basically I just need to ProductGUID from somewhere. On Windows 7 this can 
be found in the controller driver details window. I'm not sure where that 
is now on Windows 8.1, unfortunately.

If you want, I could put a little standalone zip file with pyglet and a few 
line script that prints these details out. 

Thanks, 
-Ben



On Wednesday, November 18, 2015 at 8:47:04 AM UTC+9, Paulo Martins wrote:
>
> Oh, forget it, did it again but this time not using cmd in admin mode and 
> it worked (no idea why admin mode gave error), this is the output:
>
> [DirectInputDevice(name=Rato), DirectInputDevice(name=Teclado), 
> DirectInputDevic
> e(name=Trust Keyboard), DirectInputDevice(name=Trust Keyboard), 
> DirectInputDevic
> e(name=Gioteck PS3 Wired Controller)]
>
> Good work, regards
>
> terça-feira, 17 de Novembro de 2015 às 23:43:12 UTC, Paulo Martins 
> escreveu:
>>
>> 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.

Reply via email to