Some keyboards (of the newer variety) as well as nearly ALL laptop keyboards have different keycodes than older qwerty keyboards. I have noticed myself that many programs on dosbox can have issues if it asks for a specific shift or Ctrl key (left or right), as well as the ~ key. There is a way to fix this in Dosbox, but for the life of me I cannot remember the setting.
Instead of digging through the manual, which will read like stereo instructions (such an outdated notion now, eh?) if you are like me, simply do a search on google. (that’s how I found the answer)
I believe that my question was “getting ~ to work in dosbox”, or “~ wont work in dosbox”, possibly even “how to use ~ in dosbox” you can also type “tilde” instead of ~.
This is how I found the answer (within just a minute or two). It has to do with how DosBox lists your keyboard. There are many types of keyboards, most for different languages, but there are a few english ones, and you will need to switch to one of those. (I am on a laptop and I assure you, this fixed all of my keys.)
I apologize for the long post. I am going to add section 7 of the Dosbox manual here, since it contains the information you are seeking. I will attempt to use the “spoiler Code” to cut down on the size of this post. If it works (I have never posted here, and I don’t know if the BBCode works, nor do I know if I will be able to edit it afterwards…) then you will see the Chapter Title. Click on it to expand it so that you can see the information in it. If the spoiler code does not work, you will just see the whole thing with a BBCode tag around the heading.
===================
[spoiler=8. Keyboard Layout:]
===================
To switch to a different keyboard layout, either the entry “keyboardlayout” in the [dos] section of the DOSBox configuration file can be used, or the internal DOSBox program keyb.com (Section 4: Internal Programs) Both accept DOS conforming language codes (see below), but only by using keyb.com a custom codepage can be specified.
The default keyboardlayout=auto currently works under windows only. The language is chosen according to the OS language, but the keyboard layout is not detected.
Layout switching
DOSBox supports a number of keyboard layouts and codepages by default, in this case just the layout identifier needs to be specified (like keyboardlayout=PL214 in the DOSBox configuration file, or using “keyb PL214″ at the DOSBox command prompt). The list of all layouts built into DOSBox is here: http://vogons.zetafleet.com/viewtopic.php?t=21824
Some keyboard layouts (for example layout GK319 codepage 869 and layout RU441 codepage 808) have support for dual layouts that can be accessed by pressing LeftALT+RrightSHIFT for one layout and LeftALT+LeftSHIFT for the other. Some keyboard layouts (for example layout LT456 codepage 771) have support for three layouts, third can be accessed by pressing LeftALT+LeftCTRL
Supported external files
The FreeDOS .kl files are supported (FreeDOS keyb2 keyboard layoutfiles) as well as the FreeDOS keyboard.sys/keybrd2.sys/keybrd3.sys libraries which consist of all available .kl files. See http://www.freedos.org/ for precompiled keyboard layouts if the DOSBox-integrated layouts don’t work for some reason, or if updated or new layouts become available.
Both .CPI (MS-DOS and compatible codepage files) and .CPX (FreeDOS UPX-compressed codepage files) can be used. Some codepages are compiled into DOSBox, so it is mostly not needed to care about external codepage files. If you need a different (or custom) codepage file, copy it into the directory of the DOSBox so it is accessible for DOSBox. If you place all ten ega.cpx files (from FreeDOS) in DOSBox folder, an appropriate codepagefile for the requested layout/codepage is chosen automatically.
Additional layouts can be added by copying the corresponding .kl file into the directory of the DOSBox configuration file and using the first part of the filename as language code.
Example: For the file UZ.KL (keyboard layout for Uzbekistan) specify “keyboardlayout=uz” in the DOSBox configuration file.
The integration of keyboard layout packages (like keybrd2.sys) works similar.
Note that the keyboard layout allows foreign characters to be entered, but there is NO support for them in filenames. Try to avoid them both inside DOSBox as well as in files on your host operating system that are accessible by DOSBox.[/spoiler]
Well, whether that worked or not, I just wanted to add that you will have a much easier time getting this setting fixed if you use a front-end for dosbox. (Ignore this if you know what a front-end is.**A Front-End is a “shell” program that lets you interface with another program in a usually more efficient way.**)
The front-end I use is D-Fend Reloaded. It has a drop down menu in its game properties tab which you can use to select your keyboard. (And it’s extremely helpful in every other way. You can set it up for each game, to add cheats, manuals and hintbooks, extra game files, every setting in dosbox can be set for each game, and will be saved and remembered so all you have to do is click the game in the list to start playing.)
P.S. : It’s not just newer keyboards that seem to have the problem, it is also HP(Hewlett Packard) keyboards that seem to use a different layout than the one recognized by dos. The right setting will restore your non-functional keys. However, if this still does not work for you, then there is one SURE-FIRE method of fixing the problem, but as the saying goes, “It’s like going around your arse to get to your elbow.” Basically you can use a keymapping program to give your non working keys a different keybinding, which will then be recognized by Dosbox, but that ONLY works if you are needing the key for a control in a game. It still will not work for typing in commands, because you are basically changing the key (for example, Left Shift) to something else that Dosbox will recognize with your current keyboard layout. (like NUMPAD 5, from the extra number keys on the right of most full sized keyboards)
That causes the dosbox program to recognize the NUMPAD 5 key every time the Left Shift key is pressed. This can cause issues later on as that key might do something else, and really, the most simple way (don’t be intimidated!) is to change the layout of your keyboard as described above in section eight of the DosBox manual. If you cannot determine what layout you need, then trial and error will show you the way in less than 3 minutes. Just try one setting, go into the DosBox prompt, see if you can type those keys.
If you cannot, then exit DosBox, select another setting, preferably the next down the list just to be sure you don’t miss one, (only the english ones!) and then repeat the process. It really shouldn’t take that long.
I fixed my problem in this way, no problem. I hope it helps, and if all else fails, just do a search for the right setting, maybe add your model of keyboard/laptop to the search string, and you should find what you seek.
Good luck, and Happy Gaming!!!
-Volyren Nightsong (Volyren…….(a)………gmail…………com)
[just replace the (a) with @ and remove the extra dots.....obscure your email addy like this to avoid getting tons of spam. This way the spambots that search everything for email addresses won't recognize it as a valid target]