f



Re: catch key stroke before displaying in an entry

At 03:05 PM 10/4/2004, Thomas Kaiser wrote:

>I have an application with a main window an several Entry's (input boxes). I would like to check the pressed key before it is displaied in the selected entry or even if no entry is selected (main window selected). I need this to determine if the input is comming from the keyboard or from a barcode scanner which is connected together with the keyboard (and acts like a keyboard, I can add some post chars for the barcode reader).
>
>I tried to "bind" the "KeyPress" event to the main window and hoped this  will be the first callback which is called after pressing a key, but it seems to be the last callback. Then I could check the char and decide if  the callback should  break or the next call back should be executed.
>
>I hope somebody can tell me an easy way to do this.

Read about the -validatecommand and -validate options in the Tk::Entry pod. 

-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to majordomo@lists.stanford.edu
0
Marc
10/4/2004 7:44:30 PM
comp.lang.perl.tk 4721 articles. 0 followers. pharrendorf (19) is leader. Post Follow

0 Replies
177 Views

Similar Articles

[PageSpeed] 40

Reply: