I am writing a program that runs in a terminal - I would like to be able to correct typing mistakes, however when I use backspace I get this:
Is there a way that I can get the backspace (as well as the cursor keys) to work in my program? There are some slightly helpful articles in the FAQ, and I might end up fiddling with them - looks like maybe it would be cool if vVv's stuff was still up here though... Anyway, any help would be much appreciated.
Do you get ^H whenever you hit backspace, even when running in a shell?
If so, try:
stty erase ^H
(where ^H is you hitting the backspace key)
have you tried changing the keyboard layout
Hammer: - the backspace and cursor keys work fine in the shell when I am not running a program.
GSLR: - do you mean changing the keyboard layout from within the program I am trying to run?
Post your code that reads from the keyboard.
To get the backspace into the program, you'll need something that will get unbuffered IO. Try the mygetch() function here