Some notes on testing Holoseat as joystick in place of keyboard

Added by J. Simmons almost 5 years ago

This week, Bryan found a link to a hack to add support to a Leonardo for joystick emulation (see Resources). This is one half of the capability I have wanted from day one (that is to connect the Holoseat between a PC and a joystick and trap signals for walking, etc, and pass through everything else so users don't have to do anything special to use Holoseat). The other half is the ability to read signals from a controller and react to them, well I found a USB host shield that does just that (also listed on Resources).

So, after we work out the Hall effect sensor, I want to add a new task to v0.3, namely investigating joystick emulation/integration. Here are a couple of notes on what I think we will need to conduct this research.

  • new Leonardo (if we are going to hack on the underlying Arduino code at all, I want a clean board that I can muck with and not worry about bricking current development work)
  • new proto shield with latest Holoseat design implemented on it
  • USB host shield
  • XBOX controller (I already have one)
  • updates to the desktop app to report debug messages from holoseat and show joystick signals from holoseat's emulation of joystick(?)

Do we need anything else?


Replies (5)

RE: Some notes on testing Holoseat as joystick in place of keyboard - Added by Bryan Christian almost 5 years ago

Seems like this should work. I'm interested in testing this too. I'm thinking this likely should wait on the hall effect sensors unless we want to try to do parallel efforts and then merge the code. Right now there's no real way to simulate a full axis of the controller so instead of replacing an axis entirely we would instead be replacing half of an axis which is going to be different code. I'm willing to give it a shot though. Could be fun to see if I could get this to work and would go a long way towards the joypad bit.

RE: Some notes on testing Holoseat as joystick in place of keyboard - Added by J. Simmons almost 5 years ago

I just thought of something else we could do with full joystick emulation... Keyboard mappings without software in the loop. When I play games like SWTOR that do not support joysticks, I use Joy2key to map the remainder of my joystick (I skip mapping 'w' of course) to key board controls. It is an extra layer of software and one that can be temperamental at times. If we supported mapping joystick inputs to joystick or keyboard outputs, then we would really have a reason to know what games the user was playing and we could open up a range of games that right now take a bit of hacking to get working (especially if we have an easy way for users to share mappings).

It would definitely be more complicated, but I think it could be a very useful feature that we would ship in entirely in firmware/software upgrades.

RE: Some notes on testing Holoseat as joystick in place of keyboard - Added by Bryan Christian almost 5 years ago

Great idea. Basically just need a file that defines buttons. I'm thinking something as simple as an INI file where you indicate the executable to look for and the button/keyboard mapping itself. Just need to setup a function to load the config over serial.

Only two possible issues I'm seeing here:
Do we handle diagonals? If so, how far do we go there?
If the holoseat is Y1 and the controller is providing X1, do we combine the two to hit the diagonal?

Other than that, sound idea. Makes us a hardware keyboard converter for a joypad which probably would work better in many instances.

Additional thought: What about the idea of changing from an on/off switch to a joypad/keyboard/off switch? Can do it by game, but thinking that could also be useful.

RE: Some notes on testing Holoseat as joystick in place of keyboard - Added by J. Simmons almost 5 years ago

Good questions.

Not sure about the diagonal yet, but my first instinct is to pass both signals if it would make sense in most games (and possibly have an option to control which way it works now that I think of it).

I was thinking of the keyboard/joypad emulation being a software setting and probably controllable by game with an option for global default. That was we can have many keyboard mappings that are easy to switch out.

RE: Some notes on testing Holoseat as joystick in place of keyboard - Added by J. Simmons almost 5 years ago

Rough BoM for v0.3 joystick build test hardware

Part # Description Vendor (linked) Unit Cost ($) Qty Total Cost ($)
TR 12 Arduino Leonardo Amazon 24.99 1 24.99
TR 13 Arduino Prototype Shield Amazon 14.95 1 14.95
TR 14 USB Host Shield Amazon 49.95 1 49.95
-- Misc Hardware -- 15.00 1 15.00
Total 104.89

(1-5/5)