shuaiqingli / fcitx

Automatically exported from code.google.com/p/fcitx
GNU General Public License v2.0
1 stars 0 forks source link

adding own locale #644

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. use fcitx switch in between pinyin input and keyboard input

What is the expected output? What do you see instead?
I would love to see my own locale "us_myown" used. Instead I see the us 
keyboardlayout. (i know, thats regular)

What version of the product are you using? On what operating system?
kubuntu 12.10 kde 4.9.3 fcitx 4.2.4.1.7

Please provide any additional information below.
I have since long used an own locale/xkb-layout "us_myown", so I can use my 
us-keyboard for input german üäöß on the third keyboard level (and more, 
like ㊀㊃㊇...). I didn't find a way to add this locale to fcitx config (via 
kde config>kcm-fcitx). I checked ~/.config/fcitx/profile, but was afraid to 
mess it up. Some people with special needs (music notes, mathematical 
characters...) may need this way to use an own xkb-layout for faster input of 
special characters. Checking the mentioned handbook didn't help. Any advice?

Great input method! I use it since two years. Thank you very much!
非常感谢, Marcus

Original issue reported on code.google.com by scottywellner@gmail.com on 19 Nov 2012 at 2:54

GoogleCodeExporter commented 8 years ago
Well, so I owner how you configure your own layout? AFAIK there is no way 
instead of modify the system xkb file, which is in /usr/share/X11/xkb/evdev.xml 
and /usr/share/X11/xkb/evdev.extra.xml (and seems you need to modify some more 
rules)

If you are doing it by hand (Which I mean some xmodmap script), you should 
check: http://fcitx-im.org/wiki/FAQ#xmodmap_settings_being_overwritten

There is an option inside the xkb addon, that let fcitx load your own xmodmap 
script.

Or, if you are only using this layout and only want fcitx distrub your setting, 
you can still simply disable fcitx-xkb addon, via GUI (fcitx-config-gtk, 
kcm-fcitx, which in ubuntu is called kde-config-fcitx), or --disable fcitx-xkb 
to start up command if you start it by hand.

Original comment by wen...@gmail.com on 19 Nov 2012 at 5:42

GoogleCodeExporter commented 8 years ago
Yes, there is a modified xkb file and defined to use it in xorg.conf.
Plus a changed evdev rule (added >Option    "XkbLayout"  "us_myown"< to section 
localkeyboard).
It's just an own keyboard layout. xmodmap didn't work good under all possible 
circumstances. It's mainly the us locale, but added some special keys.

I was not sure, where to find the fcitx-xkb, tried a lot but finally got the 
wanted.
Thank you!
Marcus

Original comment by scottywellner@gmail.com on 21 Nov 2012 at 1:09

Attachments:

GoogleCodeExporter commented 8 years ago
The problem is, if you want to use it, you need to describe it as an item in: 
/usr/share/X11/xkb/rules/evdev.xml / /usr/share/X11/xkb/rules/evdev.extras.xml

System can only obtain that from such list... xkb have some limitation, so 
usually, if you want to use some very custom (means not pre-defined function) 
xkb, you can always disable fcitx-xkb (name in GUI is "X keyboard integration" 
/ "X键盘集成"), since fcitx managed xkb setting will not benefit you much 
in that case.

Original comment by wen...@gmail.com on 24 Nov 2012 at 1:25

GoogleCodeExporter commented 8 years ago
I dont have any problem with the xkb, öüäß㊀㊁㊁㊂, all very nice :-)
But I still have a problem disabling the xkb takeover fcitx does, after I 
needed to install again fcitx. Now checking how to disable that.

I open 'Addon Config' > 'x keyboard integration' and have two choices:
'Allow to Override System XKB Settings' I disabled.
'Ignore Input Method Layout Request' is enabled.
For some reason that only works with keyboard-input-method enabled.

If I start fcitx is taking pinyin as input. 
But if I change with CTRL_Space I still have the classic UI now entering with 
my own xkb's German and after confirming with ENTER it is input in German. The 
result is the wanted, but I have to use fcitx keyboard input.
How can I just Switch on and of the IM, preferably with CTRL_Space?
I tried in 'Global Config' > 'Hotkey' with Trigger Input Method,Activate Input 
Method and Deactivate Input Method. I dont understand, what's the difference of 
trigger, activate and deactivate.
The idea behind the keyboard concept I understand and I think it's great, one 
could change between a lot of needed xkb.
Aktually if I would understand all the configurations I should translate it 
into german. I used fcitx two years now and are much more happy with it than 
before with ibus.

Original comment by scottywellner@gmail.com on 2 Dec 2012 at 7:25

GoogleCodeExporter commented 8 years ago
First as for disable it in all, check the "show advance option" in addon 
configuration, then you will see there is a check box in front of all addon, 
what I mean "disable" is to uncheck that check box.

The thing you need to make sure, is, before 4.2.6 (includng 4.2.6), if you 
disable that addon, the "Keyboard Input Method" will not be able to read the 
information from system, and will only leave a "Keyboard" entry in the list, 
just like some input method is uninstalled, it will be removed from the list, 
if your old input method list doesn't use "Keyboard - English (US)" as the 
first one.

If you don't mind I would start a little bit long story. For those keyboard, 
active ...

Once upon a time, there is three state of Fcitx, and the idea of "raw keyboard 
layout as input method" is not exist. This brought some inconsistency problem, 
since latter I found for Western user, every xkb layout is theirs input method, 
this is also how other OS (Windows, Mac) handle this.

Then I want to introduce the idea of "raw keyboard layout" as input method, 
which the addon "Keyboard Input Method" (we call it fcitx-keyboard later) in 
fcitx offer. But, every other input method, should also have a default xkb 
layout, for example, Pinyin might should en_us by default, thus there comes 
another separate addon in Fcitx, "X Keyboard Integration" (we call it fcitx-xkb 
later).

Now how they works? When one input method is being switched to (Switch to 
Pinyin, or switch to Keyboard), it request a keyboard layout, and fcitx-xkb ask 
X to change the keyboard layout.

How fcitx know what layouts are registered in system? It read the rules file 
(the xml file I pointed to). So that's the reason if you don't register it with 
the xml (but only with the rules file you're using), fcitx cannot know your 
us_override.

If you want to use it that way, you should disable fcitx-xkb. And what do those 
two confusing options do (I admit, it's every confusing, and even I cannot 
remember what it really means if I don't review the code).
1. Ignore Input Method Layout Request -> Ignore the layout request from all 
input method in spite of those from "fcitx-keyboard".
Useful if you're: 1) only use one layout, 2) the layout is not the default 
layout for the non-native language one you're using. For example, using jp with 
Pinyin is acceptable, but Pinyin ask for en-us, so this option can ignore such 
request, and keep using jp for all "non-keyboard input method".

But still, you can keep this option disabled, and using the "override layout" 
for specific input method (config UI->input method list page->configure one 
input method->select layout other than "Input Method Default")

2. Allow to Override System XKB Settings -> this is more trivial... it will 
only ask for change to layout configuration in the system list. I just leave it 
there in early dev stage.. but now I can't even thing a useful case for this.

Now back to "active" and "inactive" story.

As you might know, Chinese people are quite frequently using Chinese with 
English, so there use to be a "temporary English mode", but that means all 
input method will need to implement such "temporary mode", which duplicates the 
code, and may cause functional inconsistency. So I change to a new way for 
handle this.

This idea comes from following idea:
For normal People, they use at most only two language at the same time (This 
doesn't ignore the idea that people can use more than two languages, but the 
key point is "same time", which means inside the same window or same context).

So not like the mac os "alt-tab-like" behavior, fcitx always jump between two 
input method. The "first" in the list, and the current one. Basically, the 
inactive means "switch to the first in the list", active means "switch to the 
current one in the list".

Hope that make things more clear. So for your setup, I think the right way to 
satisfy you requirement is:
1. disable fcitx-xkb (then restart fcitx)
2. Change the input method list to
- Keyboard (<- keep this in the first place)
- Pinyin
(You can also add other thing you need).

As for translation, you can also help with it:
https://www.transifex.com/projects/p/fcitx/language/de_DE/
Register an account, request join the team, and do the translation just on the 
website.
If you have any question (usage, or translation if you want to help), you can 
always ask it on fcitx at googlegroups.com (by send email to this address).

Original comment by wen...@gmail.com on 2 Dec 2012 at 8:32

GoogleCodeExporter commented 8 years ago
Thanks a lot for all your explanations! Following your advise I did add my xkb 
layout into /usr/share/X11/xkb/rules/evdev.extras.xml. Now the locale shows up 
in the list of layouts in kde-config-fcitx. This part of the problem was not 
related to fcitx.

The second part of the problem I still dont know how to solve. 
Fcitx is showing the interface (in my case the Classic one), no matter if I am 
using input method 1 (now keyboard using my own xkb) or input method 2 (Google 
Pinyin).
Using the Kmenu for example I have to hit ENTER first to make fcitx input the 
string into Kmenu and than hit ENTER again, to make the Kmenu run the command. 
(like you can see at the attached picture) Same with console, bash etc. of 
course. Using former versions of fcitx SHIFT+SPACE were working as ON/OFF input 
method 1, now it's ON1/ON2.
I might have missed a possible configuration again. Maybe you could help with 
more advice.

Original comment by scottywellner@gmail.com on 12 Dec 2012 at 8:16

Attachments:

GoogleCodeExporter commented 8 years ago
Well, as I explained, switch "on/off" is not the current case.
The "off" is 1, and "on" is something other than one.

This change introduced in 4.2.4.
For example, before 4.2.4
You have only google pinyin in your list.

Then after 4.2.4
You should have:
Keyboard - English (US)  <- Off
Googlepinyin <- On
(This is automatically done upon upgrades)

Since the "real off" is gone, and it's replaced by a actual input method, which 
is the FIRST one in the list.
So if you still ONLY have Googlepinyin in your list, you will not be able to 
turn it off.

Original comment by wen...@gmail.com on 12 Dec 2012 at 3:23

GoogleCodeExporter commented 8 years ago
Thank you very much for your reply. I do understand, that this makes sense for 
everyone, regulary using CJK input and less using latin characters. I earlier 
thought the new behavior would come from that background. And I want to say, I 
find it very good in one aspect. For example people might easily input 汉语 
and 维语. It gives very much options for using a lot if input methods 
(parallel) and this way is a great contribution to make computer technology 
usable for everybody.

However, a preview of the entered string does only make sense, if your keyboard 
is not having the characters you need to input. For people mainly needing latin 
characters, its changing the input behavior very radical for their regulary 
used input. 

I myself are not able to write a plugin, I dont understand the whole system of 
input technology. So I can only give this comment. However, it might be 
possible to have some kind of dummy input method which would show the behavior 
OFF (not showing the interface and direct input.

Kind regards,
Marcus

Original comment by scottywellner@gmail.com on 13 Dec 2012 at 1:08

GoogleCodeExporter commented 8 years ago
It should not like that actually, can you explain what you actually do to 
produce this screen shot?

As far as I remember, the only way to trigger something like your screen shot 
is:
1. When you're using pinyin, and Use "upper case", from the screenshot seems 
it's not this case.
2. When you're using any "keyboard - XXX", and enable the word completion with 
"ctrl+alt+h", this will only word if you have corresponding dictionary 
installed, which seems is also not the case (since if it works, there should be 
some candidate like http://fcitx-im.org/wiki/File:Fcitx-Keyboard.png )
3. When you're using pinyin and press semicolon, which will trigger this 
plugin: http://fcitx-im.org/wiki/QuickPhrase , which should have some 
description string.

I'm really a little bit confusing in what case can you trigger something like 
this screenshot.

Can you explain the key sequence to trigger this screen shot?...

I guess it's keyboard with no word hint.. (case 2, not very sure..), which I 
cannot reproduce right now.. I'm not sure if it's a 4.2.4 specific behavior, 
which is changed later..

---PLEASE PAY ATTENTION TO FOLLOWING LINE SINCE I GUESS YOU MAY ONLY NEED TO 
KNOW THIS--------
Anyway if there is something wrong you can turn it off by ctrl+alt+H.
--------------SORRY FOR LONG REPLY FLOOD :P----------------

And let me explain the latest behavior.
1. Currently , this word completion for "keyboard -" is per input context (you 
can understand it as per window), means you enable it in firefox, it will not 
enabled in kwrite. (changed 4.2.5 / 4.2.6, I don't remember), which in 4.2.4 is 
a "global" state.

2. If word completion is enabled, enter will just be normal enter (changed in 
4.2.6), option is there since 4.2.4.. you can change it by any configtool. so 
no extra enter is required.

And I agree there is duplicate preedit in client window and in input window, 
But partly due to UI limitation, the dup preedit is on purpose. The limitation 
is partly resolved, which I guess I can hide it now.

And let me mark this invalid first... since the original report is no longer 
valid.

Original comment by wen...@gmail.com on 13 Dec 2012 at 2:00

GoogleCodeExporter commented 8 years ago
to 1) Yes, I haven't choosen the installed Aspell dictionary. Now it's working 
like http://fcitx-im.org/wiki/File:Fcitx-Keyboard.png (Attached ON)

to 2) I changed Systemconfig > Locale > fcitx > Addon Config > Keyboard Input 
Method > "Enable word hint if available" to false. Now I have direct input 
(Attached OFF)

Now I can input without the UI, the behavior I wanted. So it has never been a 
unwanted behavior or bug, just configuration problems.
Thank you very much for all you help!

Original comment by scottywellner@gmail.com on 13 Dec 2012 at 9:29

Attachments: