Accessing data from HID compliant USB device

David Glasgow david at dvglasgow.wanadoo.co.uk
Sun May 9 05:02:19 EDT 2010


On 8 May 2010, at 2:38 pm, Sarah Reichelt wrote:

> Subject: Re: Accessing data from HID compliant USB device
> Reply-To: How to use Revolution <use-revolution at lists.runrev.com>
> 
> 
>> This one has been churning around in my head for ages, and I finally bought a couple of joysticks to experiment with.
>> 
>> I want to build a standalone that responds to joystick input.  Nothing requiring huge amounts of data or processing, just detection of joystick position -> onscreen response scaling or moving an image.
>> 
>> I can understand the basic principles of HID, but can't get to grips with where the data goes in either Mac or Windows, and what would be involved in capturing it in Rev.  I have found some developer articles which address this, but they relate to other languages (VB & RB, I think).
> 
> 
> Does the joystick produce keyDown/Up or rawKeyDown/Up messages? If so,
> you could map out the numbers that each motion triggers and have your
> app react accordingly.
> There is a utility on my web site that detects keystrokes and displays
> the various codes for them.
> <http://www.troz.net/rev/stacks/KeyCoder.rev>
> 
> Cheers,
> Sarah

Thanks Sarah,

I wrote a wee stack to look at keystrokes (not as nice as yours), but it seems that HID compliant devices work in a much more complex way than simply generating characters.  Except of course the keyboard/mouse family, which do nothing but generate characters.  I even bought a repro-retro amiga joystick in the hope that it worked the old fashioned way, but it doesn't.  I really want the mechanical element of pushing and pulling to be present, otherwise I would use a mouse or a keyboard.   

There are utilities out there which enable HID devices to be configured to generate keystrokes, so they can be used by folks with a disability to use whatever software they need to use, rather than the intended games.  However, that would mean running a third party utility then running my stack.  Not a nice option.

There are some assistive devices that seem to generate keystrokes, but they are shockingly expensive. Makes you realise there is a real disability tax when it comes to using computers. I also had expected a few Revvers to have written standalone games that use joysticks, but maybe that domain is restricted to the die-hard X-planers and shoot em ups.

David Glasgow



More information about the Use-livecode mailing list