1830898 Members
3332 Online
110017 Solutions
New Discussion

Key mapping in .profile

 
SOLVED
Go to solution

Key mapping in .profile

Hi there,

Is there any way to map keys in a .profile file. I specifically want to map function keys.

thanks in advance,

Christian Briddon
11 REPLIES 11
Alex Glennie
Honored Contributor

Re: Key mapping in .profile

If this is under an Xwindows enviroment I guess you could call xmodmap to alter the mapping ... see man xmodmap and the output from xmodmap -pke ... a .profile entry would take the form of

xmodmap -e "keycode ## = "

Re: Key mapping in .profile

It's not under an X environment. Everything is at the shell.

Christian
Wodisch
Honored Contributor

Re: Key mapping in .profile

Hi,

you might be talking about "bash" as used on Linux systems, but we do not have that functionality in POSIX-sh or Korn-sh under HP-UX...

Sorry,
Wodisch
Carlos Fernandez Riera
Honored Contributor

Re: Key mapping in .profile

I dont know exactly what you are looking for...


maybe teminfo definitions ( see man tic, terminfo)


or maybe keysh ( see man sh, man 1 keysh) ??
unsupported
Marc Dijkstra
Trusted Contributor

Re: Key mapping in .profile

Wodish asked the question, I interpret your question the same way ..

If you want the Bourne again shell (bash) functionality that exists in linux (ie: up arrow etc.) you will have to install bash.

You can get it from one of the software porting and archive areas. Advise on getting it is easy, but take care using it it is CHUNKY and a bit of a slow shell!

MND
"A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila"
Steve Post
Trusted Contributor

Re: Key mapping in .profile

Do you want to map the function keys because you have some application that requires the keys?
If so, the application may have an alterative key sequence for you.
For example: I have an application called pcmiler. It lets me use control-f 2 as the f2 key.

Do you want to map the function keys because you have a pile of users with a special key in their application?
If so, perhaps you could look at what they use to get into the application. A few jobs ago I was "tasked" to get the "gold-select-backout-key" to work. This key was the "end" key on the PC. I had to map it to "escape _ 1 \ escape 0". I know that's pretty goofy. But it was easy. The terminal emulator they used allowed me to map keys. And the vi command allowed me to see the weird junk the "end" key was supposed to send.

Both cases here, did not mess with terminfo. I just tried to avoid it, becuase I did not want to hurt what was already working fine.

Steve

Re: Key mapping in .profile

Hi,

The reason I need to do this is because an application needs the function keys and the arrow keys.

They apparently use DEC type keys.

If we connect to our server with a terminal emulator we can map the keys but if we connect via a winterm wqe can not.

Cheers,

Christian
Marc Dijkstra
Trusted Contributor

Re: Key mapping in .profile

Hi again Christian


Check out this thread, I also pushed the bash here, mainly cuz I am lazy ;-)

But it may help.....

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xc59f03bbece8d5118ff40090279cd0f9,00.html

MND
"A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila"
Steve Post
Trusted Contributor
Solution

Re: Key mapping in .profile

I don't know bash. That's the only reason why I'm not suggesting that too. I don't want to send you down the wrong road with BAD advice. So take what I say with a big grain of salt.

Don't use winterm. Use something that allows you to map keys. Find a terminal emulator that's works in windows, that's free, that lets you modify the keys. I have a free thing called Tera Term. It uses keymap files.

Now about the keys though. You say your terminial emulator work right? Ok. Log in, vi a bogus file. Type i for insert. Type control-v, the a key (like the up arrow), you will see the text that comes out when you hit that key.
For me it's ^[[A which is.... [A. In my case here, now I know that the up arrow key needs to map to [A. If I log in with telnet from windows, I can type [A, and it would look like I hit the up arrow key.

I take it this bash thing would allow you to.?????
alias UPARROW="^[[A" ??

steve

Marc Dijkstra
Trusted Contributor

Re: Key mapping in .profile

Steve

bash -- the bourne again shell, was ported from linux (I believe). Yes, it has arrow character mapping for the HISTORY instead of the old ESC-K, and no h-j-k-l for editing of HISTORY. ESC-ESC for predictive text is now etc.

It has a number of other features, which I have not fully used, not even sure *how* much character/key mapping is there, but, as I stated, it is chunky and a wee bit slow (it is very large)

MND
"A computer lets you make more mistakes faster than any invention in human history - with the possible exceptions of handguns and tequila"
Steve Post
Trusted Contributor

Re: Key mapping in .profile

Mark,
I was just using the uparrow key as an example. I guess I should have used the F6 key instead. ( [17~ ).
or the F10 ( [21~ ). I figure the author is looking for some fancy keys that have nothing to do with shell history capability.