in reply to Re^4: Windows Tk issue Copy and Paste Russian keyboard
in thread Windows Tk issue Copy and Paste Russian keyboard

I'm not in a position to test this, but the internet suggests that Tk can also bind to a keycode, not only a character, but the solutions seem to be to bind to all keys using KeyPress and then to look at the keycode in the event.

Replies are listed 'Best First'.
Re^6: Windows Tk issue Copy and Paste Russian keyboard
by IB2017 (Pilgrim) on May 20, 2019 at 16:04 UTC

    Yes, it is possible. The following code reads the keycode:

    use strict; use warnings; use Tk; my $name; my $mw = MainWindow->new(); my $entry = $mw->Entry( -textvariable => \$name )->pack(); $mw->bind("<KeyRelease>" => sub { warn $_[0]->XEvent->k; }); $mw->MainLoop(); exit(0);

    I should then mimic the combination of Ctrl+C/V, and the copy and paste rutines. I am not sure if this is the way to go, but at the moment it seems the only alternative to use copy and paste in Tk with all (?) keyboard layouts.