Joypad control falling back to keyboard if joypads not present

butter100fly

New member
Hi all. Emulation fan here.

I like to game on both my home pc and my laptop. Sometimes I use joypads, sometimes I use keyboard (one player). For a great many other emulators, I have setup joyTokey so that my joypad1 controls are in fact keyboard ones, but my joypad2 controls are directly my second joypad.

For emulators that totally split joystick and keyboard controls up so that you can't treat them in the same way, there is usually the option for a double-mapping, so for instance in MAME or RetroArch I can map both joypad1 left and left keyboard arrow to p1 left.

I've found OpebBOR is one of those 'emulators' where joypad and keyboard are treated separately, meaning that I can either map keyboard controls to player 1 or joypad ones but not both, and if I map keyboard ones joyTokey is unable to translate those to joypad1's controls as BOR uses lower-level input driver.  So the situation is just MAME or RetroArch. However, unlike MAME or RetroArch, there appears to be no way in OpenBOR to double map. This leaves me totally lost, as if I configure joypad 1 to be my main controller, i can't even use the OpenBOR menu with keyboard anymore, so if I don't have a joypad to hand, there's no way in or even to reset.

Is there some solultion i'm missing? If not, I'm guessing the configuration file that's holding the joypad settings is default.cfg - how do I decode it and alter it? At least if I can find this I can script something that will clunkily do what i want....

thanks in advance
 
In the main openbor.exe directory you will find: "Saves/(name of your mod).cfg" delete this file to restore the default settings.  Each mod will have it's own .cfg file based on the pak name.

On your other question I fully agree 2 people should be able to play from 1 input device but I guess that is how openbor is coded for now.  And it is not a emulator its a 2D game engine.
 
thanks, yes I found default.cfg but its not in any text encoding i can recognise - how to manually alter it? If it can't be achieved through the 2d-game-engine, if i can just have the key to reading the default.cfg, i guess i could code a loader that checks whether joystick devices are plugged in, and alters the default.cfg manually.
 
I don't think it were meant to be "decoded".
You can access the source code at the Github.

Btw, I can map different keys using the same keyboard, so each player will have different keys. I don't get the issue.
 
I noticed that p2 input device cant map to player 1 or visa versa I think this is his issue.
 
Thanks for  the response guys, sorry let me try to be clearer: When i open a .cfg file of any of my emulators, i get an ANSI text file that I can human read and alter in notepad.

With openBOR's default.cfg (in the 'saves' folder of openBOR, i'm assuming that holds the master config for the UIs control that is inhereted by every game that is subsequently loaded), I'm looking at a machine-encoded file of some nature that notepad++ can't read i.e.: its a sequence of nuls and strange characters no matter what standard encoding i try and look at the file at. This is often the case with files encoded for machines, and not usual for .cfg files. So what I want to know is: how can I alter my default config, outside of using the openBOR UI, to specify keyboard controls? I guess if that's not possible, I can just make two default.cfgs via the ui (one for keyboard and one for joypads) and write something that swaps them according to whether game controllers are plugged in to a pc

To restate my problem again: I cannot work out how player 1/the UI can be controlled by both keyboard or joypad, and player 2 can be controlled by joypad, because :
1) openBOR doesn't let you map player1 to BOTH keyboard and joypad for control, just exclusively one or the other
2) nor can I map just keyboard in openBOR and try and translate those keys to joypad movements outside of OpenBOR, because the input driver used by openBOR is too low level and doesn't allow a tool like joyTokey to translate keyboard keys into joypad movements ie: if I map keyboard in openBOR and then use joyTokey to translate that to joypad, the joypad still does not control player1
3) even if you could do the above, you can't anyway seem to configure keys for player1 and joypad for player2 in openBOR, if player1 is controlled by keys, player2 cannot then be controlled by joypad, he also has to be keys

have I made myself clear? thanks guys!
 
this sounds like it needs to be updated in the source code but it will have to be on hold until DC finishes his property project but he is working on it like a machine so it should not be long now.
 
1) openBOR doesn't let you map player1 to BOTH keyboard and joypad for control, just exclusively one or the other
I can understand if you want to map the keyboard for 2 players, but I don't see a reason for let you use both joypad and keyboard, at the same time, to control the same player.

2) nor can I map just keyboard in openBOR and try and translate those keys to joypad movements outside of OpenBOR, becuase the input driver used by openBOR is too low level and doesn't allow a tool like joy2key to translate keyboard keys into joypad movements ie: if I map keyboard in openBOR and then use joy2key to translate that to joypad, the joypad still does not control player1
I use Joy2key and I can use 1 joypad to control P1 and keyboard to control P2. Which build are you using?

3) even if you could do the above, you can't anyway seem to configure keys for player1 and joypad for player2 in openBOR, if player1 is controlled by keys, player2 cannot then be controlled by joypad, he also has to be keys
Strange, because I can do it.
 
butter100fly said:
Thanks for  the response guys, sorry let me try to be clearer: When i open a .cfg file of any of my emulators, i get an ANSI text file that I can human read and alter in notepad.

With openBOR's default.cfg (in the 'saves' folder of openBOR, i'm assuming that holds the master config for the UIs control that is inhereted by every game that is subsequently loaded), I'm looking at a machine-encoded file of some nature that notepad++ can't read i.e.: its a sequence of nuls and strange characters no matter what standard encoding i try and look at the file at. This is often the case with files encoded for machines, and not usual for .cfg files. So what I want to know is: how can I alter my default config, outside of using the openBOR UI, to specify keyboard controls? I guess if that's not possible, I can just make two default.cfgs via the ui (one for keyboard and one for joypads) and write something that swaps them according to whether game controllers are plugged in to a pc

To restate my problem again: I cannot work out how player 1/the UI can be controlled by both keyboard or joypad, and player 2 can be controlled by joypad, because :
1) openBOR doesn't let you map player1 to BOTH keyboard and joypad for control, just exclusively one or the other
2) nor can I map just keyboard in openBOR and try and translate those keys to joypad movements outside of OpenBOR, becuase the input driver used by openBOR is too low level and doesn't allow a tool like joy2key to translate keyboard keys into joypad movements ie: if I map keyboard in openBOR and then use joy2key to translate that to joypad, the joypad still does not control player1
3) even if you could do the above, you can't anyway seem to configure keys for player1 and joypad for player2 in openBOR, if player1 is controlled by keys, player2 cannot then be controlled by joypad, he also has to be keys

have I made myself clear? thanks guys!

@butter100fly What version of openbor are you used?  I used different version but all from this year and don't have any problems like the ones you comment

1) That correct, only one input for player.

2)You can used remap program, I used "antimicro" a similar program to joy2key but opensource and work great with openbor. I just checked (build 5679). Maybe the problem is joy2key, try with antimicro.
and this is the better solution for your problem.

3)  that's not true. I just checked now, player 1 with keyboard, player 2 with gamepad. work great.
But, if you reenable the gamepad () first need restart openbor. apparently if you start openbor with this option disabled does not recognize the gamepad until you restart it.

Is posible you are used and old version of openbor, try with the last version. I at least just tried the latest version and I do not have any of the problems you mention.
delete the old .cfg and try with a fresh configuration, some time, when I have changed a lot of time the config, openbor have weird issues.


PD: check the .cgf with a hex editor, I have the idea the file is not encrypted, it is only in binary.
 
Hi all

Great thanks for the help - i've narrowed down the issue based on your collective replies really appreciate that guys thanks

I found:
1) Actually i'm using joyTokey not joy2key. Easy mistake to make. I upgraded joyToKey to the latest version. No change. Sadly I have a lot invested in joyTokey, so I really do need to insist on using it over another keyboard mapper (or invest a lot of time into checking what other keyboard mapper's may have features to redo all my complex configs). joyTokey has been very good to me all these years, pity I can't even name it in forums correctly  :-[

2) Since many of you note that keymappers do work, I noted that, actually, the action buttons were remapping correctly and it was only the dpad/movement that was not mapping

3) I think the reason for some of my earlier observations was that I wasn't wiping ALL the .cfg files before trying to do mappings. renaming the save folder and starting again gave me sanity. And I found the actual problem:

3) I was using the latest version of OpenBOR, but I chased this issue back all the way to v3 build 4107 from 2015. In that version, and in all previous versions I tried, the keymapper works as I want it to, letting joyTokey map player1's keyboard buttons perfectly. By version v4111 (the next version available on GitHub) this is broken, and ever since joyTokey can't pick the arrow keys from the keyboard in openBOR (and I stress again it doesn't matter what version of joyTokey, I had a very old version and now i'm using a very new version)

I opened https://github.com/DCurrent/openbor/issues/56
 
Seems like the problem was when Openbor updated from SDL 1.2.  Try finding any other SDL 2.0 and above projects to see if they work with joyTokey if not then SDL2 is the issue.

If other joystick wrappers work with Openbor then maybe you should raise the issue with joyTokey.
 
thanks, that's a great idea!! Can anyone suggest a SDL 2.0-only emulation or other project that would make a good easy + unambiguous test for this?
 
thanks White Dragon that was quick!! I guess I wrote the title here when i suspected OpenBOR was using raw input for these (as no amount of remapping got me simultaneous joypad and keyboard). Thanks for putting this up the priority list

After discussion here, seems like a lot of others use a keymapper, indeed its a good solution if you sometimes use keyboard but use joypads when you have multiplayer situations etc.

I seem to have the additional problem (sorry!) that I have four of the same joypad (well same driver anyway). Because I keymap player 1 (so that i can control him via keyboard if I have no joypads plugged in), I need him to stay as 'player 1' but he does not....To explain: here's what always happens:

1) i can play 1 player on keyboard or Joypad in OpenBOR fine. I can play 2 player in and outside OpenBOR. Life is sweet.
2) but then.....2 friends come around and I plug in two more joypads...
3) once all 4 joypads are plugged in, "setup usb game controllers" in windows shows the joypad with the first index number is what i think is my p1 joypad is
4) my keymapper agrees and calls 'joypad 1' what I think my p1 joypad is
5) but openBOR disagrees, and says my p1 joypad is p2
6) because of that, my keymapper controls p1 with that joypad as well as the joypad controlling p2 in game, meaning two characters on screen get the same controller, and one joypad out of four controls no player. The other two characters map fine

I don't know why OPenBOR assigns different indexes to the joypads than windows and other software

Of course one 'fix' for this could be to stick to my intial plan: have a 'keyboard p1' configuration file, and a second 'joypad' configuration file, where all four players are configured to the joypads. That way, though you wouldn't be able to tell which joypad might be which player, at least all four joypads would control one player each...anyone see any way to avoid that?
 
thanks! I tested on two pcs

Without thinking about keyboard at all, with no keymapper running, and just trying to map two joypads, I cannot play with the two joypads because
* The first joypad recognised by windows comes up as joypad 3 in BOR
* The second joypad recognised by windows comes up as joypad 1 in BOR
* Even if I map these ie: have player 2's config set up as joypad 3, when I start a game joypad 1 is controlling both players and joypad 2 does nothing
* if the overlay is showing joypad numbers 1-4 in order top to bottom, its not reflecting what the ui is showing, with physical joypad 2 registering under the first controller's movements and physical  joypad 1 registering under the second controller's movements
* on one machine, joypad 1 was registering hat movements as the second controllers button movements AND the third controllers port movements

I don't know if your build addresses joint keyboard-joypad controls as it was a bit hard to check under those circumstances? One of the controllers buttons 1+3 did seem to cycle ui options without me expressly mapping that
 
Back
Top Bottom