The backspace key on the keyboard (deletes the previous character)
Questions tagged [backspace]
354 questions
16
votes
5 answers
What is the use of '\b' (backspace)
I'm taking a Python class right now, and I just learned about the backspace character. Like newline (\n), backspace is a special character with ASCII code 8. My teacher couldn't think of a reason to use that, but I'm curious as to how it's used. …

Cullub
- 2,901
- 3
- 30
- 47
15
votes
1 answer
What is the purpose of Unicode "Backspace" U+0008?
What is the purpose of the Unicode Character 'BACKSPACE' (U+0008) in programming? What applications can it be used for?

skibulk
- 3,088
- 1
- 34
- 42
13
votes
7 answers
Java KeyListener: KeyTyped Backspace, Esc as input
Inside the KeyTyped method, how do I tell if Backspace or Esc is being pressed?

Justin
- 24,288
- 12
- 92
- 142
12
votes
1 answer
Backspace character weirdness
I wonder why backspace character in common Linux terminals does not actually erase the characters, when printed (which normally works when typed)..
This works as expected:
$ echo -e "abc\b\b\bxyz"
xyz
(\b evaluates to backspace, can be inserted…

mykhal
- 19,175
- 11
- 72
- 80
12
votes
10 answers
Disable backspace in textbox via javascript
I have a textbox which is extended by an Ajax Control Toolkit calendar.
I want to make it so that the user cannot edit the textbox and will have to instead use the calendar extender for input.
I have managed to block all keys except backspace!
This…

Andrew
- 11,068
- 17
- 52
- 62
12
votes
5 answers
Python code to cause a backspace keystroke?
I keep finding ways to map the backspace key differently, but that's not what I'm after.
I'm in a program writing a python code, and basically I want to write a line of code that causes the program to think someone just hit the Backspace key in the…

aescript
- 1,775
- 4
- 20
- 30
11
votes
3 answers
How to backspace from command mode in Vim?
If I'm in command mode, how do I backspace? Hitting the delete key on my Macbook just moves the cursor to the left one space. The fastest way I know to do this is h, x, but is there a better way, maybe with one key?

ma11hew28
- 121,420
- 116
- 450
- 651
11
votes
5 answers
Update command line output
My program (which happens to be in Perl, though I don't think this question is Perl-specific) outputs status messages at one point in the program of the form Progress: x/yy where x and yy are a number, like: Progress: 4/38.
I'd like to "overwrite"…

yavoh
- 2,645
- 5
- 24
- 21
11
votes
5 answers
JavaScript concat string with backspace
I have a function f similar to
function f(str){
alert("abc"+str);
}
Now, I want to use JavaScript special charecter "\b" in such a way that I can choose if I want to display the hardcoded string "abc" or not. For example,
f("\b\b"+"yz");…

hrishikeshp19
- 8,838
- 26
- 78
- 141
10
votes
3 answers
Odd behavior of backspace in Vim (SSH to Linux from Mac)
I didn't change any setting of my Vim, but today the Backspace gets some crazy behavior. Every time when I hit it, it does not delete a character, but prints ^?. Anyone knows what is going on?

Grace Huang
- 5,355
- 5
- 30
- 52
10
votes
2 answers
how to check for backspace(delete) keyPress in react native (iOS)
I want to fire a function when the user hit backspace in a textbox. I have searched on stack overflow and React Native docs but there is not a relevant answer.
basically, I don't know whats the keyname for backspace

lag
- 520
- 2
- 10
- 26
10
votes
2 answers
Understand backspace (\b) behaviour in C
This program copy its input to its output, replacing TAB(\t) by \t backspace(\b) by \b.
But here in my code I am unable to read input character when I enter backspace its not replacing as a tab works .
Compiling with GCC in Linux: …

vinay hunachyal
- 3,781
- 2
- 20
- 31
9
votes
1 answer
Swift why strcmp of backspace returns -92?
I was tried to detecting backspace inside of UITextfieldDelegate.
And found this answer.
https://stackoverflow.com/a/49294870/911528
And It working correctly.
But I don't know what's going on inside of this function.
let char =…

AutumnSky
- 394
- 2
- 14
9
votes
1 answer
Apply control characters to a string - Python
I'm trying to apply control characters, such as '\x08 \x08' that should remove the precedent char, to a string (move backwards, write space, move backwards)
For example when I type into python console :
s = "test\x08 \x08"
print s
print repr(s)
I…

Perceval W
- 448
- 6
- 11
9
votes
1 answer
Backspace key is reverted in Eclipse Mars
My backspace key in Eclipse Mars (4.5.0) works like the delete key: it deletes the right character instead of the left one. That's really confusing
Maybe I accidentally used a shortcut key?
I tried to restart Eclipse but it didn't work. I also tried…

Mathieu
- 195
- 1
- 6