[simpits-tech] Keyboard encoders.

Matt Bailey mattb at rtccom.net
Sun Dec 26 21:49:30 PST 2004


I did some research/brainstorming in this area recently, and after
playing with AutoHotkey a bit ( http://autohotkey.com/ ) I finally
decided keyboard inputs just weren't going to cut it. I had ordered one
of the Plasma boards from BetaInnovations anyway, and decided I'd be
much better off to just use joystick inputs, via the Plasma. You see, I
need some logic to the thing, not just sending keypresses to the sim.
With keyboards, you send events. With joysticks, you're setting a button
state. It's much easier programmatically to just scan button state, plus
you don't have to worry about keys canceling each other out (one of the
main issues with keyboard use for me.......but then I've been told other
keyboards don't have canceling issues, and also that a proper keyboard
handler can deal with any number of keys pressed simulataneously, but
I've yet to see this myself). Python is about the only programming
language I'm familiar with, so I needed a joystick API for
Python.......that's when I ran across PyGame: http://pygame.org/ It has
a very handy joystick API.

I have to admit I've not yet done much with the joystick stuff.......I
had got data extraction from X-Plane working, and made a test app in
Python that reads and prints the states of some joystick buttons, but I
then proceeded to get thoroughly side-tracked with PyGame and am now
making a full, 2D side-scrolling shooter game. :) My incomplete joystick
is now sitting in a corner of the room, and my throttle is languishing
in the basement.......and I haven't even connected the Plasma yet. The
good news here is that by the time I get back to sim interfacing, I'll
have some decent programming experience behind me instead of starting
out with little more than some LambdaMoo experience and a few simple
Python scripts.

Anyway, you might consider Python/Pygame. The main issue would be
talking to your sim. This is simple in X-Plane via UDP, and FS2004 would
probably be ok too, using FSUIPC (if you can spit data out on a network
for a Python app to grab, and can send data to the sim via the same
means).

I do have a small problem though, the Plasma doesn't really have enough
inputs (I don't have the 32 button add-on). Roy, does the KE72 have any
issues with buttons being pressed simultaneously? If this is not an
issue, then keyboard emulation via the KE72 might work for me......I
could grab keystrokes on one computer with a Python app, make decisions
there about systems states, and send the data to the X-Plane machine. Of
course it's a moot point if I can't at some point tear myself away from
the highly addictive pursuit of game programming. :)

	-Matt Bailey


More information about the Simpits-tech mailing list