Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perl Tk Bind <Return> is not Number Pad return?

Tags:

bind

perl

perltk

I'm grabbing an ISBN from the user. Probably from a barcode scanner (EAN 18 digits terminated by Return) but it may be keyed in by hand (13 digits). If it is by hand, it'll come from the number pad and may end with "Number Pad Enter". I've added a bind to my code:

$isbn_entry->bind("<Return>", sub{shift->focusNext});

Which works properly when the enter key on the keyboard is pressed, but not when the enter key on the number pad is pressed. Do I have to add another bind to catch that one, too? If so, how? Or have I done this wrong to start with?

like image 311
charlesbridge Avatar asked Jun 19 '12 20:06

charlesbridge


1 Answers

<KP_Enter> should correspond to the numeric keypad enter. You can bind it the same way as Return.

like image 155
choroba Avatar answered Oct 17 '22 04:10

choroba