aboutsummaryrefslogtreecommitdiff
path: root/library
diff options
context:
space:
mode:
authorlecoanet2003-05-16 14:07:52 +0000
committerlecoanet2003-05-16 14:07:52 +0000
commit8843b3ffc7f73398cf9dbbad3fc304a489fa5f4c (patch)
treea9e32916967b740598de703b772797b0c978105c /library
parent47a74b7a47564e1b4a6b60c4c57f45205f130e43 (diff)
downloadtkzinc-8843b3ffc7f73398cf9dbbad3fc304a489fa5f4c.zip
tkzinc-8843b3ffc7f73398cf9dbbad3fc304a489fa5f4c.tar.gz
tkzinc-8843b3ffc7f73398cf9dbbad3fc304a489fa5f4c.tar.bz2
tkzinc-8843b3ffc7f73398cf9dbbad3fc304a489fa5f4c.tar.xz
* (insertChar): fixed the signedness of the char code.
* Fixed a bad binding for inserting \n characters
Diffstat (limited to 'library')
-rw-r--r--library/zincText.tcl11
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