[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[m17n-lib:00344] mim syntax: mapping XKB non-ascii to non-ascii



Hi,

thanks for this great library, first of all. I am using it as SCIM
backend (version 1.2.0.5, ubuntu dapper).

I would like to write a mim that would map "Ã" (a acute, written
directly on Czech keyboard, through XKB) to "Ä" (a macron, classical
latin) and similarly for other accented vowels. The trivial approach is
(map (trans ("Ã" "Ä") )) but such a map is ignored by m17n-lib (that
is, if I add this mapping to e.g. latin-post.mim, it is not available). Why?

m17n-lib documentation says:

MTEXT in the definition of KEYSEQ consists of characters that can be
generated by a keyboard. Therefore MTEXT usually contains only ASCII
characters. However, if the input method is intended to be used, for
instance, with a West European keyboard, MTEXT may contain Latin-1
characters.

My questions are:

1. What are the reasons of that restriction? Is there no way to get
extra-Latin1 chars from XKB reliably? I looked at the source (IIRC
input.c), the function checks that string_len = no_of_bytes (i.e. no
UTF-8, ASCII<128), otherwise aborts.

2. How can I achieve the map I described, apart from simulating the
whole czech layout on english keyboard and mapping 8âÄ etc.? (BTW, it is
apparently only possible to use ASCII with native scim tables, therefore
I turned to m17n)

2a. The syntax is "KEYSEQ ::= MTEXT | '(' [ SYMBOL | INTEGER ] * ')'".
How do I find out what symbol / what integer is the one for "Ã" in X11
and how to write the map then?

Documentation says
SYMBOL in the definition of KEYSEQ must be the return value of the minput_event_to_key() function.
and
INTEGER in the definition of KEYSEQ must be a valid character code.
I tried putting (0x00e1) (unicode position of 'Ã'), (0x3c 0xa1) which is
what xev report (XLookupString gives 2 bytes: (c3 a1) "Ã"), neither of
them works.

2b. What is the difference between (map (trans ("Ã" "Ä"))) and (map
(trans "Ã" ?Ä))?

3. Is there a command-line way to find out which mim's are accepted by
m17n apart from launching scim and looking if the IM is listed among
available IMs by scim-setup? (perhaps a debugging env variable?)

Thanks for your help, do not hesitate to ask additional information.

VÃclav Åmilauer