Entry widget with number keypad 
Author Message
 Entry widget with number keypad

I have Perl/Tk programs using Entry widgets.
Users like to enter data using the number keypad
(as opposed to the row above the alpha keys).

Using Tk 400.202 : ok
Using Tk 800.022 : 4 and 6 do not enter

Has anyone seen this problem and can suggest a workaround?
I built Perl and Tk using Sun SPARC and Solaris 2.6.

An example:

use Tk;
$MW = new MainWindow;
$MW->Entry()->pack;
MainLoop;

Thanks,
Jay

Sent via Deja.com
http://www.*-*-*.com/



Sun, 22 Jun 2003 23:22:45 GMT  
 Entry widget with number keypad

Quote:
> Has anyone seen this problem and can suggest a workaround?
> I built Perl and Tk using Sun SPARC and Solaris 2.6.

I personally have not seen this problem.  Try this and see what prints
out:

 use Tk;
 $MW = new MainWindow;
 $entry = $MW->Entry()->pack;
 $entry->bind("<Key>", [sub{ print "Key: $_[1]\n"; }, Ev('K')] );

 # Try replacing Ev('K') with Ev('k').  Try turning the num-lock on and
 # off as well to see what the differences are.  Let us know what
happens.

Quote:
> MainLoop;

> Thanks,
> Jay

> Sent via Deja.com
> http://www.deja.com/

--
In the immortal words of Socrates, "I drank what?"

Sent via Deja.com
http://www.deja.com/



Mon, 23 Jun 2003 02:52:04 GMT  
 Entry widget with number keypad

Quote:
> I personally have not seen this problem.  Try this and see what prints
> out:

>  use Tk;
>  $MW = new MainWindow;
>  $entry = $MW->Entry()->pack;
>  $entry->bind("<Key>", [sub{ print "Key: $_[1]\n"; }, Ev('K')] );

>  # Try replacing Ev('K') with Ev('k').  Try turning the num-lock on
and
>  # off as well to see what the differences are.  Let us know what
> happens.

Tried your suggestions ... I find it interesting that 2 and 8 work!
Here's the output with Ev('K') (key 0 thru 9)
Key: KP_Insert
Key: F33
Key: Down
Key: F35
Key: Left
Key: F31
Key: Right
Key: F27
Key: Up
Key: F29
Here's the output with Ev('k') (key 0 thru 9)
Key: 101
Key: 119
Key: 120
Key: 121
Key: 98
Key: 99
Key: 100
Key: 75
Key: 76
Key: 77
Output is identical with num lock on or off.

Thanks,
Jay

Sent via Deja.com
http://www.deja.com/



Mon, 23 Jun 2003 23:54:38 GMT  
 Entry widget with number keypad
I ran this again myself.  It looks like the 0, 2, 4, 6 and 8 keys are
working (or at least, are identical to my results), while the odd keys
fail (not identical to my results).

Could this be some sort of keyboard mapping problem?  You haven't
remapped your keyboard, have you?  I'm at a loss otherwise.


Quote:

> > I personally have not seen this problem.  Try this and see what
prints
> > out:

> >  use Tk;
> >  $MW = new MainWindow;
> >  $entry = $MW->Entry()->pack;
> >  $entry->bind("<Key>", [sub{ print "Key: $_[1]\n"; }, Ev('K')] );

> >  # Try replacing Ev('K') with Ev('k').  Try turning the num-lock on
> and
> >  # off as well to see what the differences are.  Let us know what
> > happens.

> Tried your suggestions ... I find it interesting that 2 and 8 work!
> Here's the output with Ev('K') (key 0 thru 9)
> Key: KP_Insert
> Key: F33
> Key: Down
> Key: F35
> Key: Left
> Key: F31
> Key: Right
> Key: F27
> Key: Up
> Key: F29
> Here's the output with Ev('k') (key 0 thru 9)
> Key: 101
> Key: 119
> Key: 120
> Key: 121
> Key: 98
> Key: 99
> Key: 100
> Key: 75
> Key: 76
> Key: 77
> Output is identical with num lock on or off.

> Thanks,
> Jay

> Sent via Deja.com
> http://www.deja.com/

--
In the immortal words of Socrates, "I drank what?"

Sent via Deja.com
http://www.deja.com/



Tue, 24 Jun 2003 01:06:15 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Entry-widget: How to restrict input to Numbers?

2. Need Keypad to work in Text widgets

3. Need Keypad to work in Text widgets

4. entry widget in tkperl-0.029

5. nTk: Bug in entry widget ?

6. Help tkperl: How to select entry widget

7. Entry widget

8. Problem with Perl/Tk Entry widget

9. Bug in Entry Widget

10. Entry widget questions

11. updating of Entry-Widget

12. Entry widget and -textvariable configuration option..

 

 
Powered by phpBB® Forum Software