Tk Source Code

View Ticket
Login
Ticket UUID: 2073526
Title: Accented characters in text widget, linux
Type: Bug Version: obsolete: 8.4.7
Submitter: mgma Created on: 2008-08-25 12:29:10
Subsystem: 18. [text] Assigned To: fvogel
Priority: 6 Severity: Minor
Status: Closed Last Modified: 2016-08-17 21:23:17
Resolution: Works For Me Closed By: fvogel
    Closed on: 2016-08-17 21:23:17
Description:
I've observed this problem using an old version of Tk (8.4.7). Maybe it's solved in newer versions, but I couldn't check. I happens in Linux, but not in Windows.

The problem happens when I try to type an accented character like á (this is á in HTML, in case that you cannot see correctly). To try this with an English keyboard, there should be an accent character if you press AltGr+#, for instance.

The problem is the following one. If I do:

> text .t
> pack .t

The accented characters work, and I can type á by pressing first the ´ character, releasing the key, and then typing the a.

But if I pack any other widget afterwards, for instance:

> frame .f
> pack .f

Then the accented characters stop working and I can only type a.

Finally, if I create another text widget:

> text .u
> pack .u

I can only type á in the second text, but the first one still doesn't work.

I've traced the binding for <Key> in the Text class. When I pack only the first text, .t, the binding executes only after I've hit the two keys:

tk::TextInsert .t á

And after I've packed the frame .f, it executes immediately after I hit each key:

tk::TextInsert .t {}        <-- when I hit ´
tk::TextInsert .t a         <-- when I hit a
User Comments: fvogel added on 2016-08-17 21:23:17:
OK thanks again for your testing and help. 

So the original problem from the OP vanished and what you still see is a problem that does not originate in Tk since it happens also in the mate terminal. Besides, you see more or less the same sucking behavior with the compose key whether you input accented charaters in the text widget or in mate.

I suspect something wrong in your configuration because I tried the AltGr method (compose key) on a Linux Mint 17.2 and had no issue in entering accented characters (with some 8.5 version from 2015) by the AltGr method in both the text widget and the mate terminal.

anonymous (claiming to be [email protected]) added on 2016-08-15 17:31:58:
Version 8.6.1

I tried the OP's text/frame and was not able to reproduce the problem.
My guess is that it is a generic problem with the compose key on Linux.
The compose key works _slightly_ better on a desktop than on the laptop.
But it still sucks.

anonymous (claiming to be [email protected]) added on 2016-08-15 17:10:11:
1. Here is the Alt-Gr (compose) method:
http://stefaanlippens.net/accented-characters-on-qwerty-keyboard

2. I am using a laptop.  US keyboard.

3. Correct.  I tried again, and was able to get some accented characters in.
It is horribly slow and prone to errors and works just as badly as in the terminal.

4. ? I am just supplying feedback and additional testing.  It is not of great consequence to me.

Personally, having seen how poorly Alt-GR works in the terminal, I'm not impressed, and I wonder why anyone would use that.

fvogel (claiming to be l) added on 2016-08-15 16:57:40:
Also, with what version of Tk do you reproduce?
Did you identify a version that works for you?

fvogel added on 2016-08-15 16:50:50:
Thanks for your feedback.

"Using the Alt-GR method":

--> 1. Could you please explain, in details, what you mean by that?
I tried (and that worked) to use AltGr+the key labelled 7 on my french keyboard, which provides the ` accent when I then hit, say, the e letter on my keoboard.

--> 2. What kind of physical keyboard do you have?

"Using the Alt-GR method [...] I cannot get any accented inputs into Tk widgets.
Using Alt-GR in the mate terminal is slow and inconsistent as to whether it works at all."

--> 3. Do you mean you can never get any accented inputs into any Tk widget? The OP was much more limitative in his report: he said to reproduce one has to create a precise sequence of widgets.

--> 4. The above quote IIUC seems to state that inputting accented characters does not work even outside of Tk (e.g. in the mate terminal)? If so, why is what you see a Tk bug?

anonymous (claiming to be [email protected]) added on 2016-08-15 15:35:14:
Linux Mint 17.3:
Using the Alt-GR method (which does not require any IME), I cannot get any accented inputs into Tk widgets.
Using Alt-GR in the mate terminal is slow and inconsistent as to whether it works at all.

Using a modern IME (ibus-daemon, japanese) works fine.
I tried SCIM before, and the ibus daemon is much better, though mine generally crashes and starts using a large amount of CPU after a period of time (and Tk starts doing weird stuff).

I would recommend any SCIM/XIM users switch to using ibus daemon.

fvogel added on 2016-08-15 15:14:53:
Still can't reproduce after installation of SCIM and activation using Ctrl+Space.

Can anyone reproduce?

Setting this ticket to pending.
If nobody comes back here raising his hand I'll close the ticket soon.

fvogel added on 2016-08-15 14:39:35:

I cannot reproduce this on Linux Debian 8 with the current core-8-6-branch nor with core-8-4-branch (I couldn't compile 8.4.7 because configure on that version stops on a "Syntax error: Unterminated quoted string"??)

But I have no input manager installed on that computer ([1924761] fixed a bug with SCIM/XIM).


fibonacciprower added on 2008-09-24 11:23:15:
Perhaps this is related to bug #1924761.