[uim-commit] r2985 - trunk/scm

yamaken at freedesktop.org yamaken at freedesktop.org
Mon Jan 23 09:19:58 PST 2006


Author: yamaken
Date: 2006-01-23 09:19:50 -0800 (Mon, 23 Jan 2006)
New Revision: 2985

Modified:
   trunk/scm/byeoru.scm
Log:
* scm/byeoru.scm
  - (byeoru-graphic-key?): New procedure
  - (byeoru-key-to-candidates, byeoru-feed-romaja-key): Simplify with
    byeoru-graphic-key?
  - Please reform this with your intention, Jae-hyeon


Modified: trunk/scm/byeoru.scm
===================================================================
--- trunk/scm/byeoru.scm	2006-01-23 05:17:46 UTC (rev 2984)
+++ trunk/scm/byeoru.scm	2006-01-23 17:19:50 UTC (rev 2985)
@@ -1253,9 +1253,19 @@
 (define (byeoru-init-handler id im arg)
   (byeoru-context-new id im))
 
+;; Test that the input is not control-purpose but graphical character.
+;;
+;; TODO:
+;; - rename appropriately in accordance with the intention in byeoru
+;; - move to appropriate place
+;; - CHECK: is this a right way to check shift-only?
+(define byeoru-graphic-key?
+  (let ((shift-or-no-modifier? (make-key-predicate '("<Shift>" ""))))
+    (lambda (key key-state)
+      (shift-or-no-modifier? -1 key-state))))
+
 (define (byeoru-key-to-candidates key key-state)
-  (and (or (not (modifier-key-mask key-state))
-	   (= key-state 1))		; CHECK: is this a right way?
+  (and (byeoru-graphic-key? key key-state)
        (let* ((layout (symbol-value byeoru-layout))
 	      (pressed-key
 	       (charcode->string
@@ -1367,8 +1377,8 @@
 ;; romaja, not a jamo.
 (define (byeoru-feed-romaja-key bc key key-state)
   (and
-   (or (not (modifier-key-mask key-state))
-       (= key-state 1)) ; CHECK: is this a right way to check shift-only?
+   ; CHECK: is this a right way to check shift-only?
+   (byeoru-graphic-key? key key-state)
    (begin
 
      (define (flush-automata)



More information about the uim-commit mailing list