Re: help Keyboard and Tk

2021-11-08 Thread Christopher Chavez
> All key good, but I have a problem with the key f10.
>
> I can see F10 in the consol, no problem.
> But in windows 10, f10 open the menu.


For a very long time, it has been conventional behavior for many programs on 
Windows (not just Tk) for F10 to “activate” the menu. Tk having this binding by 
default on Windows is likely for intentionally conforming to platform 
convention, so that Windows users find that pressing F10 behaves as they may 
expect it to.

Maybe someone else has a better answer about how to actually override this 
binding if desired, but I personally would avoid trying to bind to F10 on 
Windows.

Christopher A. Chavez


help Keyboard and Tk

2021-11-07 Thread leglaude
Hi all,

I have a litle Script perl Tk.

It's simple,
I press a key in my keyboard, and I can see the name key in the terminal with a 
print.

All key good, but I have a problem with the key f10.

I can see F10 in the consol, no problem.
But in windows 10, f10 open the menu.

Can you help me to solve the problem?
Thanks!
This is my script.

use Tk; 

$mw = MainWindow->new;

$mw->bind("", [ sub {
print "Touche : $_[1]\n";
 }, 
 Ev('K')] ); 
MainLoop;