Mapping Combined Button Presses To Different Keys In Dosbox


BadAstronaut

Still Fresh
Joined
Mar 5, 2008
Messages
73
Location
South Africa
Website
Visit site
I have made a similar post here, but thought I should ask in the help forum as well. So, if anyone knows how to map multiple button presses as a single key in DOSBox's mapper.txt, please let me know.

I am sure it must be possible, and would defintiely open up many more keys for DOSBox games.

Is there a full map of the GP2X buttons available somewhere, which tells you which button presses correspond with which key codes? I have compiled the following list myself, but surely this is incomplete?

Directional controls:
---------------------
"key 97" Up
"key 99" Left
"key 101" Down
"key 103" Right


Buttons:
--------
"key 110" B
"key 112" X
"key 109" A
"key 111" Y
"key 106" Select
"key 105" Start
"key 107" R1
"key 108" L1
"key 114" Vol-
"key 113" Vol+
 
Last edited by a moderator:
For an F200 thats all the buttons you have. If you have a F100 you could include diags and the button push.

I found this works for button combinations, heres an example. You can find it in the mapper_default file in the dosbox root dir.

[top of the file]

key_8 "key 97 mod1"
key_4 "key 99 mod1"
key_2 "key 101 mod1"
key_6 "key 103 mod1"
.
.
.
mod_1 "key 108"

[ bottom of the file]
 
Pickle said:
[top of the file]

key_8 "key 97 mod1"
key_4 "key 99 mod1"
key_2 "key 101 mod1"
key_6 "key 103 mod1"
.
.
.
mod_1 "key 108"

[ bottom of the file]



Hi, thanks for your response, but to be honest I can't tell, just from looking at that, what it is doing.

What would mod_1 be doing, and how is it triggered? Is mod 1 a combination of pressing up, down, left and right at the same time, and it then sends a different message to DOSBox (ie, you have four potential keys that can be sent to dosbox individually, but pressing all four at once sends a fifth, unique keystroke to DOSBox?

Maybe as a simple example, can you show me how I could have Vol+ do one thing, Vol- do another, and both Vol+ and Vol- pressed at the same time does something altogether different? Thanks again for your help.
 
Last edited by a moderator:
BadAstronaut said:
Pickle said:
[top of the file]

key_8 "key 97 mod1"
key_4 "key 99 mod1"
key_2 "key 101 mod1"
key_6 "key 103 mod1"
.
.
.
mod_1 "key 108"

[ bottom of the file]



Hi, thanks for your response, but to be honest I can't tell, just from looking at that, what it is doing.

What would mod_1 be doing, and how is it triggered? Is mod 1 a combination of pressing up, down, left and right at the same time, and it then sends a different message to DOSBox (ie, you have four potential keys that can be sent to dosbox individually, but pressing all four at once sends a fifth, unique keystroke to DOSBox?

Maybe as a simple example, can you show me how I could have Vol+ do one thing, Vol- do another, and both Vol+ and Vol- pressed at the same time does something altogether different? Thanks again for your help.

um, ok i thought my example was simple.

key_a "key 114"
key_b "key 113"
key_c "key 113 mod1"
mod_1 "key 114"

You might want to try key_c "key 113 key 114", im not sure it does the same thing.
 
Last edited by a moderator:
Pickle said:
um, ok i thought my example was simple.

key_a "key 114"
key_b "key 113"
key_c "key 113 mod1"
mod_1 "key 114"

You might want to try key_c "key 113 key 114", im not sure it does the same thing.
Alright thanks, I think I have figured it out now. The example was simple, sure, but without any explanation for a non-programmer such as myself, it appears as a list of words and numbers ;)

The Vol+/Vol- example, because I know what it is doing, now helps me unpack what is happening in the other example - I think that what is happening there is that if someone pushes the L1 button, it sends an instruction to DOSBox that the 8, 4, 2 and 6 keys are being pressed at the same time. Right?
 
Last edited by a moderator:
BadAstronaut said:
Pickle said:
um, ok i thought my example was simple.

key_a "key 114"
key_b "key 113"
key_c "key 113 mod1"
mod_1 "key 114"

You might want to try key_c "key 113 key 114", im not sure it does the same thing.
Alright thanks, I think I have figured it out now. The example was simple, sure, but without any explanation it appears as a daunting list of words and numbers ;)

The Vol+/Vol- example, because I know what it is doing, now helps me unpack what is happening in the other example - I think that what is happening there is that if someone pushes the L1 button, it sends an instruction to DOSBox that the 8, 4, 2 and 6 keys are being pressed at the same time. Right?

yep, i have a game that uses the number pad to move in one part and the arrow keys in another.
 
Last edited by a moderator:
Back
Top