[Uim] A problem using uim and anthy in KDE

Paul Hampson Paul.Hampson at anu.edu.au
Mon Feb 23 17:05:51 EET 2004


On Mon, Feb 23, 2004 at 11:16:18PM +0900, Yukiko Bando wrote:
> On Sun, 22 Feb 2004 21:29:35 +0100, David Oftedal <david at start.no> wrote:
> >>I have been trying to find out uim key usage by intuition, not knowing
> >>what is possible and what is not.  I was wondering if there was a page
> >>where one can learn all about it, something like this:
> >>http://www.mozilla.org/quality/intl/kinput2/kinput2keys.html

> >Perhaps we should make one...?

> Good idea!  I think it will be very helpful to people who use uim, or any  
> conversion input method, for the first time.  I was told that uim's key  
> usage was almost same as jmode's and found a how-to page* in Anthy Wiki,  
> but couple of key combinations don't seem to work.  Since uim and anthy is  
> going to be the default input method for Japanese in a major distribution,  
> maybe it's time to make a tutorial?  In my opinion, the page should  
> consist of three sections: Before entering conversion mode, In conversion  
> mode and How to get special characters.

Since the uim keys are processed using the scheme files in
/usr/share/uim, that'd be the first place to look. You want
generic-key.scm and the appropriate .scm file for your uim backend...

It's be amusing to write a program to turn the .scm files into
key definitions, but in the meantime here's the manual method.

They're written in scheme so it's prolly hard to get started. You're
looking for things like
(define keyjob
 (lambda (key keystate)
  (or
   ( one key setup )
   ( other key setup )
  )
 )
)

Where key setup looks like
(= (to-lower-char key) nn) and nn is the ascii value,
or it can look like
(and
 (= (to-lower-char key) nn)
 (control-key-mask key-state)
)
which indicates control and the key with ascii value nn.

It's easier when the ascii value is replaced with
a symbolic constand like 'return. I _think_ these
values come from keysymdef.h or some scheme equivalent,
but I couldn't make it recognise Menu_L (the left windows key)
by either symbolic constant or puported keysym.

example:
(define generic-return-key				<== Generic Return Key
  (lambda (key key-state)				<== don't worry about this
    (or									<== Either:
     (and (= (to-lower-char key) 109)	<==  both keysym 109 ('m')
      (control-key-mask key-state))		<==  and control key down
     (= key 'return))))					<== or: 'return'

Also, look at the example in the UIM FAQ about defining your
own key for a function. It's the same thing.

I expect the eventual key-configuration interface will just write
stanzas like the above into your .uim file.

For reference, uim-prime only adds six or so keys on top of the generic
set, of which only three are for prime-specific functions. (Well, not
actually prime-specific. Anthy uses almost exactly the same set, since
they deal with candidate-window and zenkaku romaji type-stuff, but not
_all_ UIM methods have them, eg IPA)

> >Type xwi to get wi,
> >xwe to get we,
> >z/ to get the kana middle dot,
> >shift+l to get zenkaku romaji

> I didn't know that.  Thank you.  What I have found so far is:

> xa, xi, xu, xe, xo to get samll a, i, u, e, o as in MS-IME.

These are up to your input software... I don't know about anthy, but
prime uses libsuikyo for it's romaji->kana conversion, which includes
(although not enabled by default) the 'egg' mark sets, also included in
kinput2. I assume there's an older input-method known as 'egg' which
first included this set. It basically causes z+ anything or Z+anything
to produce symbols. (Except z+vowel or z+y obviously)

(Anyone wanting this to work with prime, put the following in your
./prime/Custom_prime.rb file:
PRIME_ENV['suikyo_tables']         = ["romaji", "egg-mark"]
PRIME_ENV['suikyo_reverse_tables'] = ["romaji_reverse", "egg-mark_reverse"]
PRIME_ENV['suikyo_use_cache']      = true
replacing romaji with your preferred conversion table. The
default in 0.6.7 was romaji-kana/kana-romaji which appeared to be
older versions of romaji and romaji_reverse, possibly shipped by
accident after renaming?)

Worth noting is that 'z0-z9' are less useful that it might seem since
uim-prime takes those digits to pick from the cadidate list, which it
will quite happily pop up with a 'z' pending. Uim-Anthy shouldn't have
this problem as it doesn't pop up a candidate list until it has a
full match (I think).

Here's the egg-mark details from libsuikyo: I expect other Japanese
input methods provide a similar set of egg-mark romajis.
z/  ・
z.  …
z,  ‥
z1  ○
z!  ●
z2  ▽
z@  ▼
z3  △
z#  ▲
z4  □
z$  ■
z5  ◇
z%  ◆
z6  ☆
z^  ★
z7  ◎
z&  £
z8  ¢
z*  ×
z9  ♂
z(  【
z0  ♀
z)  】
z-  〜
z_  ∴
z=  ≠
z+  ±
z\\ \
z|  ‖
z`  ´
z~  ¨
zq  《
zQ  〈
zw  》
zW  〉
zr  々
zR  仝
zt  〆
zT  §
zp  〒
zP  ↑
z[  『
z{  〔
z]  』
z}  〕
zs  ヽ
zS  ヾ
zd  ゝ
zD  ゞ
zf  〃
zF  →
zg  ‐
zG  ―
zh  ←
zj  ↓
zk  ↑
zl  →
z;  ゛
z:  ゜
z'  ‘
z"  “
zx  :-
zX  :-)
zc  〇
zC  ℃
zv  ※
zV  ÷
zb  °
zB  ←
zn  ′
zN  ↓
zm  ″
zM  〓
z>  ≧
z?  ∞

> >And as with kinput2, shift-space enables or disables uim, space brings  
> >up candidate selection, arrow keys can be used to move back or forward  
> >during candidate selection, and shift + arrow keys can be used to  
> >broaden or narrow a selection during candidate selection.

> I could find them all by intuition.  ;-)

These can all by adjusted... For example, to stop shift-space from
flipping into UIM:
(These make only the Zenkaku-Hankaku key (or in theory Super_L but
it doesn't work!) activate or deactivate your input method.
Whack them in your .uim file, and restart uim-xim or open a new
GTK2 proggy.

(define generic-on-key
  (lambda (key key-state)
    (or
     (= key 'super_l)
     (= key 'zenkaku-hankaku))))
(define generic-off-key
  (lambda (key key-state)
    (or
     (= key 'super_l)
     (= key 'zenkaku-hankaku))))

Again thanks to the UIM FAQ for pointing me in the right
direction. I _think_ it was in the UIM Wikki off
anthy.sourcefoge.ne.jp but I don't remember for sure.

Wow, that email was longer than I intended. I hope it helps
people. :-)

-- 
-----------------------------------------------------------
Paul "TBBle" Hampson, MCSE
6th year CompSci/Asian Studies student, ANU
The Boss, Bubblesworth Pty Ltd (ABN: 51 095 284 361)
Paul.Hampson at Anu.edu.au

"No survivors? Then where do the stories come from I wonder?"
-- Capt. Jack Sparrow, "Pirates of the Caribbean"

This email is licensed to the recipient for non-commercial
use, duplication and distribution.
-----------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/uim/attachments/20040224/5784d264/attachment.pgp 


More information about the uim mailing list