We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi, I'm trying to create text editor where it's not possible to delete what was written / I'm trying to disable backspace. I tried with keyPressed
void keyPressed() { if (keyCode == BACKSPACE) keyCode=0; }
but it's not working and google isn't helpful. Plz help
Answers
when you use
myInput += key;
and you don't check backspace, backspace doesn't work in the first place
https://forum.Processing.org/two/discussions/tagged/backspace
Using Processing 3.3 and Win10 .... it seems like your code should work. I tried your code and keyCode is returned as a value of 37. For some strange reason the code fragment below translates the BACKSPACE keyCode to zero:
I got 127 for Del and 8 for bckspc.
Kf
thanks guys, but it didnt work for me. in the end i used
void keyTyped() { if (key >= 9 && key <= 999) { letter = key; words = words + key; println(key); }
@kfrajer You are correct Sir...my bad...I was using the 'Cursor Left' key. #-o