diff -ru uim-1.0.1.orig/scm/anthy.scm uim-1.0.1/scm/anthy.scm --- uim-1.0.1.orig/scm/anthy.scm 2005-12-07 21:39:30.000000000 +0900 +++ uim-1.0.1/scm/anthy.scm 2006-05-01 14:13:40.000000000 +0900 @@ -485,36 +485,58 @@ (define anthy-proc-transposing-state (lambda (ac key key-state) - (cond - ((anthy-transpose-as-hiragana-key? key key-state) - (anthy-context-set-transposing-type! ac anthy-type-hiragana)) + (let (rotate-list state) + (if (anthy-transpose-as-wide-latin-key? key key-state) + (set! rotate-list (cons anthy-type-wide-latin rotate-list))) + (if (anthy-transpose-as-latin-key? key key-state) + (set! rotate-list (cons anthy-type-latin rotate-list))) + (if (anthy-transpose-as-hankana-key? key key-state) + (set! rotate-list (cons anthy-type-hankana rotate-list))) + (if (anthy-transpose-as-katakana-key? key key-state) + (set! rotate-list (cons anthy-type-katakana rotate-list))) + (if (anthy-transpose-as-hiragana-key? key key-state) + (set! rotate-list (cons anthy-type-hiragana rotate-list))) + + (if (anthy-context-transposing ac) + (or (set! state + (car (cdr (member + (anthy-context-transposing-type ac) + rotate-list)))) + (set! state (car rotate-list))) + (begin + (anthy-context-set-transposing! ac #t) + (set! state (car rotate-list)))) - ((anthy-transpose-as-katakana-key? key key-state) - (anthy-context-set-transposing-type! ac anthy-type-katakana)) + (cond + ((= state anthy-type-hiragana) + (anthy-context-set-transposing-type! ac anthy-type-hiragana)) - ((anthy-transpose-as-hankana-key? key key-state) - (anthy-context-set-transposing-type! ac anthy-type-hankana)) + ((= state anthy-type-katakana) + (anthy-context-set-transposing-type! ac anthy-type-katakana)) - ((anthy-transpose-as-latin-key? key key-state) - (if (not (= (anthy-context-input-rule ac) - anthy-input-rule-kana)) - (anthy-context-set-transposing-type! ac anthy-type-latin))) - - ((anthy-transpose-as-wide-latin-key? key key-state) - (if (not (= (anthy-context-input-rule ac) - anthy-input-rule-kana)) - (anthy-context-set-transposing-type! ac anthy-type-wide-latin))) + ((= state anthy-type-hankana) + (anthy-context-set-transposing-type! ac anthy-type-hankana)) - (else - (begin - ; commit - (im-commit ac (anthy-transposing-text ac)) - (anthy-flush ac) - (if (not (anthy-commit-key? key key-state)) - (begin - (anthy-context-set-transposing! ac #f) - (anthy-proc-input-state ac key key-state) - (anthy-context-set-commit-raw! ac #f)))))))) + ((= state anthy-type-latin) + (if (not (= (anthy-context-input-rule ac) + anthy-input-rule-kana)) + (anthy-context-set-transposing-type! ac anthy-type-latin))) + + ((= state anthy-type-wide-latin) + (if (not (= (anthy-context-input-rule ac) + anthy-input-rule-kana)) + (anthy-context-set-transposing-type! ac anthy-type-wide-latin))) + + (else + (begin + ; commit + (im-commit ac (anthy-transposing-text ac)) + (anthy-flush ac) + (if (not (anthy-commit-key? key key-state)) + (begin + (anthy-context-set-transposing! ac #f) + (anthy-proc-input-state ac key key-state) + (anthy-context-set-commit-raw! ac #f))))))))) (define anthy-proc-input-state-with-preedit (lambda (ac key key-state) @@ -567,9 +589,7 @@ (anthy-transpose-as-hankana-key? key key-state) (anthy-transpose-as-latin-key? key key-state) (anthy-transpose-as-wide-latin-key? key key-state)) - (begin - (anthy-context-set-transposing! ac #t) - (anthy-proc-transposing-state ac key key-state))) + (anthy-proc-transposing-state ac key key-state)) ;; Commit current preedit string, then toggle hiragana/katakana mode. ((anthy-kana-toggle-key? key key-state) @@ -905,6 +925,15 @@ ((anthy-prev-candidate-key? key key-state) (anthy-move-candidate ac -1)) + ((or (anthy-transpose-as-hiragana-key? key key-state) + (anthy-transpose-as-katakana-key? key key-state) + (anthy-transpose-as-hankana-key? key key-state) + (anthy-transpose-as-latin-key? key key-state) + (anthy-transpose-as-wide-latin-key? key key-state)) + (begin + (anthy-cancel-conv ac) + (anthy-proc-transposing-state ac key key-state))) + ((anthy-cancel-key? key key-state) (anthy-cancel-conv ac)) diff -ru uim-1.0.1.orig/scm/canna.scm uim-1.0.1/scm/canna.scm --- uim-1.0.1.orig/scm/canna.scm 2005-12-16 17:09:46.000000000 +0900 +++ uim-1.0.1/scm/canna.scm 2006-05-01 14:19:11.000000000 +0900 @@ -391,23 +391,41 @@ (define canna-proc-transposing-state (lambda (cc key key-state) - (cond - ((canna-transpose-as-hiragana-key? key key-state) - (canna-context-set-transposing-type! cc multi-segment-type-hiragana)) + (let (rotate-list state) + (if (canna-transpose-as-hankana-key? key key-state) + (set! rotate-list (cons multi-segment-type-hankana rotate-list))) + (if (canna-transpose-as-katakana-key? key key-state) + (set! rotate-list (cons multi-segment-type-katakana rotate-list))) + (if (canna-transpose-as-hiragana-key? key key-state) + (set! rotate-list (cons multi-segment-type-hiragana rotate-list))) + + (if (canna-context-transposing cc) + (or (set! state + (car (cdr (member + (canna-context-transposing-type cc) + rotate-list)))) + (set! state (car rotate-list))) + (begin + (canna-context-set-transposing! cc #t) + (set! state (car rotate-list)))) + + (cond + ((= state multi-segment-type-hiragana) + (canna-context-set-transposing-type! cc multi-segment-type-hiragana)) - ((canna-transpose-as-katakana-key? key key-state) - (canna-context-set-transposing-type! cc multi-segment-type-katakana)) + ((= state multi-segment-type-katakana) + (canna-context-set-transposing-type! cc multi-segment-type-katakana)) - ((canna-transpose-as-hankana-key? key key-state) - (canna-context-set-transposing-type! cc multi-segment-type-hankana)) + ((= state multi-segment-type-hankana) + (canna-context-set-transposing-type! cc multi-segment-type-hankana)) - (else - (begin - ; commit - (im-commit cc (canna-transposing-text cc)) - (canna-flush cc) - (if (not (canna-commit-key? key key-state)) - (canna-proc-input-state cc key key-state))))))) + (else + (begin + ; commit + (im-commit cc (canna-transposing-text cc)) + (canna-flush cc) + (if (not (canna-commit-key? key key-state)) + (canna-proc-input-state cc key key-state)))))))) (define (canna-proc-input-state-with-preedit cc key key-state) (let* ((rkc (canna-context-rkc cc)) @@ -469,7 +487,6 @@ (canna-transpose-as-hankana-key? key key-state)) (begin (canna-context-confirm-kana! cc) - (canna-context-set-transposing! cc #t) (canna-proc-transposing-state cc key key-state))) ;; 現在のかなを確定後、ひらがな/カタカナモードを切り換える @@ -828,6 +845,15 @@ ((canna-prev-candidate-key? key key-state) (canna-move-candidate cc -1)) + ((or (canna-transpose-as-hiragana-key? key key-state) + (canna-transpose-as-katakana-key? key key-state) + (canna-transpose-as-hankana-key? key key-state)) + (begin + (canna-context-set-state! cc #f) + (canna-reset-candidate-window cc) + (canna-lib-reset-conversion cc-id) + (canna-proc-transposing-state cc key key-state))) + ((canna-cancel-key? key key-state) (begin (canna-context-set-state! cc #f) diff -ru uim-1.0.1.orig/scm/mana.scm uim-1.0.1/scm/mana.scm --- uim-1.0.1.orig/scm/mana.scm 2005-12-07 21:39:30.000000000 +0900 +++ uim-1.0.1/scm/mana.scm 2006-05-01 14:31:53.000000000 +0900 @@ -641,36 +641,58 @@ (define mana-proc-transposing-state (lambda (mc key key-state) - (cond - ((mana-transpose-as-hiragana-key? key key-state) - (mana-context-set-transposing-type! mc mana-type-hiragana)) + (let (rotate-list state) + (if (mana-transpose-as-wide-latin-key? key key-state) + (set! rotate-list (cons mana-type-wide-latin rotate-list))) + (if (mana-transpose-as-latin-key? key key-state) + (set! rotate-list (cons mana-type-latin rotate-list))) + (if (mana-transpose-as-hankana-key? key key-state) + (set! rotate-list (cons mana-type-hankana rotate-list))) + (if (mana-transpose-as-katakana-key? key key-state) + (set! rotate-list (cons mana-type-katakana rotate-list))) + (if (mana-transpose-as-hiragana-key? key key-state) + (set! rotate-list (cons mana-type-hiragana))) + + (if (mana-context-transposing mc) + (or (set! state + (car (cdr (member + (mana-context-transposing-type mc) + rotate-list)))) + (set! state (car rotate-list))) + (begin + (mana-context-set-transposing! mc #t) + (set! state (car rotate-list)))) - ((mana-transpose-as-katakana-key? key key-state) - (mana-context-set-transposing-type! mc mana-type-katakana)) + (cond + ((= state mana-type-hiragana) + (mana-context-set-transposing-type! mc mana-type-hiragana)) - ((mana-transpose-as-hankana-key? key key-state) - (mana-context-set-transposing-type! mc mana-type-hankana)) + ((= state mana-type-katakana) + (mana-context-set-transposing-type! mc mana-type-katakana)) - ((mana-transpose-as-latin-key? key key-state) - (if (not (= (mana-context-input-rule mc) - mana-input-rule-kana)) - (mana-context-set-transposing-type! mc mana-type-latin))) - - ((mana-transpose-as-wide-latin-key? key key-state) - (if (not (= (mana-context-input-rule mc) - mana-input-rule-kana)) - (mana-context-set-transposing-type! mc mana-type-wide-latin))) + ((= state mana-type-hankana) + (mana-context-set-transposing-type! mc mana-type-hankana)) - (else - (begin - ; commit - (im-commit mc (mana-transposing-text mc)) - (mana-flush mc) - (if (not (mana-commit-key? key key-state)) - (begin - (mana-context-set-transposing! mc #f) - (mana-proc-input-state mc key key-state) - (mana-context-set-commit-raw! mc #f)))))))) + ((= state mana-type-latin) + (if (not (= (mana-context-input-rule mc) + mana-input-rule-kana)) + (mana-context-set-transposing-type! mc mana-type-latin))) + + ((= state mana-type-wide-latin) + (if (not (= (mana-context-input-rule mc) + mana-input-rule-kana)) + (mana-context-set-transposing-type! mc mana-type-wide-latin))) + + (else + (begin + ; commit + (im-commit mc (mana-transposing-text mc)) + (mana-flush mc) + (if (not (mana-commit-key? key key-state)) + (begin + (mana-context-set-transposing! mc #f) + (mana-proc-input-state mc key key-state) + (mana-context-set-commit-raw! mc #f))))))))) (define mana-proc-input-state-with-preedit (lambda (mc key key-state) @@ -723,9 +745,7 @@ (mana-transpose-as-hankana-key? key key-state) (mana-transpose-as-latin-key? key key-state) (mana-transpose-as-wide-latin-key? key key-state)) - (begin - (mana-context-set-transposing! mc #t) - (mana-proc-transposing-state mc key key-state))) + (mana-proc-transposing-state mc key key-state)) ;; Commit current preedit string, then toggle hiragana/katakana mode. ((mana-kana-toggle-key? key key-state) @@ -1056,6 +1076,15 @@ ((mana-prev-candidate-key? key key-state) (mana-move-candidate mc -1)) + ((or (mana-transpose-as-hiragana-key? key key-state) + (mana-transpose-as-katakana-key? key key-state) + (mana-transpose-as-hankana-key? key key-state) + (mana-transpose-as-latin-key? key key-state) + (mana-transpose-as-wide-latin-key? key key-state)) + (begin + (mana-cancel-conv mc) + (mana-proc-transposing-state mc key key-state))) + ((mana-cancel-key? key key-state) (mana-cancel-conv mc))