This code: #!/usr/bin/perl use strict; use warnings; use Tk; my $mw = MainWindow->new; $mw->title ($]); my $tw = $mw->Text ( -font => "{ DejaVu Sans Mono } 9", )->pack (-side => "top", -expand => 1, -fill => "both", -anchor => "nw"); MainLoop; creates a text area widget where one can write a text as in a text editor. If I press 'A' key, 'a' appears. That's fine. If I press key that returns a non-ASCII character (e.g. '5' key on Czech keyboard should return 'ř' character), nothing shows. I still can insert the non-ASCII characters from a primary X11 selection by pressing a middle mouse button. Thus I conclude perl-Tk ignores non-ASCII keys. This happens with any perl-Tk-804.034 or perl-libs. Also upstream sources suffer from this. A previous perl-Tk-804.033 ignores all keys, including ASCII ones. I guess something has changes in X11 and the bundled Tk does not process Unicode labels from the key press events.
Actually it works unless an input method is used. If an input method is in use, XMODIFIERS environment variable is set (e.g. to "@im=SCIM" if scim input method is used). Then a branch for handling 'A' Tk::Ev events at pTk/tkBind.c:2925: string = TkpGetString(winPtr, eventPtr, &buf); numChars = Tcl_DStringLength(&buf); obtains an empty string and returns an empty string back to Perl Tk. If XMODIFIERS is unset, the code obtains at a second key event a correct two-byte string "ř".
And that's caused by winPtr->inputContext being NULL in TkpGetString(). It seems that the inputContext is not properly initialized.
The initiation happens in OpenIM() during an application startup: dispPtr->inputMethod = XOpenIM(dispPtr->display, NULL, NULL, NULL); and it fails.
I created a ticket at upstream.
This message is a reminder that Fedora 29 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora 29 on 2019-11-26. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '29'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 29 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 29 changed to end-of-life (EOL) status on 2019-11-26. Fedora 29 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.