Re: Support of Joystick/Gamepad in GTK+ 3.18

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Göran,
Thanks for the reply. I agree each input device would have their own protocol, but the corresponding driver should abstract them out and present some standard interface, right? Is there no GTK+ API for handling joysticks like in SDL? Polling for the events by reading file should work on Linux, which I intended to handle through libevdev(http://www.freedesktop.org/software/libevdev/doc/1.4.5/) but this is Linux specific as input devices will be handled differently on Windows. GTK+ has advantage of being cross-platform so I'd prefer any GTK+ API for this task. If not, should I use another cross-platform library(e.g. SDL) for the joystick handling purpose only or implement the joystick-handler for each platform separately?
Best regards,
Samik
On Saturday 16 January 2016 02:48 PM, Göran Hasse wrote:
Hello,

In theory this is simple. Every device (in unix/linux) have a file under /dev/input/...
Just open and read data from this device as from an ordinary file-descriptor.

In practice every joystick, mouse vendor have its own protocol and you must know this protocol to be able
to read and parse input. Some mouses and joysticks have in /dev/input/by-id representation.

Just create a socket (file) and add it as imput.

gdk_input_add( my_sock, GDK_INPUT_READ, GTK_SIGNAL_FUNC(file_function), &cmdinfo );

as

gdk_input_add( "/dev/input/by_id/...", GDK_INPUT_READ, GTK_SIGNAL_FUNC(file_function), &cmdinfo );

/gh

Den 2016-01-14 kl. 12:47, skrev Samik Ganguly:
Hello GTK+ developers,
     I have a few questions about GTK+ input support. I understand GTK+ is cross-platform GUI toolkit and have support for several input device like mouse, keyboard and touch. I want to know

   * does GTK+ 3.18 support Joystick functionalities like axes, haptics and multiple joysticks.
   * If not, how can I override the input subsystem of GTK+ to extract only joystick events to handle them from a different library which might have support for this?
   * does GTK+ derive input support from underlying windowing system? In that case if the underlying windowing system(such as X11) doesn't support joysticks can I still integrate it with GTK+(e.g. through evdev)?

Thank you for support,
Samik



_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-list


_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-list




[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux