[uim-commit] r755 - branches/composer/scm
yamaken at freedesktop.org
yamaken at freedesktop.org
Sun Mar 6 04:08:53 PST 2005
Author: yamaken
Date: 2005-03-06 04:08:51 -0800 (Sun, 06 Mar 2005)
New Revision: 755
Added:
branches/composer/scm/event-translator.scm
branches/composer/scm/key-custom.scm
Modified:
branches/composer/scm/anthy.scm
branches/composer/scm/evmap.scm
branches/composer/scm/im-custom.scm
branches/composer/scm/ng-key.scm
Log:
* This commit adds experimental modifier translation which enables
ordinary key into arbitrary modifier key and modifier key into
ordinary one. Since it is really experimental, currently available
features are useless and implementation is unnatural. It will be
replaced with the composer framework once experimented enough.
* scm/evmap.scm
- (combinational-shift-ruleset, sticky-shift-ruleset,
shift-lock-ruleset, qwerty-shift->space-ruleset,
jp106-henkan-muhenkan->shift-ruleset,
ja-nicola-jp106-pseudo-thumb-shift-ruleset,
key-event-translator-ruleset, key-event-translator-ruletree,
key-event-translator-new, key-event-translator-translate!): Move
to event-translator.scm
* scm/event-translator.scm
- New file
- (combinational-shift-ruleset, sticky-shift-ruleset,
shift-lock-ruleset, ja-nicola-jp106-pseudo-thumb-shift-ruleset,
key-event-translator-ruletree, key-event-translator-new): Moved
from evmap.scm
- (qwerty-shift->space-ruleset,
jp106-henkan-muhenkan->shift-ruleset):
* Moved from evmap.scm
* Modify rule expressions to fit to new modifier translation
method
- (key-event-translator-ruleset):
* Moved from evmap.scm
* Fix a variable name typo
- (key-event-translator-translate!):
* Moved from evmap.scm
* Make returning action symbols
* scm/anthy.scm
- Add require event-translator.scm
- (anthy-register-std-action, anthy-set-mod-state-handler,
anthy-reset-mod-state-handler, anthy-register-modifier-action):
New procedure
- Register actions for modifier translator action_set_shift_l_state,
action_reset_shift_l_state, and so on for all modifiers
- (anthy-register-per-state-action): Simplify with
anthy-register-std-action
- (anthy-context-rec-spec): Add new member mod-state, mod-lock and
mod-stick
- (anthy-input!): Remove an unused local variable
- (anthy-key-handler): Add modifier translation handlings
* scm/im-custom.scm
- (custom-group keyboard, custom-group keyboard-env, custom-group
keyboard-translation, custom system-physical-keyboard-type, custom
system-logical-key-mapping, custom key-event-basic-translator,
custom enable-jp106-henkan-muhenkan-shift?, custom
enable-ja-nicola-jp106-pseudo-thumb-shift?, custom
enable-qwerty-shift->space?, custom
inspect-key-event-translation?): Move to key-custom.scm
* scm/key-custom.scm
- New file
- (custom-group keyboard, custom-group keyboard-env, custom-group
keyboard-translation, custom system-physical-keyboard-type, custom
system-logical-key-mapping, custom key-event-basic-translator,
custom enable-jp106-henkan-muhenkan-shift?, custom
enable-ja-nicola-jp106-pseudo-thumb-shift?, custom
enable-qwerty-shift->space?, custom
inspect-key-event-translation?): Moved from im-custom.scm
- (custom-group modifier1, custom-group modifier2, custom-group
modifier-sticky, custom-group modifier-lock): New custom group
- (custom enable-modifier-translation?, custom use-sticky-shift?,
custom use-sticky-control?, custom use-sticky-alt?, custom
use-sticky-meta?, custom use-sticky-super?, custom
use-sticky-hyper?, custom use-combinational-shift?, custom
use-shift-lock?, custom shift-lock-count, custom
use-control-lock?, custom control-lock-count, custom
use-alt-lock?, custom alt-lock-count, custom use-meta-lock?,
custom meta-lock-count, custom use-super-lock?, custom
super-lock-count, custom use-hyper-lock?, custom
hyper-lock-count): New custom variable
* scm/ng-key.scm
- Add require-custom key-custom.scm
Modified: branches/composer/scm/anthy.scm
===================================================================
--- branches/composer/scm/anthy.scm 2005-03-05 21:56:58 UTC (rev 754)
+++ branches/composer/scm/anthy.scm 2005-03-06 12:08:51 UTC (rev 755)
@@ -34,6 +34,7 @@
(require "ustr.scm")
(require "event.scm")
(require "evmap.scm")
+(require "event-translator.scm")
(require "legacy-api-bridge.scm")
(require "ng-japanese.scm")
(require-custom "generic-key-custom.scm")
@@ -148,13 +149,19 @@
(set! anthy-valid-actions (cons id anthy-valid-actions)))
(register-action id indication-handler activity-pred handler)))
-(define anthy-register-per-state-action
- (lambda (id label short-desc)
+(define anthy-register-std-action
+ (lambda (id label short-desc handler)
(anthy-register-action id
(anthy-std-indication-handler label short-desc)
#f
- (anthy-per-state-action-handler id))))
+ handler)))
+(define anthy-register-per-state-action
+ (lambda (id label short-desc)
+ (anthy-register-std-action id
+ label
+ short-desc
+ (anthy-per-state-action-handler id))))
(anthy-register-per-state-action 'action_anthy_on
"On"
@@ -291,6 +298,55 @@
(anthy-register-candidate-actions)
+(define anthy-set-mod-state-handler
+ (lambda (mod)
+ (lambda (ac)
+ (let ((mod-state (bitwise-or (anthy-context-mod-state ac)
+ mod)))
+ (puts "anthy-set-mod-state-handler: ")
+ (print mod-state)
+ (anthy-context-set-mod-state! ac mod-state)))))
+
+(define anthy-reset-mod-state-handler
+ (lambda (mod)
+ (lambda (ac)
+ (let ((mod-state (bitwise-and (anthy-context-mod-state ac)
+ (bitwise-not mod))))
+ (puts "anthy-reset-mod-state-handler: ")
+ (print mod-state)
+ (anthy-context-set-mod-state! ac mod-state)))))
+
+(define anthy-register-modifier-action
+ (lambda (mod-sym act-sym)
+ (let* ((mod-str (symbol->string mod-sym))
+ (mod-var (symbol-value mod-sym))
+ (set-label (string-append "Set " mod-str " state"))
+ (reset-label (string-append "Reset " mod-str " state"))
+ (set-act-sym (symbolconc 'action_set_ act-sym '_state))
+ (reset-act-sym (symbolconc 'action_reset_ act-sym '_state)))
+ (anthy-register-std-action set-act-sym
+ set-label
+ set-label
+ (anthy-set-mod-state-handler mod-var))
+ (anthy-register-std-action reset-act-sym
+ reset-label
+ reset-label
+ (anthy-reset-mod-state-handler mod-var)))))
+
+(anthy-register-modifier-action 'mod_Shift_L 'shift_l)
+(anthy-register-modifier-action 'mod_Shift_R 'shift_r)
+(anthy-register-modifier-action 'mod_Control_L 'control_l)
+(anthy-register-modifier-action 'mod_Control_R 'control_r)
+(anthy-register-modifier-action 'mod_Alt_L 'alt_l)
+(anthy-register-modifier-action 'mod_Alt_R 'alt_r)
+(anthy-register-modifier-action 'mod_Meta_L 'meta_l)
+(anthy-register-modifier-action 'mod_Meta_R 'meta_r)
+(anthy-register-modifier-action 'mod_Super_L 'super_l)
+(anthy-register-modifier-action 'mod_Super_R 'super_r)
+(anthy-register-modifier-action 'mod_Hyper_L 'hyper_l)
+(anthy-register-modifier-action 'mod_Hyper_R 'hyper_r)
+
+
(define anthy-prepare-activation
(lambda (ac)
(anthy-flush ac)
@@ -652,9 +708,12 @@
(list 'wide-latin #f)
(list 'kana-mode anthy-type-hiragana)
(list 'input-rule anthy-input-rule-roma)
- (list 'ruletree #f)
- (list 'keytrans-emc #f) ;; evmap-context for key-event translator
- (list 'actmap-emc #f)))) ;; evmap-context for action mapper
+ (list 'ruletree #f) ;; current composition rule
+ (list 'keytrans-emc #f) ;; evmap-context for key-event translator
+ (list 'actmap-emc #f) ;; evmap-context for action mapper
+ (list 'mod-state mod_None) ;; regenerated modifier state
+ (list 'mod-lock mod_None) ;; modifier lock state
+ (list 'mod-stick mod_None)))) ;; sticky modifier state
(define-record 'anthy-context anthy-context-rec-spec)
(define anthy-context-new-internal anthy-context-new)
@@ -723,8 +782,7 @@
(define anthy-input!
(lambda (ac ev)
- (let ((ruletree (anthy-context-ruletree ac))
- (actmap-emc (anthy-context-actmap-emc ac)))
+ (let ((actmap-emc (anthy-context-actmap-emc ac)))
(if (evmap-context-input! actmap-emc ev)
(if (evmap-context-complete? actmap-emc)
(begin
@@ -1246,11 +1304,26 @@
(define anthy-key-handler
(lambda (ac key key-state press?)
- (let ((ev (legacy-key->key-event key key-state press?))
- (keytrans-emc (anthy-context-keytrans-emc ac)))
-
- (key-event-print-inspected "key-event: " ev)
- (key-event-translator-translate! keytrans-emc ev)
+ (let* ((ev (legacy-key->key-event key key-state press?))
+ (keytrans-emc (anthy-context-keytrans-emc ac))
+ (act-seq (begin
+ (key-event-print-inspected "key-event: " ev)
+ (key-event-translator-translate! keytrans-emc ev))))
+ (if act-seq
+ (for-each (lambda (act-id)
+ (and (symbol? act-id)
+ (anthy-activate-action! ac act-id)))
+ act-seq))
+ (if enable-modifier-translation?
+ (begin
+ (key-event-set-modifier! ev
+ (bitwise-or (key-event-modifier ev)
+ (anthy-context-mod-state ac)
+ (anthy-context-mod-lock ac)
+ (anthy-context-mod-stick ac)))
+ (if (modifier-match? mod_Shift
+ (key-event-modifier ev))
+ (key-event-char-upcase! ev))))
(key-event-print-inspected "translated: " ev)
(anthy-input! ac ev)
Added: branches/composer/scm/event-translator.scm
===================================================================
--- branches/composer/scm/event-translator.scm 2005-03-05 21:56:58 UTC (rev 754)
+++ branches/composer/scm/event-translator.scm 2005-03-06 12:08:51 UTC (rev 755)
@@ -0,0 +1,154 @@
+;;; event-translator.scm: Event translator
+;;;
+;;; Copyright (c) 2005 uim Project http://uim.freedesktop.org/
+;;;
+;;; All rights reserved.
+;;;
+;;; Redistribution and use in source and binary forms, with or without
+;;; modification, are permitted provided that the following conditions
+;;; are met:
+;;; 1. Redistributions of source code must retain the above copyright
+;;; notice, this list of conditions and the following disclaimer.
+;;; 2. Redistributions in binary form must reproduce the above copyright
+;;; notice, this list of conditions and the following disclaimer in the
+;;; documentation and/or other materials provided with the distribution.
+;;; 3. Neither the name of authors nor the names of its contributors
+;;; may be used to endorse or promote products derived from this software
+;;; without specific prior written permission.
+;;;
+;;; THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+;;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+;;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+;;; ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+;;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+;;; OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+;;; HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+;;; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+;;; OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+;;; SUCH DAMAGE.
+;;;;
+
+
+(require "util.scm")
+(require "event.scm")
+(require "ng-key.scm")
+(require "evmap.scm")
+
+;;
+;; key-event translator
+;;
+
+;; should be moved into appropriate file
+
+(define combinational-shift-ruleset
+ '((((char-alphabet press) (char-alphabet press))
+ ((($1 char-upcase mod_shift loopback)) (($2 loopback))))))
+
+;; TODO:
+;; - support arbitrary set of modifiers
+;; - support non-alphabet chars
+(define sticky-shift-ruleset
+ '(((lkey_Shift_L char-alphabet) (($3 char-upcase mod_Shift_L loopback)
+ ($4 char-upcase mod_Shift_L loopback)))
+ ((lkey_Shift_R char-alphabet) (($3 char-upcase mod_Shift_R loopback)
+ ($4 char-upcase mod_Shift_R loopback)))))
+
+(define shift-lock-ruleset
+ '(((lkey_Shift_L lkey_Shift_L) (action_toggle_shift_lock_l))
+ ((lkey_Shift_R lkey_Shift_R) (action_toggle_shift_lock_r))))
+
+(define control-lock-ruleset
+ '(((lkey_Control_L lkey_Control_L) (action_toggle_control_lock_l))
+ ((lkey_Control_R lkey_Control_R) (action_toggle_control_lock_r))))
+
+(define alt-lock-ruleset
+ '(((lkey_Alt_L lkey_Alt_L) (action_toggle_alt_lock_l))
+ ((lkey_Alt_R lkey_Alt_R) (action_toggle_alt_lock_r))))
+
+(define meta-lock-ruleset
+ '(((lkey_Meta_L lkey_Meta_L) (action_toggle_meta_lock_l))
+ ((lkey_Meta_R lkey_Meta_R) (action_toggle_meta_lock_r))))
+
+(define super-lock-ruleset
+ '(((lkey_Super_L lkey_Super_L) (action_toggle_super_lock_l))
+ ((lkey_Super_R lkey_Super_R) (action_toggle_super_lock_r))))
+
+(define hyper-lock-ruleset
+ '(((lkey_Hyper_L lkey_Hyper_L) (action_toggle_hyper_lock_l))
+ ((lkey_Hyper_R lkey_Hyper_R) (action_toggle_hyper_lock_r))))
+
+;; for functional test and demonstration
+(define qwerty-shift->space-ruleset
+ '((((lkey_Shift_L press)) (($1 " " lkey_space)))
+ (((lkey_Shift_L release)) (($1 " " lkey_space)))
+ (((lkey_Shift_R press)) (($1 " " lkey_space)))
+ (((lkey_Shift_R release)) (($1 " " lkey_space)))))
+
+(define jp106-henkan-muhenkan->shift-ruleset
+ '((((lkey_Henkan press)) (($1 lkey_Shift_R)
+ action_set_shift_r_state))
+ (((lkey_Henkan release)) (($1 lkey_Shift_R mod_Shift_R)
+ action_reset_shift_r_state))
+ (((lkey_Muhenkan press)) (($1 lkey_Shift_L)
+ action_set_shift_l_state))
+ (((lkey_Muhenkan release)) (($1 lkey_Shift_L mod_Shift_L)
+ action_reset_shift_l_state))))
+
+;; temporary workaround for dedicated key-event translator
+(define ja-nicola-jp106-pseudo-thumb-shift-ruleset
+ '((((lkey_Henkan press)) (($1 lkey_Thumb_Shift_R)))
+ (((lkey_Henkan release)) (($1 lkey_Thumb_Shift_R)))
+ (((lkey_Muhenkan press)) (($1 lkey_Thumb_Shift_L)))
+ (((lkey_Muhenkan release)) (($1 lkey_Thumb_Shift_L)))))
+
+
+(define key-event-translator-ruleset
+ (append
+ ;;qwerty->dvorak-ruleset
+ ;;combinational-shift-ruleset
+ ;;sticky-shift-ruleset
+ ;;shift-lock-ruleset
+ ;;(if qwerty-enable-pseudo-multi-key?
+ ;; qwerty-enable-pseudo-multi-key-ruleset
+ ;; ())
+ ;;(if qwerty-enable-pseudo-dead-keys?
+ ;; qwerty-enable-pseudo-dead-keys-ruleset
+ ;; ())
+ (if enable-jp106-henkan-muhenkan-shift?
+ jp106-henkan-muhenkan->shift-ruleset
+ ())
+ (if enable-ja-nicola-jp106-pseudo-thumb-shift?
+ ja-nicola-jp106-pseudo-thumb-shift-ruleset
+ ())
+ (if enable-qwerty-shift->space?
+ qwerty-shift->space-ruleset
+ ())
+ ))
+
+(define key-event-translator-ruletree
+ (evmap-parse-ruleset key-event-translator-ruleset))
+
+(define key-event-translator-new
+ (lambda ()
+ (evmap-context-new key-event-translator-ruletree)))
+
+;; TODO: write test, replace with composer framework
+;; returns rest actions
+(define key-event-translator-translate!
+ (lambda (emc ev)
+ (if enable-modifier-translation?
+ (key-event-set-modifier! ev mod_None))
+ (if (evmap-context-input! emc ev)
+ (begin
+ (event-set-consumed! ev #f)
+ (event-set-loopback! ev #f)))
+ (if (evmap-context-complete? emc)
+ (let* ((action-seq (evmap-context-action-seq emc))
+ (translated (safe-car action-seq)))
+ (evmap-context-flush! emc)
+ (if (pair? translated)
+ (begin
+ (list-copy! ev translated)
+ (cdr action-seq))
+ action-seq)))))
Modified: branches/composer/scm/evmap.scm
===================================================================
--- branches/composer/scm/evmap.scm 2005-03-05 21:56:58 UTC (rev 754)
+++ branches/composer/scm/evmap.scm 2005-03-06 12:08:51 UTC (rev 755)
@@ -846,94 +846,3 @@
(else
(ustr-cursor-delete-backside! seq)
(undo seq))))))
-
-;;
-;; key-event translator
-;;
-
-;; should be moved into appropriate file
-
-(define combinational-shift-ruleset
- '((((char-alphabet press) (char-alphabet press))
- ((($1 char-upcase mod_shift loopback)) (($2 loopback))))))
-
-;; TODO:
-;; - support arbitrary set of modifiers
-;; - support non-alphabet chars
-(define sticky-shift-ruleset
- '(((lkey_Shift_L char-alphabet) (($3 char-upcase mod_Shift_L loopback)
- ($4 char-upcase mod_Shift_L loopback)))
- ((lkey_Shift_R char-alphabet) (($3 char-upcase mod_Shift_R loopback)
- ($4 char-upcase mod_Shift_R loopback)))))
-
-;; does not work yet
-(define shift-lock-ruleset
- '(((lkey_Shift_L lkey_Shift_L) (action_toggle_shift_lock))
- ((lkey_Shift_R lkey_Shift_R) (action_toggle_shift_lock))))
-
-;; for functional test and demonstration
-;; TODO: strip any modifier and re-generate in evmap
-(define qwerty-shift->space-ruleset
- '((((lkey_Shift_L press)) (($1 " " lkey_space)))
- (((lkey_Shift_L mod_Shift release)) (($1 " " lkey_space)))
- (((lkey_Shift_R press)) (($1 " " lkey_space)))
- (((lkey_Shift_R mod_Shift release)) (($1 " " lkey_space)))))
-
-(define jp106-henkan-muhenkan->shift-ruleset
- '((((lkey_Henkan press)) (($1 lkey_Shift_R)))
- (((lkey_Henkan release)) (($1 lkey_Shift_R)))
- (((lkey_Muhenkan press)) (($1 lkey_Shift_L)))
- (((lkey_Muhenkan release)) (($1 lkey_Shift_L)))))
-
-;; temporary workaround for dedicated key-event translator
-(define ja-nicola-jp106-pseudo-thumb-shift-ruleset
- '((((lkey_Henkan press)) (($1 lkey_Thumb_Shift_R)))
- (((lkey_Henkan release)) (($1 lkey_Thumb_Shift_R)))
- (((lkey_Muhenkan press)) (($1 lkey_Thumb_Shift_L)))
- (((lkey_Muhenkan release)) (($1 lkey_Thumb_Shift_L)))))
-
-
-(define key-event-translator-ruleset
- (append
- ;;qwerty->dvorak-ruleset
- ;;combinational-shift-ruleset
- ;;sticky-shift-ruleset
- ;;shift-lock-ruleset
- ;;(if qwerty-enable-pseudo-multi-key?
- ;; qwerty-enable-pseudo-multi-key-ruleset
- ;; ())
- ;;(if qwerty-enable-pseudo-dead-keys?
- ;; qwerty-enable-pseudo-dead-keys-ruleset
- ;; ())
- (if enable-jp106-henkan-muhenkan-shift?
- jp106-henkan-muhenkan-shift-ruleset
- ())
- (if enable-ja-nicola-jp106-pseudo-thumb-shift?
- ja-nicola-jp106-pseudo-thumb-shift-ruleset
- ())
- (if enable-qwerty-shift->space?
- qwerty-shift->space-ruleset
- ())
- ))
-
-(define key-event-translator-ruletree
- (evmap-parse-ruleset key-event-translator-ruleset))
-
-(define key-event-translator-new
- (lambda ()
- (evmap-context-new key-event-translator-ruletree)))
-
-;; TODO: write test
-(define key-event-translator-translate!
- (lambda (emc ev)
- (if (evmap-context-input! emc ev)
- (begin
- (event-set-consumed! ev #f)
- (event-set-loopback! ev #f)))
- (if (evmap-context-complete? emc)
- (let ((translated (safe-car (evmap-context-action-seq emc))))
- (evmap-context-flush! emc)
- (if (pair? translated)
- (list-copy! ev translated)
- ev))
- ev)))
Modified: branches/composer/scm/im-custom.scm
===================================================================
--- branches/composer/scm/im-custom.scm 2005-03-05 21:56:58 UTC (rev 754)
+++ branches/composer/scm/im-custom.scm 2005-03-06 12:08:51 UTC (rev 755)
@@ -338,103 +338,6 @@
(_ "long description will be here."))
-(define-custom-group 'keyboard
- (_ "Keyboard settings")
- (_ "long description will be here."))
-
-;; subgroup
-(define-custom-group 'keyboard-env
- (_ "System configuration of your keyboard")
- (_ "long description will be here."))
-
-;; subgroup
-(define-custom-group 'keyboard-translation
- (_ "Key-input translation for uim input methods")
- (_ "long description will be here."))
-
-(define-custom 'system-physical-keyboard-type 'jp106
- '(keyboard keyboard-env)
- (list 'choice
- (list 'qwerty
- (_ "Standard QWERTY")
- (_ "Standard QWERTY"))
-;; (list 'latin-qwerty
-;; (_ "Latin QWERTY")
-;; (_ "Latin QWERTY which has dead-keys and multi key"))
- (list 'jp106
- (_ "Japanese JP106 (QWERTY)")
- (_ "Japanese JP106 (QWERTY)"))
-;; (list 'jp109
-;; (_ "Japanese JP109 (QWERTY)")
-;; (_ "Japanese JP109 (QWERTY)"))
-;; (list 'kinesis
-;; (_ "KINESIS Contoured (QWERTY)")
-;; (_ "KINESIS Contoured (QWERTY)"))
- )
- (_ "Physical keyboard type")
- (_ "long description will be here."))
-
-(define-custom 'system-logical-key-mapping 'jp106-qwerty
- '(keyboard keyboard-env)
- (list 'choice
- (list 'qwerty
- (_ "QWERTY")
- (_ "QWERTY"))
- (list 'dvorak
- (_ "Dvorak")
- (_ "Dvorak"))
- (list 'jp106-qwerty
- (_ "QWERTY (JP106)")
- (_ "QWERTY (JP106"))
- (list 'jp106-dvorak
- (_ "Dvorak (JP106)")
- (_ "Dvorak (JP106")))
- (_ "Logical key mapping")
- (_ "long description will be here."))
-
-;;(define-custom 'key-event-basic-translator 'jp106-qwerty
-;; '(keyboard keyboard-env)
-;; (list 'choice
-;; (list 'qwerty
-;; (_ "QWERTY")
-;; (_ "QWERTY"))
-;; (list 'dvorak
-;; (_ "Dvorak")
-;; (_ "Dvorak"))
-;; (list 'jp106-qwerty
-;; (_ "QWERTY (JP106)")
-;; (_ "QWERTY (JP106"))
-;; (list 'jp106-dvorak
-;; (_ "Dvorak (JP106)")
-;; (_ "Dvorak (JP106")))
-;; (_ "Basic key-input translation")
-;; (_ "long description will be here."))
-
-(define-custom 'enable-jp106-henkan-muhenkan-shift? #f
- '(keyboard keyboard-translation)
- '(boolean)
- (_ "Use Henkan and Muhenkan as ordinary shift key")
- (_ "long description will be here."))
-
-(define-custom 'enable-ja-nicola-jp106-pseudo-thumb-shift? #f
- '(keyboard keyboard-translation)
- '(boolean)
- (_ "Use Henkan and Muhenkan as NICOLA thumb shift keys")
- (_ "long description will be here."))
-
-(define-custom 'enable-qwerty-shift->space? #f
- '(keyboard keyboard-translation)
- '(boolean)
- (_ "Use shift keys as space key (testing purpose)")
- (_ "long description will be here."))
-
-(define-custom 'inspect-key-event-translation? #f
- '(keyboard keyboard-translation)
- '(boolean)
- (_ "Inspect key-event translation (for developer, use with LIBUIM_VERBOSE=1)")
- (_ "long description will be here."))
-
-
;; EB Library support
;; 2005-02-08 Takuro Ashie <ashie at homa.ne.jp>
;; FIXME! Here isn't suitable position for EB support preference
Added: branches/composer/scm/key-custom.scm
===================================================================
--- branches/composer/scm/key-custom.scm 2005-03-05 21:56:58 UTC (rev 754)
+++ branches/composer/scm/key-custom.scm 2005-03-06 12:08:51 UTC (rev 755)
@@ -0,0 +1,273 @@
+;;; key-custom.scm: Customization variables for key inputs
+;;;
+;;; Copyright (c) 2005 uim Project http://uim.freedesktop.org/
+;;;
+;;; All rights reserved.
+;;;
+;;; Redistribution and use in source and binary forms, with or without
+;;; modification, are permitted provided that the following conditions
+;;; are met:
+;;; 1. Redistributions of source code must retain the above copyright
+;;; notice, this list of conditions and the following disclaimer.
+;;; 2. Redistributions in binary form must reproduce the above copyright
+;;; notice, this list of conditions and the following disclaimer in the
+;;; documentation and/or other materials provided with the distribution.
+;;; 3. Neither the name of authors nor the names of its contributors
+;;; may be used to endorse or promote products derived from this software
+;;; without specific prior written permission.
+;;;
+;;; THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+;;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+;;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+;;; ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+;;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+;;; OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+;;; HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+;;; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+;;; OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+;;; SUCH DAMAGE.
+;;;;
+
+(require "i18n.scm")
+
+
+(define-custom-group 'keyboard
+ (_ "Keyboard settings")
+ (_ "long description will be here."))
+
+;; subgroup
+(define-custom-group 'keyboard-env
+ (_ "System configuration of your keyboard")
+ (_ "long description will be here."))
+
+;; subgroup
+(define-custom-group 'keyboard-translation
+ (_ "Key-input translation for uim input methods")
+ (_ "long description will be here."))
+
+(define-custom 'system-physical-keyboard-type 'jp106
+ '(keyboard keyboard-env)
+ (list 'choice
+ (list 'qwerty
+ (_ "Standard QWERTY")
+ (_ "Standard QWERTY"))
+;; (list 'latin-qwerty
+;; (_ "Latin QWERTY")
+;; (_ "Latin QWERTY which has dead-keys and multi key"))
+ (list 'jp106
+ (_ "Japanese JP106 (QWERTY)")
+ (_ "Japanese JP106 (QWERTY)"))
+;; (list 'jp109
+;; (_ "Japanese JP109 (QWERTY)")
+;; (_ "Japanese JP109 (QWERTY)"))
+;; (list 'kinesis
+;; (_ "KINESIS Contoured (QWERTY)")
+;; (_ "KINESIS Contoured (QWERTY)"))
+ )
+ (_ "Physical keyboard type")
+ (_ "long description will be here."))
+
+(define-custom 'system-logical-key-mapping 'jp106-qwerty
+ '(keyboard keyboard-env)
+ (list 'choice
+ (list 'qwerty
+ (_ "QWERTY")
+ (_ "QWERTY"))
+ (list 'dvorak
+ (_ "Dvorak")
+ (_ "Dvorak"))
+ (list 'jp106-qwerty
+ (_ "QWERTY (JP106)")
+ (_ "QWERTY (JP106"))
+ (list 'jp106-dvorak
+ (_ "Dvorak (JP106)")
+ (_ "Dvorak (JP106")))
+ (_ "Logical key mapping")
+ (_ "long description will be here."))
+
+;;(define-custom 'key-event-basic-translator 'jp106-qwerty
+;; '(keyboard keyboard-env)
+;; (list 'choice
+;; (list 'qwerty
+;; (_ "QWERTY")
+;; (_ "QWERTY"))
+;; (list 'dvorak
+;; (_ "Dvorak")
+;; (_ "Dvorak"))
+;; (list 'jp106-qwerty
+;; (_ "QWERTY (JP106)")
+;; (_ "QWERTY (JP106"))
+;; (list 'jp106-dvorak
+;; (_ "Dvorak (JP106)")
+;; (_ "Dvorak (JP106")))
+;; (_ "Basic key-input translation")
+;; (_ "long description will be here."))
+
+(define-custom 'enable-jp106-henkan-muhenkan-shift? #f
+ '(keyboard keyboard-translation)
+ '(boolean)
+ (_ "Use Henkan and Muhenkan as ordinary shift key")
+ (_ "long description will be here."))
+
+(define-custom 'enable-ja-nicola-jp106-pseudo-thumb-shift? #f
+ '(keyboard keyboard-translation)
+ '(boolean)
+ (_ "Use Henkan and Muhenkan as NICOLA thumb shift keys")
+ (_ "long description will be here."))
+
+(define-custom 'enable-qwerty-shift->space? #f
+ '(keyboard keyboard-translation)
+ '(boolean)
+ (_ "Use shift keys as space key (testing purpose)")
+ (_ "long description will be here."))
+
+(define-custom 'inspect-key-event-translation? #f
+ '(keyboard keyboard-translation)
+ '(boolean)
+ (_ "Inspect key-event translation (for developer, use with LIBUIM_VERBOSE=1)")
+ (_ "long description will be here."))
+
+;;
+;; modifier settings
+;;
+
+(define-custom-group 'modifier1
+ (_ "Key modifier settings 1")
+ (_ "Key modifier state translation settings for uim input methods (1)"))
+
+(define-custom-group 'modifier2
+ (_ "Key modifier settings 2")
+ (_ "Key modifier state translation settings for uim input methods (2)"))
+
+;; subgroup
+(define-custom-group 'modifier-sticky
+ (_ "Sticky modifiers")
+ (_ "long description will be here."))
+
+;; subgroup
+(define-custom-group 'modifier-lock
+ (_ "Lockable modifiers")
+ (_ "long description will be here."))
+
+(define-custom 'enable-modifier-translation? #f
+ '(modifier1)
+ '(boolean)
+ (_ "Enable modifier state translation based on uim's own rule")
+ (_ "long description will be here."))
+
+(define-custom 'use-sticky-shift? #f
+ '(modifier1 modifier-sticky)
+ '(boolean)
+ (_ "Shift key")
+ (_ "long description will be here."))
+
+(define-custom 'use-sticky-control? #f
+ '(modifier1 modifier-sticky)
+ '(boolean)
+ (_ "Control key")
+ (_ "long description will be here."))
+
+(define-custom 'use-sticky-alt? #f
+ '(modifier1 modifier-sticky)
+ '(boolean)
+ (_ "Alt key")
+ (_ "long description will be here."))
+
+(define-custom 'use-sticky-meta? #f
+ '(modifier1 modifier-sticky)
+ '(boolean)
+ (_ "Meta key")
+ (_ "long description will be here."))
+
+(define-custom 'use-sticky-super? #f
+ '(modifier1 modifier-sticky)
+ '(boolean)
+ (_ "Super key")
+ (_ "long description will be here."))
+
+(define-custom 'use-sticky-hyper? #f
+ '(modifier1 modifier-sticky)
+ '(boolean)
+ (_ "Hyper key")
+ (_ "long description will be here."))
+
+(define-custom 'use-combinational-shift? #f
+ '(modifier1)
+ '(boolean)
+ (_ "Use combinational shift")
+ (_ "long description will be here."))
+
+
+(define-custom 'use-shift-lock? #f
+ '(modifier2 modifier-lock)
+ '(boolean)
+ (_ "Use shift key lock")
+ (_ "long description will be here."))
+
+(define-custom 'shift-lock-count 2
+ '(modifier2 modifier-lock)
+ '(integer 1 10)
+ (_ "Shift key press count to lock/unlock shift state")
+ (_ "long description will be here."))
+
+(define-custom 'use-control-lock? #f
+ '(modifier2 modifier-lock)
+ '(boolean)
+ (_ "Use control key lock")
+ (_ "long description will be here."))
+
+(define-custom 'control-lock-count 2
+ '(modifier2 modifier-lock)
+ '(integer 1 10)
+ (_ "Control key press count to lock/unlock control state")
+ (_ "long description will be here."))
+
+(define-custom 'use-alt-lock? #f
+ '(modifier2 modifier-lock)
+ '(boolean)
+ (_ "Use alt key lock")
+ (_ "long description will be here."))
+
+(define-custom 'alt-lock-count 2
+ '(modifier2 modifier-lock)
+ '(integer 1 10)
+ (_ "Alt key press count to lock/unlock alt state")
+ (_ "long description will be here."))
+
+(define-custom 'use-meta-lock? #f
+ '(modifier2 modifier-lock)
+ '(boolean)
+ (_ "Use meta key lock")
+ (_ "long description will be here."))
+
+(define-custom 'meta-lock-count 2
+ '(modifier2 modifier-lock)
+ '(integer 1 10)
+ (_ "Meta key press count to lock/unlock meta state")
+ (_ "long description will be here."))
+
+(define-custom 'use-super-lock? #f
+ '(modifier2 modifier-lock)
+ '(boolean)
+ (_ "Use super key lock")
+ (_ "long description will be here."))
+
+(define-custom 'super-lock-count 2
+ '(modifier2 modifier-lock)
+ '(integer 1 10)
+ (_ "Super key press count to lock/unlock super state")
+ (_ "long description will be here."))
+
+(define-custom 'use-hyper-lock? #f
+ '(modifier2 modifier-lock)
+ '(boolean)
+ (_ "Use hyper key lock")
+ (_ "long description will be here."))
+
+(define-custom 'hyper-lock-count 2
+ '(modifier2 modifier-lock)
+ '(integer 1 10)
+ (_ "Hyper key press count to lock/unlock hyper state")
+ (_ "long description will be here."))
+
Modified: branches/composer/scm/ng-key.scm
===================================================================
--- branches/composer/scm/ng-key.scm 2005-03-05 21:56:58 UTC (rev 754)
+++ branches/composer/scm/ng-key.scm 2005-03-06 12:08:51 UTC (rev 755)
@@ -30,6 +30,7 @@
;;;;
(require "util.scm")
+(require-custom "key-custom.scm")
;;
;; modifiers
More information about the Uim-commit
mailing list