src/de/uapcore/sudoku/SudokuTextField.java

changeset 6
5bab2e971333
parent 4
b8588e318001
--- a/src/de/uapcore/sudoku/SudokuTextField.java	Sat Jan 26 19:34:31 2013 +0100
+++ b/src/de/uapcore/sudoku/SudokuTextField.java	Sun Jan 27 15:03:57 2013 +0100
@@ -59,10 +59,12 @@
             private void handle(KeyEvent e) {
                 char c = e.getKeyChar();
                 if (!e.isAltDown() && !e.isControlDown() &&
-                        Character.isLetterOrDigit(c)) {
+                        !Character.isISOControl(c)) {
                     // Perform clean input check
                     if (getText().length() > 0 && getSelectedText() == null) {
-                        e.consume();
+                        if (c != KeyEvent.CHAR_UNDEFINED) {
+                            e.consume();
+                        }
                     } else {
                         if (c < '1' || c > '9') {
                             e.consume();

mercurial