eschneiderSA / pyglet

Automatically exported from code.google.com/p/pyglet
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

input.get_joysticks() returns an empty list #446

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Using pyglet trunk: svn2494

The same command returns a joystick object in windows (tested joystick.py
example and it works). In linux (Ubuntu 8.10 Intrepid) returns an empty list.
Looks like it is not found in devices. But in other linux games on the same
system it works.

What steps will reproduce the problem?
Linux (not working):
>>>import pyglet
>>>pyglet.input.get_joysticks()
[]
>>>pyglet.input.get_devices()
[XInputDevice(name=Virtual core keyboard), XInputDevice(name=Virtual core
pointer), XInputDevice(name=Macintosh mouse button emulation),
XInputDevice(name=SynPS/2 Synaptics TouchPad), XInputDevice(name=AT
Translated Set 2 keyboard), XInputDevice(name=Logitech USB Gaming Mouse),
XInputDevice(name=Video Bus)]

Windows XP (it works):
>>>import pyglet
>>>pyglet.input.get_joysticks()
[<pyglet.input.base.Joystick object at 0x01C706F0>]
>>>pyglet.input.get_devices()
[DirectInputDevice(name=Mouse), DirectInputDevice(name=Keyboard),
DirectInputDevice(name=USB, 3-axis, 4-button joystick),
DirectInputDevice(name=USB Gaming Mouse), DirectInputDevice(name=USB Gaming
Mouse)]

Other: Paste in the output of tools/gl_info.py (included in source distro):
Platform instance is <pyglet.window.Platform object at 0xb7e20acc>
Display instance is <pyglet.canvas.xlib.XlibDisplay object at 0x8460fcc>
Screens:
  XlibScreen(display=<pyglet.canvas.xlib.XlibDisplay object at 0x8460fcc>,
x=0, y=0, width=1680, height=1050, xinerama=0)
Creating default context...
GL attributes:
double_buffer=1 stereo=0 buffer_size=32 aux_buffers=4 sample_buffers=0
samples=0 red_size=8 green_size=8 blue_size=8 alpha_size=0
depth_size=24 stencil_size=0 accum_red_size=16 accum_green_size=16
accum_blue_size=16 accum_alpha_size=16 major_version=None
minor_version=None forward_compatible=None debug=None
GL version: 2.1.2 NVIDIA 180.11
GL vendor: NVIDIA Corporation
GL renderer: GeForce Go 7700/PCI/SSE2
GL extensions:
  GL_ARB_texture_compression GL_NV_point_sprite
  GL_NV_fragment_program_option GL_NV_vertex_array_range2
  GL_EXT_blend_color GL_EXT_blend_subtract GL_EXT_stencil_wrap
  GL_NV_fence GL_EXT_vertex_array GL_IBM_texture_mirrored_repeat
  GL_EXT_texture_compression_s3tc GL_NV_vertex_program2_option
  GL_ARB_depth_texture GL_NV_packed_depth_stencil
  GL_EXT_direct_state_access GL_EXT_Cg_shader GL_NV_primitive_restart
  GL_EXT_texture_object GL_NVX_conditional_render
  GL_NV_texture_compression_vtc GL_NV_texture_shader3
  GL_NV_texture_shader2 GL_EXT_blend_func_separate
  GL_EXT_texture_cube_map GL_ARB_occlusion_query GL_ARB_transpose_matrix
  GL_ARB_texture_border_clamp GL_EXT_fog_coord GL_NV_depth_clamp
  GL_ARB_texture_cube_map GL_ARB_half_float_vertex
  GL_EXT_blend_equation_separate GL_NV_framebuffer_multisample_coverage
  GL_ARB_point_parameters GL_EXT_texture_env_dot3
  GL_EXT_multi_draw_arrays GL_EXT_texture_env_combine GL_NV_fog_distance
  GL_ARB_vertex_program GL_ARB_texture_env_dot3 GL_EXT_bgra
  GL_NV_float_buffer GL_NV_texture_env_combine4
  GL_ARB_vertex_array_object GL_ARB_texture_env_combine
  GL_ARB_vertex_buffer_object GL_EXT_shadow_funcs
  GL_NV_vertex_array_range GL_NV_texture_expand_normal
  GL_EXT_separate_specular_color GL_EXT_texture_env_add
  GL_EXT_packed_depth_stencil GL_EXT_texture_mirror_clamp
  GL_EXT_timer_query GL_EXT_vertex_array_bgra
  GL_NV_multisample_filter_hint GL_SUN_slice_accum GL_ARB_point_sprite
  GL_EXT_framebuffer_object GL_ARB_vertex_shader GL_ARB_half_float_pixel
  GL_KTX_buffer_region GL_NV_register_combiners GL_ARB_draw_buffers
  GL_ARB_fragment_program_shadow GL_NV_half_float GL_NV_fragment_program
  GL_ATI_texture_mirror_once GL_IBM_rasterpos_clip GL_EXT_texture_sRGB
  GL_EXT_stencil_two_side GL_SGIX_shadow GL_NV_texgen_reflection
  GL_EXT_compiled_vertex_array GL_NV_fragment_program2
  GL_EXT_point_parameters GL_ARB_texture_float GL_ARB_fragment_shader
  GL_ATI_texture_float GL_NV_texture_shader GL_NV_pixel_data_range
  GL_ARB_imaging GL_ARB_fragment_program GL_ARB_shader_objects
  GL_ARB_framebuffer_object GL_ARB_shading_language_100
  GL_NV_blend_square GL_EXT_secondary_color
  GL_ARB_texture_non_power_of_two GL_EXT_texture_lod_bias
  GL_NV_texture_rectangle GL_EXT_pixel_buffer_object GL_EXT_abgr
  GL_NV_vertex_program GL_ARB_texture_rectangle GL_ARB_multisample
  GL_SGIS_generate_mipmap GL_EXT_texture_filter_anisotropic
  GL_NV_light_max_exponent GL_EXT_blend_minmax GL_EXT_framebuffer_blit
  GL_SGIS_texture_lod GL_NV_vertex_program3 GL_NV_vertex_program2
  GL_SGIX_depth_texture GL_ARB_color_buffer_float
  GL_EXT_texture_edge_clamp GL_ARB_window_pos GL_ARB_shadow
  GL_ARB_texture_mirrored_repeat GL_EXT_gpu_program_parameters
  GL_EXT_texture_lod GL_S3_s3tc GL_NV_vertex_program1_1
  GL_EXT_framebuffer_multisample GL_EXT_texture3D GL_ARB_multitexture
  GL_NV_copy_depth_to_color GL_ATI_draw_buffers GL_EXT_depth_bounds_test
  GL_EXT_draw_range_elements GL_NV_occlusion_query
  GL_ARB_texture_env_add GL_EXT_packed_pixels GL_EXT_rescale_normal
  GL_ARB_pixel_buffer_object GL_NV_register_combiners2
GLU version: 1.3
GLU extensions:
  GLU_EXT_nurbs_tessellator GLU_EXT_object_space_tess

Context is XlibContextARB()

Any additional info (platform/language/hardware) that may be relevant?
OS: Ubuntu 8.10
Machine: Intel(R) Core(TM)2 CPU T7200 @ 2.00GHz
pyglet version: trunk svn 2494
Joystick: Genius MaxFighter F-16U, 4 button joystick with throttle.

Original issue reported on code.google.com by twoelz on 20 Aug 2009 at 5:29

GoogleCodeExporter commented 8 years ago
Is this a USB joystick? Can you post the output of lsusb please? And the dmesg 
output relating the joystick might be helpful.

Original comment by Adam.JT...@gmail.com on 18 Jul 2013 at 12:06

GoogleCodeExporter commented 8 years ago

Original comment by Adam.JT...@gmail.com on 18 Jul 2013 at 12:06

GoogleCodeExporter commented 8 years ago
Hi Adam! 
Thanks for looking into it. I reported this bug 4 years ago, I was working with 
a borrowed joystick (Genius MaxFighter F-16U, 4 button joystick with throttle). 
Yes it was USB. Worked fine on both platforms but only got recognized by pyglet 
on Windows. Right now I don't have it to test again. I returned it to the owner 
and she is far away. And I don't have any other joystick with me, but I could 
get one from a friend to test if it would help. Let me know! 

Original comment by twoelz on 18 Jul 2013 at 1:25

GoogleCodeExporter commented 8 years ago
I probably won't find the same model to test. 

Original comment by twoelz on 18 Jul 2013 at 1:41

GoogleCodeExporter commented 8 years ago
about the lsusb and dmesg (can't do those now of course) but back then I 
remember testing this to make sure it was not a driver or linux problem. But it 
wasn't. And the joystick was recognized by games and worked fine in Ubuntu. 

Original comment by twoelz on 18 Jul 2013 at 1:46

GoogleCodeExporter commented 8 years ago
Sorry it took so long, thanks for replying so quickly despite that. If you 
could test a joystick with the latest code that would be great so I can try to 
fix it or close this issue.
Cheers.

Original comment by Adam.JT...@gmail.com on 18 Jul 2013 at 11:01

GoogleCodeExporter commented 8 years ago
No worries about the delay! I'll do it when I get a hold of a USB Joystick... 

Original comment by twoelz on 18 Jul 2013 at 11:13

GoogleCodeExporter commented 8 years ago
Ok, tested both the latest trunk (rev eb6ff34e1ce8 July 17 2013) and the 
released pyglet-1.2alpha1 (tar packaged, uploaded/released by Richard Jones 
about a year ago: July 13, 2012). 

Both worked!! (joystick and all buttons) 

System info: on Ubuntu 12.10, running on a Dell Studio 17 (i7 core laptop). I 
used the "show_input.py" script in the "examples" folder and also the 
"input.py" (more verbose) script. The "joystick.py" script does nothing though. 
I don't know what that script is supposed to do, and haven't looked into it, 
but it just shows a red triangle with a tiny blue rectangle intersecting it 
below, and nothing changes when I use the joystick. Is that an old test script, 
is that broken? Anyway, seems that the important things are ok now!

Thanks you! 

Original comment by twoelz on 20 Jul 2013 at 9:56

GoogleCodeExporter commented 8 years ago
Oh, forgot to mention: tested with this joystick:
Brand: Genius
Model: MaxFire Blaze2

Original comment by twoelz on 20 Jul 2013 at 9:58

GoogleCodeExporter commented 8 years ago
It is a PS2 style with USB (and PlayStation2) connection. 

Original comment by twoelz on 20 Jul 2013 at 9:59

GoogleCodeExporter commented 8 years ago
Thanks a lot for testing that, I'll check that script and close this issue as 
fixed. Cheers.

Original comment by Adam.JT...@gmail.com on 20 Jul 2013 at 10:02