From 8843b3ffc7f73398cf9dbbad3fc304a489fa5f4c Mon Sep 17 00:00:00 2001 From: lecoanet Date: Fri, 16 May 2003 14:07:52 +0000 Subject: * (insertChar): fixed the signedness of the char code. * Fixed a bad binding for inserting \n characters --- library/zincText.tcl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'library') 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 "setCur $zinc end" $zinc bind text "insertKey $zinc %A" $zinc bind text "insertKey $zinc %A" - $zinc bind text "insertChar $zinc \n" + $zinc bind text "insertChar $zinc \\n" $zinc bind text "textDel $zinc -1" $zinc bind text "textDel $zinc -1" $zinc bind text "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 -- cgit v1.1