1836539 Members
1958 Online
110102 Solutions
New Discussion

Re: Keyboard trouble

 
jim bidebo
Regular Advisor

Keyboard trouble

Ive already posted this before, but didnt get any answers about this issue:

HP-UX 10.20 Workstation, attached to a screen/keyboard/mouse switch. So an ordinary PS/2 PC-keyboard is in use. Everything seams to work, except the DEL key. Ive checked with xmodmap and the key is bound to Delete as it should. but when pressing it it sends "^?" instead of deleting the following character as it should.

Any suggestions and ideas are of intrest.

//Jim
7 REPLIES 7
Victor BERRIDGE
Honored Contributor

Re: Keyboard trouble

Hi,
What do you call delete key?
Is it backspace?

Have you tried:
stty erase


All the best

Victor
Helen French
Honored Contributor

Re: Keyboard trouble

Are you trying to do this on a terminal session? If you are looking for delete-line character, then:

# stty kill '^?'

Now when you press delete, it will delete the line. Like this if you want to assign the delete key for any function (erase, delete-word etc), set it accordingly.

# man stty
# man termio
Life is a promise, fulfill it!
jim bidebo
Regular Advisor

Re: Keyboard trouble

The key that i call delete is the one left to end and below insert on most keyboards.

stty kill will erase the whole row... i only want to erase one character in the opposite manner that backspace does...

backspace erases the previous character. and i want delete to erase the next character. as delete should be doing on most systems by default...
jim bidebo
Regular Advisor

Re: Keyboard trouble

have i explained the problem unclearly?
this cant be such uncommon problem?
Paul Sperry
Honored Contributor

Re: Keyboard trouble

#stty erase (delete key) enter
Shannon Petry
Honored Contributor

Re: Keyboard trouble

This is not a problem with the tty, but I'm not quite sure how to fix your problem.

basically you want to use vi as your shell, and you want the delete key to do the same thing as pressing "x" in vi to delete a character.

I know you can set vi in your shell, but not sure how to map the key "delete" to be edit-x.

regards,
Shannon
Microsoft. When do you want a virus today?
Steve Post
Trusted Contributor

Re: Keyboard trouble

So you have on the screen "$> abcdefg"
The cursor is flashing just to the right of the "g".
You can't delete stuff to the right of the cursor because you are at a unix prompt.
How can it delete the "following character" when there isn't one.

Are you in vi? If so, use the vi commands.
x deletes a character.
If you feel like mapping control-? to be the x command in vi, then I would suggest to try to mess with your .exrc file in your home directory.

Perhaps you are at the unix prompt and your are using vi command line editing. If that's the case, the .exrc file MIGHT help you.

A fast solution to this is to run a silly script like this.

#!/bin/ksh
# silly.ksh
echo "hi. hit the backspace key, then enter."
read $BACK
stty erase $BACK

Then to run it: . ./silly.ksh

Steve