Hi,
I had a particular binding in Tk3.6 as
set event "if \{\[ap_filter_uplownum %A \[%W get\] $length\]\} \{%W insert \[%W index insert\] \[string toupper %A\]\}"
eval bind $entry <Any-KeyPress> $event
And, procedure ap_filter_uplownum is defined as
proc ap_filter_uplownum { key...