Difference between revisions of "Mapper"

From DOSBoxWiki
Jump to: navigation, search
(Examples)
m (Reverted edits by Ihezosiva (Talk) to last revision by Ykhwong)
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Keymapper ==
+
== Remapping the keyboard and joystick ==
  
When you start the keymapper (either with CTRL-F1 or -startmapper as a commandline argument to the DOSBox executable) you are presented with a virtual keyboard. This virtual keyboard corresponds with the keys DOSBox will report to its applications. If you click on a key with your mouse, you can see in the lowerleft corner which key on your keyboard corresponds with it.
+
When you start the mapper (either with CTRL-F1 or -startmapper as a commandline argument to the DOSBox executable) you are presented with a virtual keyboard and a virtual joystick. These virtual devices correspond to the keys and events DOSBox will report to the DOS applications. If you click on a button with your mouse, you can see in the lower left corner with which event it is associated (EVENT) and to what events it is currently bound.
 
+
<big>
* EVENT: The key DOSBox will report to the applications being emulated.
+
Event: EVENT
* BIND: The key on your keyboard (as reported by SDL) which is connected to the EVENT.
+
BIND: BIND (the real key/button/axis you push with your finger/hand)
* mod1,2,3: Modifiers. These are keys you need to have pressed as well, while pressing BIND. mod1 = CTRL and mod2 = ALT. These are generally only used when you want to change the special keys of DOSBox.
+
* Add: Add a new BIND to this EVENT. Basicly add a key from your keyboard which will produce the key EVENT in DOSBox.
+
                                    Add  Del
* Del: Delete the BIND to this EVENT. If an EVENT has no BINDS than it's not possible to type this key in DOSBox.
+
mod1  hold                                Next
* Next: Cycle through the list of keys(BINDS) which map to this EVENT.
+
mod2
 +
mod3
 +
</big>
 +
* EVENT: The key or joystick axis/button/hat DOSBox will report to DOS applications. (the event that will happen during the game, (eg. shooting/jumping/walking)
 +
* BIND: The key on your real keyboard or the axis/button/hat on your real joystick(s) (as reported by SDL), which is connected to the EVENT.
 +
* mod1,2,3: Modifiers. These are keys you need to have to be pressed while pressing BIND. mod1 = CTRL and mod2 = ALT. These are generally only used when you want to change the special keys of DOSBox.
 +
* Add: Add a new BIND to this EVENT. Basically add a key from your keyboard or an event from the joystick (button press, axis/hat movement) which will produce the EVENT in DOSBox.
 +
* Del: Delete the BIND to this EVENT. If an EVENT has no BINDS, then it is not possible to trigger this event in DOSBox (that is there's no way to type the key or use the respective action of the joystick).
 +
* Next: Go through the list of bindings which map to this EVENT.
  
 
== Examples ==
 
== Examples ==
  
 
Q1. You want to have the X on your keyboard to type a Z in DOSBox.
 
Q1. You want to have the X on your keyboard to type a Z in DOSBox.
    A. With your mouse click on the Z on the keyboard mapper. Click "Add". Now press the X key
+
: A. Click on the Z on the keyboard mapper. Click "Add". Now press the X key on your keyboard.
    on your keyboard.
+
 
 +
Q2. If you click "Next" a couple of times, you will notice that the Z on your keyboard also produces an Z in DOSBox.
 +
: A. Therefore select the Z again, and click "Next" until you have the Z on your keyboard. Now click "Del".
 +
 
 +
Q3. If you try it out in DOSBox, you will notice that pressing X makes ZX appear.
 +
: A. The X on your keyboard is still mapped to the X as well! Click on the X in the keyboard mapper and search with "Next" until you find the mapped key X. Click "Del".
 +
 
 +
 
 +
Examples about remapping the joystick:
 +
:You have a joystick attached, it is working fine under DOSBox and you want to play some keyboard-only game with the joystick (it is assumed that the game is controlled by the arrows on the keyboard):
 +
# Start the mapper, then click on one of the left keyboard arrow. EVENT should be key_left. Now click on Add and move your joystick in the respective direction, this should add an event to the BIND.
 +
# Repeat the above for the missing three directions, additionally the buttons of the joystick can be remapped as well (fire/jump).
 +
# Click on Save, then on Exit and test it with some game.
  
Q2. If you click "Next" a few times you will notice that the Z on your keyboard also produces a Z in DOSBox.
+
You want to swap the y-axis of the joystick because some flightsim uses the up/down joystick movement in a way you don't like, and it is not configurable in the game itself:
    A. Therefore select the Z again and click "Next" till you have the Z on your keyboard. Now
+
# Start the mapper and click on Y- in the first joystick field. EVENT should be jaxis_0_1-.
    click "Del".
+
# Click on Del to remove the current binding, then click Add and move your joystick downwards. A new bind should be created.
 +
# Repeat this for Y+, save the layout and finally test it with some game.
  
Q3. If you try it out in DOSBox you will notice that pressing X makes ZX appear.
+
If you want to remap anything to your d-pad/hat you will have to change <code>joysticktype=auto</code> to <code>joysticktype=fcs</code> in configuration file. Maybe this will be improved in the next dosbox version.
    A. The X on your keyboard is still mapped to the X as well! Click on the X in the keyboard
+
    mapper and search with "Next" till you find the mapped key X. Click "Del".
+
  
 
----
 
----
  
If you change the default mapping you can save your changes by pressing "Save". DOSBox will save the mapping to location specified in the configfile (mapperfile=mapper.txt). At startup DOSBox will load your mapperfile if it's present in the configfile.
+
If you change the default mapping, you can save your changes by clicking on "Save". DOSBox will save the mapping to a location specified in the configuration file (the mapperfile= entry). At startup, DOSBox will load your mapperfile, if it is present in the DOSBox configuration file.

Latest revision as of 07:42, 15 November 2010

Remapping the keyboard and joystick

When you start the mapper (either with CTRL-F1 or -startmapper as a commandline argument to the DOSBox executable) you are presented with a virtual keyboard and a virtual joystick. These virtual devices correspond to the keys and events DOSBox will report to the DOS applications. If you click on a button with your mouse, you can see in the lower left corner with which event it is associated (EVENT) and to what events it is currently bound.

Event: EVENT
BIND: BIND (the real key/button/axis you push with your finger/hand)

                                    Add   Del
mod1  hold                                Next
mod2
mod3

  • EVENT: The key or joystick axis/button/hat DOSBox will report to DOS applications. (the event that will happen during the game, (eg. shooting/jumping/walking)
  • BIND: The key on your real keyboard or the axis/button/hat on your real joystick(s) (as reported by SDL), which is connected to the EVENT.
  • mod1,2,3: Modifiers. These are keys you need to have to be pressed while pressing BIND. mod1 = CTRL and mod2 = ALT. These are generally only used when you want to change the special keys of DOSBox.
  • Add: Add a new BIND to this EVENT. Basically add a key from your keyboard or an event from the joystick (button press, axis/hat movement) which will produce the EVENT in DOSBox.
  • Del: Delete the BIND to this EVENT. If an EVENT has no BINDS, then it is not possible to trigger this event in DOSBox (that is there's no way to type the key or use the respective action of the joystick).
  • Next: Go through the list of bindings which map to this EVENT.

Examples

Q1. You want to have the X on your keyboard to type a Z in DOSBox.

A. Click on the Z on the keyboard mapper. Click "Add". Now press the X key on your keyboard.

Q2. If you click "Next" a couple of times, you will notice that the Z on your keyboard also produces an Z in DOSBox.

A. Therefore select the Z again, and click "Next" until you have the Z on your keyboard. Now click "Del".

Q3. If you try it out in DOSBox, you will notice that pressing X makes ZX appear.

A. The X on your keyboard is still mapped to the X as well! Click on the X in the keyboard mapper and search with "Next" until you find the mapped key X. Click "Del".


Examples about remapping the joystick:

You have a joystick attached, it is working fine under DOSBox and you want to play some keyboard-only game with the joystick (it is assumed that the game is controlled by the arrows on the keyboard):
  1. Start the mapper, then click on one of the left keyboard arrow. EVENT should be key_left. Now click on Add and move your joystick in the respective direction, this should add an event to the BIND.
  2. Repeat the above for the missing three directions, additionally the buttons of the joystick can be remapped as well (fire/jump).
  3. Click on Save, then on Exit and test it with some game.

You want to swap the y-axis of the joystick because some flightsim uses the up/down joystick movement in a way you don't like, and it is not configurable in the game itself:

  1. Start the mapper and click on Y- in the first joystick field. EVENT should be jaxis_0_1-.
  2. Click on Del to remove the current binding, then click Add and move your joystick downwards. A new bind should be created.
  3. Repeat this for Y+, save the layout and finally test it with some game.

If you want to remap anything to your d-pad/hat you will have to change joysticktype=auto to joysticktype=fcs in configuration file. Maybe this will be improved in the next dosbox version.


If you change the default mapping, you can save your changes by clicking on "Save". DOSBox will save the mapping to a location specified in the configuration file (the mapperfile= entry). At startup, DOSBox will load your mapperfile, if it is present in the DOSBox configuration file.