You are not logged in.
Pages: 1
Topic closed
It is possible to emulate a joystick using the keyboard?
Offline
Sure. But to get a more complete answer, it would help to have a more complete question.
Is this in X for games/programs that run as X clients? If so, do you have an example joystick you and test with xev to see what events it generates?
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
I bought POD (an old car game) from GOG and it allows two-player playing in split screen. Unfortunately it only allows to use different controls for different players. Now I have n-key rollover keyboard and I would like to play with it.
So I was wondering if I can emulate a simple arcade-like on-off 8 directions, few buttons joystick with keyboard.
About your second question, I do have a joystick. But it manages the whole range of the directions. So I am not sure it helps as it would be different.
Offline
I still don't know if this would run in X or not - I'm not familiar with the game.
But looking into this, I see many options for using a joystick is to have the joystick generate keyboard events that are then interpreted by the game. Then your question would be irrelevant as you don't need to emulate a joystick with the keyboard as the joystick itself is emulating a keyboard.
I have a tool that simulates mouse events from the keyboard. If you can get me any information on what signals or events the game needs from the joystick, I could consider adding that as well.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Using the joystick as keyboard is fairly well supported. Even in the AUR there are at least two programs to do that: joy2key and qjoypad.
But I would need the opposite, a joystick-like device (/dev/input/js0) that sends joystick-like signals when pressing keyboard keys.
This program seems related. I compiled it (just change python to python2 in the build.sh file), but I cannot understand how it works. For starters the example.py file imports a python module module that is not there (vjoy)...
Last edited by ezzetabi (2012-12-26 13:00:14)
Offline
I understand what you are looking for, but given that many people seem to convert joystick events into keyboard events so they can be used, it seems that many games that would use a joystick actually do so through receiving keyboard events.
Your game, as I must infer the answer to my earlier question, does not use X11 event, rather it interacts with the device directly.
This would still be doable if we knew what "joystick-like signals" were. But it sounds like tracking down the vjoy python module may be the best way to go.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Sorry for missing the point. The game needs wine and X to work. What is required to make POD believe I am using a joystick instead of the keyboard depends on wine.
Offline
It is possible to emulate a joystick using the keyboard?
Just for anyone who finds this old thread looking for an answer:
wejoy (there is an AUR package of it) seems to allow this.
If this solves this question, I suggest even to prepend to the title of this thread a "[SOLVED]", for the occassional person coming by this question via search engine.
Offline
Thanks for sharing, but as it's unlikely that ezzetabi still searches for a solution here, I'll close this thread.
Closing.
Offline
Pages: 1
Topic closed