LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-23-2014, 11:00 PM   #1
Digger1
LQ Newbie
 
Registered: Sep 2011
Location: Colorado Springs, CO
Distribution: Debian Squeeze
Posts: 24

Rep: Reputation: 0
Problem With Remapped Keyboard Keys When Using DOSEMU


Hello all.

Using an eee PC 901. I remapped some of the keys on the bottom right corner of the keyboard to make the keyboard easier to use. The changes I made essentially swaps the "Right Shift" and "Up" keys, and swaps the "Up" and "Down" keys. Of course, other steps needed to be taken, since the keys in question serve multiple functions.

The script that does the remapping is called when the "/etc/X11/Xsession" script is run during startup. Here is a look at the remapping script that is so called:

Code:
#!/bin/bash

 xmodmap -e "remove control = Control_R"
 xmodmap -e "keycode 62 = Up"
 xmodmap -e "keycode 105 = Prior"
 xmodmap -e "keycode 111 = Shift_R"
 xmodmap -e "keycode 112 = Shift_R"
 xmodmap -e "keycode 116 = Right"
 xmodmap -e "keycode 117 = End"
 xmodmap -e "keycode 114 = Down"
 xmodmap -e "keycode 115 = Next"
 xmodmap -e "add shift = Shift_R"
 xmodmap -e "remove shift = Up"
 xset r 62
 xset r 105
 xset -r 111
 xset -r 112
The problem occurs when I run DOS programs under DOSEMU. It seems as if DOSEMU does not honor the keyboard remapping. Instead, the DOS programs seem to be using the keyboard's original mapping (as would exist had I never run the above remapping script).

I've found a few threads that might have some useful information:

http://www.linuxquestions.org/questi...d-keys-465293/

http://www.spinics.net/lists/linux-msdos/msg00937.html

However, I cannot figure out what to do to solve this problem.

Any help? I'm using Debian Wheezy.

Last edited by Digger1; 06-24-2014 at 12:13 AM.
 
Old 06-24-2014, 12:15 AM   #2
Digger1
LQ Newbie
 
Registered: Sep 2011
Location: Colorado Springs, CO
Distribution: Debian Squeeze
Posts: 24

Original Poster
Rep: Reputation: 0
Update:

Although starting DOSEMU in a terminal window (via the "dosemu -t" command) seems to solve the keyboard mapping problem, this will not work for me, since the DOS applications I use are graphical in nature.

Back to the ol' drawing board....
 
Old 06-24-2014, 11:30 AM   #3
Digger1
LQ Newbie
 
Registered: Sep 2011
Location: Colorado Springs, CO
Distribution: Debian Squeeze
Posts: 24

Original Poster
Rep: Reputation: 0
Update:

I tried hitting "Ctrl-Alt-K" to grab the keyboard in X, as per http://www.dosemu.org/docs/README/1.4/

No joy....
 
Old 06-26-2014, 12:12 AM   #4
Digger1
LQ Newbie
 
Registered: Sep 2011
Location: Colorado Springs, CO
Distribution: Debian Squeeze
Posts: 24

Original Poster
Rep: Reputation: 0
Update:

I think I'll need to create a new keymap for dosemu. The one currently being used is:

Code:
keytable keyb-user {
  0=
     0,27,"1234567890-=",127,9,
     "qwertyuiop[]",13,0,"as",
     "dfghjkl;",39,96,0,92,"zxcv",
     "bnm,./",0,"*",0," ",0,0,0,0,0,0,
     0,0,0,0,0,0,0,0,0,0,"-",0,0,0,"+",0,
     0,0,0,0,0,0,"<",0,0,0,0,0,0,0,0,0,
     0
  shift 0=
     0,27,"!@#$%^&*()_+",127,9,
     "QWERTYUIOP{}",13,0,"AS",
     "DFGHJKL:",34,"~0|ZXCV",
     "BNM<>?",0,"*",0," ",0,0,0,0,0,0,
     0,0,0,0,0,0,0,0,0,0,"-",0,0,0,"+",0,
     0,0,0,0,0,0,">",0,0,0,0,0,0,0,0,0,
     0
  alt 0=
     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
     0
  numpad 0=
     "789-456+1230."
}
It is trivial to modify the "obvious" keys. For example, changing the "q" to "i" results in an "i" being entered when the "q" key is pressed on the keyboard.

I still can't figure out how to modify the arrow keys and the right shift key.

Any ideas?
 
Old 06-26-2014, 11:37 PM   #5
Digger1
LQ Newbie
 
Registered: Sep 2011
Location: Colorado Springs, CO
Distribution: Debian Squeeze
Posts: 24

Original Poster
Rep: Reputation: 0
Can't figure out how to mod the keymap file so that the arrow keys have the desired effect.

Perhaps there will be a workaround available when opening dosemu in a terminal window.

Any ideas about this would be appreciated!
 
Old 07-02-2014, 10:39 PM   #6
Digger1
LQ Newbie
 
Registered: Sep 2011
Location: Colorado Springs, CO
Distribution: Debian Squeeze
Posts: 24

Original Poster
Rep: Reputation: 0
Well, I figured out a rather awkward work around, but I'm not proud of it.

I wrote a script that, before staring dosemu, determines if an external keyboard is present (if I use an external keyboard on this netbook, it is plugged in after the computer is booted, so that said external keyboard's keymap is left unchanged). On my Debian Wheezy machine, this is determined by looking for the existence of the "/dev/input/by-path/pci-*-event-kbd" file (where the "*" is an MSDOS-style wildcard).

If an external keyboard IS present, dosemu is called in the usual fashion:

Code:
dosemu -input 'insertyourcommandhere'
If an external keyboard is NOT present, the following command is used to start dosemu:

Code:
xterm -fa 'Terminus' -geometry 80x25 -e dosemu -t -input 'insertyourcommandhere'
This starts dosemu in a properly sized xterm terminal window, using the Terminus font (which gives a readable size and style of font).

There are some things about using dosemu in a terminal that you should know about. You can read about this by calling up dosemu in a terminal, then hitting Ctrl-6, h.

There are some minor hassles involved, but I think I can live with this.

Thanks to all who helped!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Remapped Control Key - Now Can't Get Remapped Key to Autorepeat Digger1 Linux - Newbie 1 07-16-2013 01:03 PM
keyboard remapped drastically in runlevel 5 mirni Linux - Server 2 07-15-2012 01:52 AM
Need help setting up mce usb vrc-remote keys remapped with xmodmap tamray Linux - Desktop 0 03-02-2012 10:59 PM
dosemu versus reserved keys mykrob Linux - Software 2 08-07-2006 03:30 AM
Keyboard Problem - I have to press a key twice for certain keys daedius Linux - Hardware 4 01-13-2005 07:32 AM


All times are GMT -5. The time now is 10:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration