[Xfce-bugs] [XFCE 0000261]: Input methods in XFFM

xfce-bugs at xfce.org xfce-bugs at xfce.org
Thu Jul 22 00:01:14 CEST 2004


The following bug requires your FEEDBACK.
=======================================================================
http://bugs.xfce.org/view_bug_page.php?f_id=0000261
=======================================================================
Reporter:                   adrian440
Handler:                    edscott
=======================================================================
Project:                    XFCE
Bug ID:                     0000261
Category:                   xffm
Reproducibility:            have not tried
Severity:                   minor
Priority:                   normal
Status:                     feedback
=======================================================================
Date Submitted:             2004-07-17 00:30 GMT
Last Modified:              2004-07-21 22:01 GMT
=======================================================================
Summary:                    Input methods in XFFM
Description: 
When using chinese input methods in xfce, they never seem to work in XFFM
(but the work everywhere else in XFCE). I have tried both FCITX (which
utilises XIM) and also SCIM, which utilises the im_module in gtk2.
Attemped in charsets utf8 and gb2312. I'm running xfce 4.0.3, so please
close this bug if it has been fixed since.
=======================================================================

-----------------------------------------------------------------------
 edscott - 2004-07-17 01:05 GMT 
-----------------------------------------------------------------------
I'm afraid I have no idea what you are talking about (so I don't think it
is fixed). If anybody could explain further or provide a patch it would be
very helpful.

-----------------------------------------------------------------------
 adrian440 - 2004-07-17 02:56 GMT 
-----------------------------------------------------------------------
Asian languages utilise helper programs (called input methods) in order to
input characters. They are required to access the lord-knows-how-many
ideographs of their respective languages utilising an alpha-numeric
keyboard. Most of these utilise the XIM protocol, however there are newer
ones that jack into gtk-2 more directly. Fcitx is a chinese input method
that utilises XIM, while SCIM is an input method that utilises gtk-2's
more intricate protocol (which I've heard is more capable when it comes to
scripts that have recombination). One can view the available gtk input
methods by right clicking the space where one would usually type. Anywho,
these input methods work almost everywhere in xfce, just not in the file
manager. One thing it might be is that both of these utilise Ctrl-Space as
the activating keystroke, so perhaps this is being blocked? I might try a
japanese input method editor (I think they use shift space), and see if
that's any more successful.

-----------------------------------------------------------------------
 edscott - 2004-07-17 14:59 GMT 
-----------------------------------------------------------------------
Indeed, modifier-Space is being sent down a black hole. I've changed that
and allowed ctrl-space, alt-space and shift-space to pass through.

Could you possibly check out the CVS version to test? You only have to
checkout xffm and xfce4-modules to continue using xfce4_0.x. Compile and
install xfce4-modules first, then for xffm do a "./configure
--enable-oldlibraries".

If you cannot do this, please give me some kind of recipe I can follow to
see whether the fix is good or not.

-----------------------------------------------------------------------
 adrian440 - 2004-07-18 11:09 GMT 
-----------------------------------------------------------------------
OK, the build went fine, I'm using the CVS version now. Modifier space now
brings up the input method window (it did not before). However the
subsequent letters typed are not registered by the input method, it is as
if the input method is not receiving them; so no joy. With the updated CVS
version there is of course a new way of renaming things (just click on the
filename) which doesn't bring up the traditional input prompt at the top,
but allows one to rename the file directly. With this new mode, the input
methods tested (fcitx, scim, & kinput2) work flawlessly. There is
something about how input is taken there that is different. All input that
goes through the input buffer that appears at the top of the window (such
as creating files or folders, or doing a goto) is problematic. 

I must say I like the improvements though, like the new xffrecuent4 and
xffrequent. I also like being able to run each function (trash, mountdev,
etc) as its own executable, so please keep that going.

-----------------------------------------------------------------------
 edscott - 2004-07-18 13:36 GMT 
-----------------------------------------------------------------------
Apparently the input problem persists because xffm is trying to do
autocompletion (which is probably not what you want). So now I've modified
the combo so that autocompletion is turned off whenever the
(ctrl|alt|shift)-space is received. That will pass everything through.
Autocompletion will remain off until (shift or alt)-backspace is received,
if you want to switch back to default behaviour.

Please test. You only need to update your CVS version of xfce4-modules
(cvs update && make install). Xffm does not need to be updated or rebuilt,
just close all xffm instances and restart.

-----------------------------------------------------------------------
 adrian440 - 2004-07-18 23:21 GMT 
-----------------------------------------------------------------------
Well done, that appears to have fixed it! A side-effect has occurred
though, in that after one uses an input method in the goto box (and then
deactivate it with mod-space), pressing enter brings down the drop list,
instead of confirming (as it usually would). Of course one can still use
the enter button provided at the end of the input buffer, so it isn't
really a problem.

When this gets patched into the next release it'll make the file manager
as i18nalised as the rest of xfce and more likely to be included in asian
distros, like hiweed (a chinese debian-based distro with xfce as the
default desktop).

-----------------------------------------------------------------------
 edscott - 2004-07-19 03:07 GMT 
-----------------------------------------------------------------------
The enter key now works as is should (it is not being passed through
anymore). You just need to update xfce4-modules for changes to take
effect.

I've also changed the combination to reenable autocompletion to
mod-space.
If there are no more problems, this would finish up the fix.

-----------------------------------------------------------------------
 adrian440 - 2004-07-19 06:27 GMT 
-----------------------------------------------------------------------
Almost. Goto, rename, and symlink all work perfectly, but new
file/directory seems to create nothing. I've found I can create a file
with just english, but hybrid english/asian or pure asian does not work.
The input window works perfectly, its just that no file/folder is actually
created.

-----------------------------------------------------------------------
 edscott - 2004-07-19 17:32 GMT 
-----------------------------------------------------------------------
There was an error in filename conversion to utf-8. Maybe this was causing
the problem. Please check if the the fix solves the problem. You have to
update and recompile xffm (nothing with xfce4-modules this time).

-----------------------------------------------------------------------
 adrian440 - 2004-07-20 09:06 GMT 
-----------------------------------------------------------------------
Ok, problem solved. While I've tested it with chinese input methods, I
cannot test for other input method languages such as japanese or korean.
While I think this bug could be closed for chinese users, it may be
reopened after feedback from japanese users.

-----------------------------------------------------------------------
 edscott - 2004-07-20 19:27 GMT 
-----------------------------------------------------------------------
I'm not too happy with the fix, since it turns off autocompletion while in
chinese input mode. I don't see any reason why ideograms cannot be
autocompleted. If I knew how the ideograms are byte represented the
feature should not be difficult to enable.

About Japanene/Korean. All that is needed to apply the same fix is to know
what key sequence is used to enter/exit the alternate input mode.

-----------------------------------------------------------------------
 adrian440 - 2004-07-20 22:50 GMT 
-----------------------------------------------------------------------
For autocomplete usability, GQview's input box is ideal, it has tab
completion while one is in the input mode, so one can type one ideogram,
press tab and get another (or selection thereof). While the goals of xffm
& gqview may differ here (gqview's tab completetion is similar to a bash
shell, whereas xffm's is more akin to a web browser's), the unified input
method/completetion is already implemented and could be used as reference.


As far as my understanding of utf8 goes, it is multibyte, and can range
from one byte (like ascii) to up to six bytes depending on the glyph.
Here's my reference:
http://www-106.ibm.com/developerworks/linux/library/l-linuni.html

The difficult thing about japanese is that opposed to chinese (which
converts from roman letters straight to ideograms), japanese converts from
roman letters to the phonetic symbols of the hirogana, then from the
hirogana to kanji. Now as I don't understand japanese, the above may not
be entirely correct, but I have noticed the use of both space and enter
during character selection (at when least when using the input method:
kinput2). 

I'll see if I can do a little research on korean input (with which I've no
experience).

-----------------------------------------------------------------------
 edscott - 2004-07-21 01:00 GMT 
-----------------------------------------------------------------------
The GQview method sounds good but it might require substancial coding.
Alternately, xffm can begin with something simpler where almost all the
code is already in place: 
correct me where I am wrong.

Once you enter chinese input mode, you type a series of characters (I
suppose A-Z). On exiting chinese input mode, the associated ideogram
appears. A fairly easy implementation would create an ideogram history, so
that while you are doing the input for the ideogram, the autocompletion
will try to complete (in the A-Z format) and if a hit is produced, you
just have to exit chinese input mode for the ideogram to appear.

If, OTH, partial ideograms are drawn as you input from the keyboard, then
the autocompletion would be done only by selecting completed ideograms
from the dropdown menu that pops up as you type.

Does that sound logical to you?

-----------------------------------------------------------------------
 adrian440 - 2004-07-21 22:01 GMT 
-----------------------------------------------------------------------
Not sure on the former, but the latter is more sound. 
In chinese input mode, you type letters (lets say wo (means I)), a
selection box appears, and you select the correct character (as there are
usually many homophones) by pressing a number. Or they may select the
default by pressing space (but no space is actually inserted). Over time,
the input method might move certain characters up in the list (so their
number would change) depending on their frequency of use. So if wo is
entered, their might be 5 different characters to choose from, and the
number of selection will not be constant. Also, there are the words made
up of two or more characters. Here a user might type woshi, wo being one
character and shi being another. In typing them together the input method
may recognise them as the word for bedroom. 

I think it would be best if the autocompletion is done after the input
method returns the utf8 character, based on that utf8 character. Once an
input method is activated, the roman letters should no longer be utilised
for searching the auto-complete history. This sounds more like the second
option if I have understood you correctly (please correct me if I'm
wrong).



More information about the Xfce-bugs mailing list