Adding Multiple Mice Support to FLTK using MPX

Posted by Benjamin Close on November 25, 2008 under OpenSource, UniSA | Be the First to Comment

For a while now I’ve been working on modifying FLTK to support multiple Mice. We need this functionality for applications we are working on. FLTK was chosen for a number of reasons. 

  1. It’s light weight
  2. It’s cross platform
  3. It was already in use by the applications being extended.
However, FLTK didn’t support multiple mice out the box. Multiple Mice support exists both under Win32 via the RAWINPUT api and under Xorg via MPX.
Though support in the various toolkits is still lacking. Not surprizing considering how recent MPX/RAWINPUT is.

Read more of this article »

jhbuild just won’t build! (aka Include path madness)

Posted by Benjamin Close on November 18, 2008 under FreeDesktop, OpenSource, Programming, UniSA | Read the First Comment

I’ve been recently trying to work out why jhbuild fails to build xorg on my FreeBSD box. Traditionally I compile to /usr/local/ however after wanting to experiment with MPX I’ve set things up so that I compile to /usr/local/MPX

Sadly this kept breaking in xorg/lib/libX11 with the error:

Read more of this article »

Defining a #defining for use in C/C++ code in autotools

Posted by Benjamin Close on October 8, 2008 under UniSA | Be the First to Comment

In configure.ac

 AC_DEFINE([MYDEFINE],[SOMEVALUE],[Description: Make #define MYDEFINE SOMEVALUE])

in config.h.in

 #undef MYDEFINE

Resetting the USB Bus under linux

Posted by Benjamin Close on September 15, 2008 under UniSA | Be the First to Comment

Today Snappy, the little photo box we have taking photos of the new Bruce Lab, broke again. Hence I quickly came up with a way of resetting the USB device under linux based on libusb. Sadly whilst I can confirm this does reset the device gphoto2 still doesn’t like our little Canon Ixus 400 and we still get timeouts after about 12 hours of taking photos - 1 photo every 2 minutes. Below is the hack of a program I used.

To compile use: gcc -o outputname resetusb.c -lusb

#include
#include 

int main(void)
{
      struct usb_bus *busses;
      usb_init();
      usb_find_busses();
      usb_find_devices();
      busses = usb_get_busses();
      struct usb_bus *bus;
      int c, i, a;
      /* ... */
      for (bus = busses; bus; bus = bus->next) {
        struct usb_device *dev;
        int val;
        usb_dev_handle *junk;
        for (dev = bus->devices; dev; dev = dev->next) {
          char buf[1024];
          junk = usb_open ( dev );
          usb_get_string_simple(junk,2,buf,1023);
          if ( junk == NULL ){
            printf("Can't open %p (%s)\n", dev, buf );
          } else {
            val = usb_reset(junk);
            printf( "reset %p %d (%s)\n", dev, val, buf );
          }
          usb_close(junk);
        }
      }
}