VOGONS


First post, by cenobite666

User metadata
Rank Newbie
Rank
Newbie

I've recently ported DOSBox to Ben Nanonote (and Dingoo A320) and in doing so updated the MIPS32 dynamic recompiler to be fully compatible with non MIPS32R2 cpus.

I will submit the changes soon.

However, I have a question in regards to mapping the Ben Nanonote keystrokes to work fully with DOSBox.
I have setup my own scancodes so that default keypresses work fine as do SHIFT and CTRL keystrokes.

What is the best way to add other "shifted" keystrokes?

ie. the Ben Nanonote accesses it's numbers via a custom shift ("blue shift") combination. Likewise, other characters can only be accessed via yet another shift ("red shift") combination.

Do I need to create a custom keyboard mapping file? If so how do I do this? Are there any tutorials or documentation?

Many thanks for DOSBox - it's great software.

Reply 1 of 9, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

maybe look at the premapper of s60 port of dosbox.
there one key can change an entire mapping. Not sure if that is what you are looking for.,

Water flows down the stream
How to ask questions the smart way!

Reply 2 of 9, by cenobite666

User metadata
Rank Newbie
Rank
Newbie

I'm not even entirely sure how some keystrokes are generated with DOSBox.

For starters, I can see in the DOSBox code that there is only allowance for 3 mod keys: two already default to ALT and CTRL.
I have extended this to 6 mod keys to allow for the nanonote's other mod keys: ctrl, alt, redshift, fn and 'nanonote' key for a total for five mod keys (plus one spare).

Now my question is, how do I define an exclamation (!) character? or the at (@) symbol with DOSbox? Or a greater than (>) sign?

There doesn't seem to be a key code available for these characters.

Are these already hardcoded (in dos_keyboard_layout_data.h) to be shifted values of existing keys? ie. Exclamation is <shift><1>?

ie
On most regular keyboards, the exclamation (!) is <shift><1>.
On the nanonote it's <redshift><q>. How would i set this?

another example:
On most regular keyboards, the number 1 is just <1>
On the nanonote it's <fn><n>. Again, how would i set this?

Any help appreciated.

If you want to check out Nanonote/A320 DOSBox alpha build please visit my webpage: http://www.slaanesh.net/

EDIT: After some additional investigation I believe a new nanonote.KL file (FreeDOS keyB) file should probably do the trick. However if anyone has looked into how the .KL files work, they'll probably be left with the same degree of wonder that I am.
Does anyone know of a good working example document, other than the key.txt file that comes with the distribution?
Apparently kc.exe was used to supply DOSBox with it's own internal version of the .KL keyboard file, so I'm think *someone* here would know about it?

Reply 3 of 9, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Now my question is, how do I define an exclamation (!) character? or the at (@) symbol with DOSbox?

You don't. If a user wants to type that character at the dosbox prompt (same for a
real PC) he has to press the shift key (the BIOS denotes this with a flag), keep that key
pressed and then hit the key "2" (the BIOS translates this combination to "@").
The above is correct for US-layouted keyboards, but any TSR (like KEYB) can modify
or pre/postprocess the data.

Reply 4 of 9, by cenobite666

User metadata
Rank Newbie
Rank
Newbie

So a new keyboard layout file (.KL) should do the trick?
I need to define a layout which has 4 planes:

normal, shift, redshift, fn

Where redshift covers symbols and fn convers numbers.

Does anyone have some information on how to do this?
I've seen that this is a problem with other DOSBox ports (like S60) where non-standard keyboards are used.

Reply 5 of 9, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

So a new keyboard layout file (.KL) should do the trick?

A .KL file for KEYB? No, KEYB only works on top of a correct keyboard layouting,
if for some reason you want to directly enter an "@" you have to force the user
to the US layout (keyboardlayout=none) and send the two keypresses to dosbox.

Reply 6 of 9, by cenobite666

User metadata
Rank Newbie
Rank
Newbie

Okay, well then what does this bit of code do:

From 0.73 dos/dos_keyboard_layout.cpp:

// read in a keyboard layout from a .kl-file
Bitu read_keyboard_file(const char* keyboard_file_name, Bit32s req_cp);

I was thinking I could create a new layout file - or is this completely incorrect?
That way the layout would match the Nanonote's keyboard. Or is my thinking incorrect that the .KL files are not intended for the host's keyboard?

Reply 7 of 9, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Ignore that code. This all ONLY works on top of a correct US-style keyboard.

Reply 8 of 9, by cenobite666

User metadata
Rank Newbie
Rank
Newbie

I've updated this now to 0.74 code base and sorted out a few other problems.
Keyboard is completely working now and it works all very nicely.
Do you guys want the code for the mipsel dyna-rec? It seems to work nicely now.

Reply 9 of 9, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Keyboard is completely working now and it works all very nicely.

Cool 😀

Do you guys want the code for the mipsel dyna-rec? It seems to work nicely now.

Yes of course, feel free to post it here or send it to the dosbox dev mail address
found on the dosbox homepage.