Help with setting Function key values in console

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Matt Alexander
Date:  
Subject: Help with setting Function key values in console
On Thu, 18 Apr 2002 wrote:

> On Thu, Apr 18, 2002 at 04:25:55PM -0700, Matt Alexander wrote:
> >
> > I used loadkeys to set this up:
> >
> > # loadkeys
> > keycode 63 = F55
> > string F55 = "^[[6~"
> >
> > If I press the F5 key while on the console, it prints this string.
> > However, the app on the server behaves as if I'm actually typing in each
> > of those characters individually, and that's not what I want. The box I'm
> > testing this on is Mandrake 8.2.
> >
> > If anyone has any suggestions on how to make this work or where I might
> > find more information on how to configure this, I'd appreciate it.
> > Thanks,
> > ~M
>
> You'll notice that when you press F5 on your console, that the ^[ is treated
> as two separate characters. The reason this happens, is because the ^[ is
> not being interpreted by loadkeys as an escape code. What you have to do is
> get that escape code into that string. An easy way to do this is use echo
> -e. Eg:
>
>     echo -e '\033[6~'

>
> Using a bit of shell magic, you should be able to replace that above ^[ with
> the real escape character.


OK... If I use loadkeys on the command line, then it works to do this:

# loadkeys
keycode 63 = F55
string F55 = "\033[6~"

However, when I put these same lines in my us.kmap file, it doesn't work.
It generates 6~ as the output. Any suggestions on how to get the escape
sequence to work properly from within the keymap file?
Thanks again,
~M