Answer the question
In order to leave comments, you need to log in
How to intercept backspace in Chrome?
There is <div id="transarea" contenteditable="true" >
a need to intercept keystrokes inside it, I do this
$('#transarea')
.keypress(function(e) {
if(e.which == 190){ //если нажата точка
...............
}
if(e.which == 32) { //если нажат пробел
...................
}
if(e.which == 8){ //если нажат backspace
......................
}
else{ // все остальные клавиши
var symbol = String.fromCharCode(e.which);
...............
}
});
Answer the question
In order to leave comments, you need to log in
The keypress event fires only for character (which output) keys. For Control, Shift, Alt, BackSpace, you need to catch the keydown event
Look towards JavaFX. There is no graphic editor for it (it is only for the eclipse, it seems), but it's fine without it.
PS There is such a cool thing as ScalaFX . If there are no restrictions on technology, then I advise you to use it. If you are not friends with the rock, then you can use it at least for the graphic part, and for the logic you can take the good old java.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question