VOGONS

Common searches


First post, by HannibalAnthrope

User metadata
Rank Newbie
Rank
Newbie

I've read all the guides, looked thru the manual and searched this forum (as well as Googling the rest of the internet) - but I didn't find an answer to this. But I did feel less alone in having trouble getting a key mapping working. My question is does the keymapper work even when UseScanCodes=false? I am guessing not, but I'd like confirmation.
The issue here is that I am running Dosbox on a Raspberry Pi 3B running Stretch, from the console/cli - and I built the latest Dosbox 0.74-3 from source. It does work well with dynrec enabled, very playable. But I need to make the F2 key send out a CTRL-P (either left or right ctrl works). The keyboard is a Logitech K400R which is a small kbd/touchpad usb wireless combo, and the Fkeys require the Fn button to be used. And of course with no X11 there to manage the keyboard directly, I'm not surprised that I can't get the keys mapped.
The reason I have to set UseScanCodes=false is because when it's true the keyboard sends out incorrect characters/codes for pretty much every key on the keyboard.
I specify the keyboard layout "US" in the conf file.
Note: I AM able to invoke the keymapper with CTRL-F1 _without_ having to press the Fn button. And I have read every post about keymapping that I could, and think I comprehend. But I don't see a way to specify "send CTRL-P" when "F2 is pressed". The opposite, I think would work but haven't tested.
Is ScanCodes required then? (the map file itself seems to use the codes, and sorry if this is an obvious question, but I have no way of knowing that might be going on behind the scenes)
THANKS in advance.

Reply 1 of 4, by DosFreak

User metadata
Rank l33t++
Rank
l33t++

Do you have to use this keyboard?
If you do have to use this keyboard does the Pi have a program in the repo that can fix the issue with the keyboard not having a function lock key?
What is CTRL+P supposed to do?

How To Ask Questions The Smart Way
Make your games work offline

Reply 2 of 4, by HannibalAnthrope

User metadata
Rank Newbie
Rank
Newbie

Unfortunately I use the exact same model keyboard for all my machines except my dev workstation!
I'm not sure that the function key lock is an issue though... because I can use CTRL-F1 to bring up the keymapper, without the Fn key, just CTRL-F1 as I would on a Windows box. Which leads me to believe it's not the Fn key. I will check around for anything on the Pi that might help though. What I would like to find is a utility for the Pi and also one for Dos that I can run which will echo to me the keycode when I press a key. That way I can be sure what the keyboard is sending, and I can determine what level the problem exists. Could very well be Raspbian. I've had things work great in the GUI but not outside it and it was because the proper drivers were X-related. I don't normally touch these Pies other than ssh'ing to them, so it could be something totally unrelated to Dosbox.
CTRL+P is just a keystroke that the game I'm trying to use (Lode Runner) uses to pause the game, and I don't think it can be changed. I'm trying to coerce the F2 key to send it, however, I can certainly use a different keystroke. I have not yet had a chance to test my config with other games as I don't have any (yet) but that's next on my list. If you know of any util I might be able to use to tell me what codes are being sent please let me know.
Thanks for the reply!

Reply 3 of 4, by HannibalAnthrope

User metadata
Rank Newbie
Rank
Newbie

For anyone interested, using Dosbox on a Raspberry Pi... I believe I answered my own question and the answer is that for the keys I want to map (such that F2 sends CTRL+P) it's not possible with usescancodes=false. Unfortunately for me, on a Pi with command line, it is necessary to have it false otherwise every key sends out random junk. I wrote a little app that listens to the keyboard from a Pi command line and echos back both ascii and scan codes. I also found the same type of utility for dos and ran it under Dosbox.
I found that Fkeys don't send anything other than scan codes. HOWEVER, they DO send something. (I tested with not only the K400 kbd but also an X-Gaming Tankstick that I programmed one of the buttons to be F2)
HERE is what mystifies me.... I can use CTRL-F1 in Dosbox to bring up keymapper. HOW??? It doesn't send anything but a scan code, just like the F2 key I'm trying to use. Can anyone explain to me how Dosbox can see CTRL-F1 when scancodes=false and yet NOT the F2? Makes no sense to me.

Reply 4 of 4, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

ctrl-f1 doing something is the opposite of F2 doing CTRL-P
(2 keys doing 1 thing vs 1 key doing 2 things)
has nothing to do with scancodes=true or false.

getting two events from pressing one key is possible. but not sure if it works reliable for a ctrl/shift/alt key

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