FreeTrack Forum

Welcome, you're not connected. ( Log in - Register )

RSS >  Mapping head "arcs" to keys
tunabreath #1 07/07/2008 - 22h16

Class : Apprenti
Posts : 3
Registered on : 07/07/2008

Off line

Hello everybody!

First off, I'd like to thank the people developing this excellent system.  It works wonderfully, and on a shoestring budget no less.

I've been poking around the possible mappings, but they seem to all be restricted to two keys (or joystick buttons or axis) per head axis.  I'm wondering if it's possible to map more than two keys to a single head axis, specifically for use with older games which don't have smooth slewing views, but rather snap to directional views.

For example, Allegiance: it currently lacks any pitch-oriented views, but all the yaw ones are there.  It's designed to be mapped to an 8 position hat switch, so there are 7 available entries: look forward left, look left, look backward left, look forward right, look right, look backward right, and look backward.  The problem with using these with head-tracking is that they're all along a single head axis (yaw) which will only provide two mappings (yaw left, yaw right).

Now, I'm wondering if it's possible to have Free-track map an arc of yaw movement to each of the yaw look functions.  Eg, have head 5-15 degrees left mapped to look forward left, 16-25 degrees left mapped to look left, 26-35 degrees left mapped to look backward left, etc, etc, etc.
Is this possible?

Any response is appreciated.
Deimos #2 08/07/2008 - 19h53

Class : Beta Tester
Posts : 120
Registered on : 07/11/2007

Off line

You can't do that in FT directly, but look up software called "GlovePie" - it's a kind of scripting language oriented at reading and emulating various input devices, and doing some calculations on them inbetween.
With it you can easily map more than one key to an axis, for example with something like:

if(TrackIR.yaw>10 && TrackIR.yaw<30)
   Key.nine=True
else
   Key.nine=false
end if

if(TrackIR.yaw>=30 && TrackIR.yaw<70)
   Key.six=True
else
   Key.six=false
end if

...

So if the yaw value is between 10 and 30, the '9' key will be emulated as pressed, else the key will be emulated as released, etc.
I wrote it out of memory so i'm not sure if this code works, but it should.
Edited by Deimos on 08/07/2008 at 19h55.
tunabreath #3 11/07/2008 - 18h24

Class : Apprenti
Posts : 3
Registered on : 07/07/2008

Off line

Aha,  thank you.  I'll check that out.

 >  Fast reply

Message

 >  Stats

1 user(s) connected during the last 10 minutes (0 member(s) and 1 guest(s)).