diff options
-rw-r--r-- | library/zincText.tcl | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/library/zincText.tcl b/library/zincText.tcl index e193161..2e235c5 100644 --- a/library/zincText.tcl +++ b/library/zincText.tcl @@ -85,7 +85,7 @@ proc zn_TextBindings {zinc} { $zinc bind text <Meta-greater> "setCur $zinc end" $zinc bind text <KeyPress> "insertKey $zinc %A" $zinc bind text <Shift-KeyPress> "insertKey $zinc %A" - $zinc bind text <Return> "insertChar $zinc \n" + $zinc bind text <Return> "insertChar $zinc \\n" $zinc bind text <BackSpace> "textDel $zinc -1" $zinc bind text <Control-h> "textDel $zinc -1" $zinc bind text <Delete> "textDel $zinc 0" @@ -119,8 +119,13 @@ proc insertChar {w c} { proc insertKey {w c} { - if {! [binary scan $c {c} code] || ($code < 32) || ($code == 128)} { - return; + if {! [binary scan $c {c} code]} { + return + } + set code [expr $code & 0xFF] + if {($code < 32) || ($code == 128)} { + puts "rejet $code" + return } insertChar $w $c |