Unix Technical Forum

Escape codes and function keys in keymap.

This is a discussion on Escape codes and function keys in keymap. within the Linux Operating System forums, part of the Unix Operating Systems category; --> Hello, I am trying to assing an escape code to a key through a keymap with no luck. I ...


Go Back   Unix Technical Forum > Unix Operating Systems > Linux Operating System

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-18-2008, 04:53 AM
Marcus Brody
 
Posts: n/a
Default Escape codes and function keys in keymap.

Hello,

I am trying to assing an escape code to a key through a keymap with
no luck. I will provide some kind of example of this thing I am
struggling with:

The keymap:
keycode 0x3b = F50
string F50 = "echo ^[c \n"

That would asign a "clear screen" escape code to function key 1
(0x1a in hexadecimal as shown by showkey), but well, it doesn't work.
Notice that should be "^[" a literal escape (in Vim, C-v plus Esc).

I have tryied also with octal sequences (as said in keymaps manual):

keycode 0x3b = F50
string F50 = "echo \033c \n"

Being "\033" octal for escape. Again, no luck.


The thing about function keys is that I am not able to shift a
function key into another one:

keycode 0x3c = F1
keycode 0x3b = j

That should mean: We press F1 (0x3b) and we get a letter j (works),
and we press F2 (0x3c) and we get F1, i.e. letter j (doesn't work).


Being curious I have also tried with readline (.inputrc)

.inputrc file:
"\e[11~": "echo ^[c \n"

It doesn't work neither.


And those are my thoughts. I would thank any suggestion.

Many thanks for your time and attention.

Best regards,
Marcus.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-18-2008, 04:53 AM
Paul Lutus
 
Posts: n/a
Default Re: Escape codes and function keys in keymap.

Marcus Brody wrote:

> Hello,
>
> I am trying to assing an escape code to a key through a keymap with
> no luck. I will provide some kind of example of this thing I am
> struggling with:
>
> The keymap:
> keycode 0x3b = F50
> string F50 = "echo ^[c \n"


You want "echo -e \"\033[2J\n\""

$ man echo

--
Paul Lutus
http://www.arachnoid.com

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:41 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com