On Wed, 8 Aug 2001, Christophe Conduch� wrote:

> Bart Oldeman a �crit :
> > If the linux terminal does not understand these keys then neither can
> > DOSEMU.
> I need to check it again, but I'm quite sure that these keys are working
> on the linux console. (that's also why we were puzzled that they don't
> in dosemu).
> 
> > A suid-root DOSEMU can use the rawkeyboard. Otherwise, use X, or be
> > prepared to spend a lot of time and research adding new terminal
> > definitions, etc.
> i think we will have to :(
> 
> > What's the reason you need to use the console? Even for remote use from
> > Windows you might want to investigate Cygwin/XFree86
> > http://xfree86.cygwin.com/
> 
> speed.

Ok here's an idea (see also the Keyboard and Console HOWTO):

go to a (local) linux console, and type

showkeys > keys.map

Then edit keys.map. For instance in my case, the first line is:
keymaps 0-2,4-6,8-9,12

This means you have columns denoting (see man keymaps)
0,1,2: none, shift, altgr
4,5,6: ctrl, ctrl+shift, ctrl+altgr
8: alt
9: alt+shift
12: alt+ctrl

And then layer:

keycode  59 = F1               F13              Console_13       F25  F37
        alt             keycode  59 = Console_1       
        control alt     keycode  59 = Console_1

This means: shift+F1->F13, AltGr+F1->Console_13, Ctrl+F1->F25,
Shift+Ctrl+F1->F37. And then below some more explicit definitions.

Then further down:
string F1 = "\033[[A"
string F13 = "\033[25~"

Ha so now we now that Shift-F1 gives this. You can add to keys.map for
instance:

string F25 = "\033[39~"

if you then do
loadkeys keys.map

and press Ctrl+F1 in "cat -v" you'll see this [39~ appearing.
Now and only now you can ssh to somewhere else and see the same.

Then probably on the Linux Console you have TERM=linux. Now for a little
DOSEMU source, because you want to let DOSEMU know about your spanky new
keybindings:

src/base/keyboard/keyb_slang.c:

static Keymap_Scan_Type Linux_fkeys[] =
{
  {"\033[[A",  KEY_F1 },                /* F1 */
  {"\033[[B",  KEY_F2 },                /* F2 */
  {"\033[[C",  KEY_F3 },                /* F3 */
  {"\033[[D",  KEY_F4 },                /* F4 */
  {"\033[[E",  KEY_F5 },                /* F5 */
  {"\033[39~",  KEY_F1 | CTRL_MASK },    /* Ctrl+F1 */ <--- add this line
  {"", 0}
};

and recompile.

I hope you get the idea. It's certainly possible. Now you say that "shift
behaves like control", I don't know what causes that, but you might be
able to figure it out from this information.

For instance, in keyb_slang.c I see defined:
  {"\033[23~", KEY_F1  | SHIFT_MASK },  /* Shift F1  (F11 acts like
                                                                * Shift-F1) */
...
  {"\033[25~", KEY_F3  | SHIFT_MASK },  /* Shift F3 */

But on my console, Shift-F1 gives \033[25~, so when I press Shift-F1
DOSEMU thinks I'm pressing Shift-F3!

Bart

-
To unsubscribe from this list: send the line "unsubscribe linux-msdos" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to