First, click on the "SHIFT" event button, then click the "Add" button, then press the "B" key on your physical keyboard.
Second, click on the "A" event button, then click the "Add" button, then press the "B" key on your physical keyboard.
If you don't want to also get the "B" event when you press the "B" key: click on the "B" event button, then click the "Del" button.
The order of binding can be important for modifier events (SHIFT, CTRL, ALT), so I suggest binding to the "SHIFT" event *before* the "A" event. However, the mapper does not try to preserve the order of binding in the mapper file, so if the order is important for your game then you may need to redo the mapping each time you start DOSBox.
I don't recommend saving a mapping that uses normal typing keys like "B", because you can't type it at the command prompt without messing up what you're typing, but if you start your game with the [autoexec] section in the conf then it might not be a problem.