backspace

What is the purpose of Unicode “Backspace” U+0008?

不羁的心 提交于 2019-12-03 06:20:47
What is the purpose of the Unicode Character 'BACKSPACE' (U+0008) in programming? What applications can it be used for? Um, it's a backspace character. On output to a terminal, it typically moves the cursor one position to the left (depending on settings). On input, it typically erases the last entered character (depending on the application and terminal settings), though the DEL / DELETE character is also used for this purpose. Typically it can be entered by pressing Backspace or Control-H Note that its action of deleting characters occurs only on a display, not in memory. A string within a

Update command line output

北城以北 提交于 2019-12-03 06:16:14
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" the previous output when a new status message is printed so I don't fill the screen with status messages. So far, I've tried this: my $progressString = "Progress\t$counter / " . $total . "\n"; print $progressString; #do lots of processing, update $counter my $i = 0; while ($i < length($progressString)) { print "\b"; ++$i; } The backspace character

How to disable backspace if anything other than input field is focused on using jquery

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 03:07:41
How do I disable backspace keystroke if anything other than 2 specific input fields are focused on using jquery? here is my current code (NOW INCLUDING 2 TEXTBOXES): $(document).keypress(function(e){ var elid = $(document.activeElement).attr('id'); if(e.keyCode === 8 && elid != 'textbox1' || elid != 'textbox2'){ return false; }; }); this is not working though....any ideas? I think this would do the trick: $(document).keydown(function(e) { var elid = $(document.activeElement).hasClass('textInput'); if (e.keyCode === 8 && !elid) { return false; }; }); assuming that the textboxes has the class

Odd behavior of backspace in Vim (SSH to Linux from Mac)

╄→尐↘猪︶ㄣ 提交于 2019-12-03 03:04:20
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? Not sure why it would randomly start doing this based on the information you gave, but trying adding this line to your .vimrc set backspace=start,eol,indent The problem comes from the communication between Mac Terminal the Linux Terminal. Go to the Mac Terminal -> Preferences -> Advanced tab, check the option "Delete sends Ctrl-H". Then after I login to Linux, and Backspace works just fine in Vim. In

Selenium-IDE: How to simulate non-printable keys (ENTER, ESC, Backspace)?

时间秒杀一切 提交于 2019-12-02 22:25:30
What is the exact HTML code to simulate ENTER, ESC, BACKSPACE and DOWN in Selenium IDE 1.3.0? typeKeys didn't work nor did this: <tr> <td>keyDown</td> <td>id=zc_0_4_3-real</td> <td>10</td> </tr> <tr> <td>keyUp</td> <td>id=zc_0_4_3-real</td> <td>10</td> </tr> <tr> <td>keyPress</td> <td>id=zc_0_4_3-real</td> <td>10</td> </tr> wentbackward For example to submit a form by pressing enter, the only one I can figure out is: Command: keyPressAndWait Target: id=q [depends on your form of course] Value: \\13 [for enter - any ascii value can go here] So it looks like this: <tr> <td>keyPressAndWait</td>

Disable beep when backspace is pressed in an empty JTextField

浪子不回头ぞ 提交于 2019-12-02 08:44:53
问题 Beginner here. Does anybody know a quick and easy way to get a JTextField to not beep when backspace is pressed and the field is empty? I've seen a couple things online about changing the DefaultEditorKit, but nothing I was able to make sense of. Any help would be greatly appreciated. 回答1: This code worked for me. Action beep = textArea.getActionMap().get(DefaultEditorKit.deletePrevCharAction); beep.setEnabled(false); 回答2: I haven't had a chance to try this out, but you might be able to

Python code to cause a backspace keystroke?

£可爱£侵袭症+ 提交于 2019-12-01 16:32:43
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 GUI (as the backspace key deletes something) How I would code in a backspace key stroke? The character for backspace is '\b' but it sounds like you want to affect the GUI. if your program changes the GUI, then simply delete the last character from the active input field. foo = "abc" foo = foo + "\b" + "xyz" print foo >> abxyz print len(foo) >> 7 if

Prevent backspace from navigating back in AngularJS

孤人 提交于 2019-12-01 04:08:56
I faced this issue in my AngularJS webapp. When a user enters a page with a form to fill and he starts typing, if he presses the backspace key and the focus is not on the input text, then the page goes to the previous state. I looked up this solution using jQuery, but it doesn't seem the appropiate way for achieve this in AngularJS. Jai There is $document in angular js: angular.module('yourModule', []) .controller('yourController', ['$scope', '$document', function($scope, $document) { $document.on('keydown', function(e){ if(e.which === 8 && ( e.target.nodeName !== "INPUT" && e.target.nodeName

Ignore backspace key from stdin

和自甴很熟 提交于 2019-11-30 21:59:05
I want to make a program that forces it's user to input text but doesn't allow him to erase any of it, what's a simple way of doing it in C? The only thing I've got is (c = getchar()) != EOF && c != '\b' which doesn't work. Any ideas? POSIX - unix version #include <sys/types.h> #include <termios.h> #include <stdio.h> #include <string.h> int main() { int fd=fileno(stdin); struct termios oldtio,newtio; tcgetattr(fd,&oldtio); /* save current settings */ memcpy(&newtio, &oldtio, sizeof(oldtio)); newtio.c_lflag = ICANON; newtio.c_cc[VERASE] = 0; /* turn off del */ tcflush(fd, TCIFLUSH); tcsetattr

Backspace doesn't delete inner html tags of a contenteditable DIV in Firefox

邮差的信 提交于 2019-11-30 21:44:57
I have created a DIV with attribute contenteditable=true and appended children like "span" and "a" with attributes contenteditable=false. Wanted to test if the entire node be deleted with a single backspace and to my surprise Firefox couldnt delete the elements. Also this works as expected in all major desktop browsers except Firefox. Any clues on this or what could be the possible workaround? Found the exact issue on bugzilla here . Okay! found the solution... its rather simple than what you would think. I am actually inserting html for links, so using <a> here. The <a> tag has attribute set