[gsharp-cvs] CVS update: gsharp/gui.lisp gsharp/modes.lisp

Robert Strandh rstrandh at common-lisp.net
Sun Aug 1 15:14:33 UTC 2004


Update of /project/gsharp/cvsroot/gsharp
In directory common-lisp.net:/tmp/cvs-serv3200

Modified Files:
	gui.lisp modes.lisp 
Log Message:
Lyrics input now allows for accents, provided that your keyboard
is capable of generating dead keys for these accents.  It only works for
X11 at the moment, I would think.  

The way I do it is not great, since now I get messages about missing
commands for the control keys.  I have to think of a better way of 
doing it.

Loading a file now calls select-layer so that the appropriate mode is 
selected.  Loading the bach score with lyrics now immediately lets 
you edit the lyrics. 


Date: Sun Aug  1 08:14:33 2004
Author: rstrandh

Index: gsharp/gui.lisp
diff -u gsharp/gui.lisp:1.16 gsharp/gui.lisp:1.17
--- gsharp/gui.lisp:1.16	Sat Jul 24 13:09:55 2004
+++ gsharp/gui.lisp	Sun Aug  1 08:14:33 2004
@@ -17,8 +17,8 @@
 (defparameter *last-character* nil)
 
 (defmethod dispatch-event :around ((pane score-pane:score-pane) (event key-press-event))
-  (when (keyboard-event-character event)
-    (let ((key (list (keyboard-event-character event)
+  (when (or (keyboard-event-character event) (keyboard-event-key-name event))
+    (let ((key (list (or (keyboard-event-character event) (keyboard-event-key-name event))
 		     (event-modifier-state event))))
       (setf *accumulated-keys* (append *accumulated-keys* (list key)))
       (setf *last-character* (char-to-unicode (car key)))
@@ -289,7 +289,8 @@
     (setf (buffer *gsharp-frame*) buffer
 	  (input-state *gsharp-frame*) input-state
 	  (cursor *gsharp-frame*) cursor)
-    (number-all (buffer *gsharp-frame*))))
+    (number-all (buffer *gsharp-frame*))
+    (select-layer cursor (car (layers (segment (cursor *gsharp-frame*)))))))
 
 (define-gsharp-command (com-save-buffer-as :name t) ()
   (let* ((stream (frame-standard-input *gsharp-frame*))


Index: gsharp/modes.lisp
diff -u gsharp/modes.lisp:1.2 gsharp/modes.lisp:1.3
--- gsharp/modes.lisp:1.2	Sat Jul 24 13:09:55 2004
+++ gsharp/modes.lisp	Sun Aug  1 08:14:33 2004
@@ -97,70 +97,70 @@
       do (add-keyseq `((,c)) (make-insert-fun i) *lyrics-layer-mode-table*))
 
 ;;; try some latin prefix mode for national characters 
-(add-keyseq '((#\`) (#\A :shift)) (make-insert-fun 192) *lyrics-layer-mode-table*)
-(add-keyseq '((#\') (#\A :shift)) (make-insert-fun 193) *lyrics-layer-mode-table*)
-(add-keyseq '((#\^) (#\A :shift)) (make-insert-fun 194) *lyrics-layer-mode-table*)
-(add-keyseq '((#\~) (#\A :shift)) (make-insert-fun 195) *lyrics-layer-mode-table*)
-(add-keyseq '((#\") (#\A :shift)) (make-insert-fun 196) *lyrics-layer-mode-table*)
-(add-keyseq '((#\/) (#\A :shift)) (make-insert-fun 197) *lyrics-layer-mode-table*)
-(add-keyseq '((#\/) (#\E :shift)) (make-insert-fun 198) *lyrics-layer-mode-table*)
-(add-keyseq '((#\/) (#\C :shift)) (make-insert-fun 199) *lyrics-layer-mode-table*)
-(add-keyseq '((#\`) (#\E :shift)) (make-insert-fun 200) *lyrics-layer-mode-table*)
-(add-keyseq '((#\') (#\E :shift)) (make-insert-fun 201) *lyrics-layer-mode-table*)
-(add-keyseq '((#\^) (#\E :shift)) (make-insert-fun 202) *lyrics-layer-mode-table*)
-(add-keyseq '((#\") (#\E :shift)) (make-insert-fun 203) *lyrics-layer-mode-table*)
-(add-keyseq '((#\`) (#\I :shift)) (make-insert-fun 204) *lyrics-layer-mode-table*)
-(add-keyseq '((#\') (#\I :shift)) (make-insert-fun 205) *lyrics-layer-mode-table*)
-(add-keyseq '((#\^) (#\I :shift)) (make-insert-fun 206) *lyrics-layer-mode-table*)
-(add-keyseq '((#\") (#\I :shift)) (make-insert-fun 207) *lyrics-layer-mode-table*)
-(add-keyseq '((#\/) (#\D :shift)) (make-insert-fun 208) *lyrics-layer-mode-table*)
-(add-keyseq '((#\~) (#\N :shift)) (make-insert-fun 209) *lyrics-layer-mode-table*)
-(add-keyseq '((#\`) (#\O :shift)) (make-insert-fun 210) *lyrics-layer-mode-table*)
-(add-keyseq '((#\') (#\O :shift)) (make-insert-fun 211) *lyrics-layer-mode-table*)
-(add-keyseq '((#\^) (#\O :shift)) (make-insert-fun 212) *lyrics-layer-mode-table*)
-(add-keyseq '((#\~) (#\O :shift)) (make-insert-fun 213) *lyrics-layer-mode-table*)
-(add-keyseq '((#\") (#\O :shift)) (make-insert-fun 214) *lyrics-layer-mode-table*)
-
-(add-keyseq '((#\/) (#\O :shift)) (make-insert-fun 216) *lyrics-layer-mode-table*)
-(add-keyseq '((#\`) (#\U :shift)) (make-insert-fun 217) *lyrics-layer-mode-table*)
-(add-keyseq '((#\') (#\U :shift)) (make-insert-fun 218) *lyrics-layer-mode-table*)
-(add-keyseq '((#\^) (#\U :shift)) (make-insert-fun 219) *lyrics-layer-mode-table*)
-(add-keyseq '((#\") (#\U :shift)) (make-insert-fun 220) *lyrics-layer-mode-table*)
-(add-keyseq '((#\') (#\Y :shift)) (make-insert-fun 221) *lyrics-layer-mode-table*)
-
-
-(add-keyseq '((#\`) (#\a)) (make-insert-fun 224) *lyrics-layer-mode-table*)
-(add-keyseq '((#\') (#\a)) (make-insert-fun 225) *lyrics-layer-mode-table*)
-(add-keyseq '((#\^) (#\a)) (make-insert-fun 226) *lyrics-layer-mode-table*)
-(add-keyseq '((#\~) (#\a)) (make-insert-fun 227) *lyrics-layer-mode-table*)
-(add-keyseq '((#\") (#\a)) (make-insert-fun 228) *lyrics-layer-mode-table*)
-(add-keyseq '((#\/) (#\a)) (make-insert-fun 229) *lyrics-layer-mode-table*)
-(add-keyseq '((#\/) (#\e)) (make-insert-fun 230) *lyrics-layer-mode-table*)
-(add-keyseq '((#\~) (#\c)) (make-insert-fun 231) *lyrics-layer-mode-table*)
-(add-keyseq '((#\`) (#\e)) (make-insert-fun 232) *lyrics-layer-mode-table*)
-(add-keyseq '((#\') (#\e)) (make-insert-fun 233) *lyrics-layer-mode-table*)
-(add-keyseq '((#\^) (#\e)) (make-insert-fun 234) *lyrics-layer-mode-table*)
-(add-keyseq '((#\") (#\e)) (make-insert-fun 235) *lyrics-layer-mode-table*)
-(add-keyseq '((#\`) (#\i)) (make-insert-fun 236) *lyrics-layer-mode-table*)
-(add-keyseq '((#\') (#\i)) (make-insert-fun 237) *lyrics-layer-mode-table*)
-(add-keyseq '((#\^) (#\i)) (make-insert-fun 238) *lyrics-layer-mode-table*)
-(add-keyseq '((#\") (#\i)) (make-insert-fun 239) *lyrics-layer-mode-table*)
-
-
-(add-keyseq '((#\`) (#\o)) (make-insert-fun 242) *lyrics-layer-mode-table*)
-(add-keyseq '((#\') (#\o)) (make-insert-fun 243) *lyrics-layer-mode-table*)
-(add-keyseq '((#\^) (#\o)) (make-insert-fun 244) *lyrics-layer-mode-table*)
-(add-keyseq '((#\~) (#\o)) (make-insert-fun 245) *lyrics-layer-mode-table*)
-(add-keyseq `((#\") (#\o)) (make-insert-fun 246) *lyrics-layer-mode-table*)
-
-(add-keyseq '((#\/) (#\o)) (make-insert-fun 248) *lyrics-layer-mode-table*)
-(add-keyseq '((#\`) (#\u)) (make-insert-fun 249) *lyrics-layer-mode-table*)
-(add-keyseq '((#\') (#\u)) (make-insert-fun 250) *lyrics-layer-mode-table*)
-(add-keyseq '((#\^) (#\u)) (make-insert-fun 251) *lyrics-layer-mode-table*)
-(add-keyseq '((#\") (#\u)) (make-insert-fun 252) *lyrics-layer-mode-table*)
-(add-keyseq '((#\') (#\y)) (make-insert-fun 253) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--grave) (#\A :shift)) (make-insert-fun 192) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--acute) (#\A :shift)) (make-insert-fun 193) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--circumflex :shift) (#\A :shift)) (make-insert-fun 194) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--tilde :shift) (#\A :shift)) (make-insert-fun 195) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--diaeresis :shift) (#\A :shift)) (make-insert-fun 196) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead-above-ring) (#\A :shift)) (make-insert-fun 197) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead-above-ring) (#\E :shift)) (make-insert-fun 198) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead-above-ring) (#\C :shift)) (make-insert-fun 199) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--grave) (#\E :shift)) (make-insert-fun 200) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--acute) (#\E :shift)) (make-insert-fun 201) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--circumflex :shift) (#\E :shift)) (make-insert-fun 202) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--diaeresis :shift) (#\E :shift)) (make-insert-fun 203) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--grave) (#\I :shift)) (make-insert-fun 204) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--acute) (#\I :shift)) (make-insert-fun 205) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--circumflex :shift) (#\I :shift)) (make-insert-fun 206) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--diaeresis :shift) (#\I :shift)) (make-insert-fun 207) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead-above-ring) (#\D :shift)) (make-insert-fun 208) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--tilde :shift) (#\N :shift)) (make-insert-fun 209) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--grave) (#\O :shift)) (make-insert-fun 210) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--acute) (#\O :shift)) (make-insert-fun 211) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--circumflex :shift) (#\O :shift)) (make-insert-fun 212) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--tilde :shift) (#\O :shift)) (make-insert-fun 213) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--diaeresis :shift) (#\O :shift)) (make-insert-fun 214) *lyrics-layer-mode-table*)
+
+(add-keyseq '((:dead-above-ring) (#\O :shift)) (make-insert-fun 216) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--grave) (#\U :shift)) (make-insert-fun 217) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--acute) (#\U :shift)) (make-insert-fun 218) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--circumflex :shift) (#\U :shift)) (make-insert-fun 219) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--diaeresis :shift) (#\U :shift)) (make-insert-fun 220) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--acute) (#\Y :shift)) (make-insert-fun 221) *lyrics-layer-mode-table*)
+
+
+(add-keyseq '((:dead--grave) (#\a)) (make-insert-fun 224) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--acute) (#\a)) (make-insert-fun 225) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--circumflex :shift) (#\a)) (make-insert-fun 226) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--tilde :shift) (#\a)) (make-insert-fun 227) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--diaeresis :shift) (#\a)) (make-insert-fun 228) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead-above-ring) (#\a)) (make-insert-fun 229) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead-above-ring) (#\e)) (make-insert-fun 230) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--tilde :shift) (#\c)) (make-insert-fun 231) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--grave) (#\e)) (make-insert-fun 232) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--acute) (#\e)) (make-insert-fun 233) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--circumflex :shift) (#\e)) (make-insert-fun 234) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--diaeresis :shift) (#\e)) (make-insert-fun 235) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--grave) (#\i)) (make-insert-fun 236) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--acute) (#\i)) (make-insert-fun 237) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--circumflex :shift) (#\i)) (make-insert-fun 238) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--diaeresis :shift) (#\i)) (make-insert-fun 239) *lyrics-layer-mode-table*)
+
+
+(add-keyseq '((:dead--grave) (#\o)) (make-insert-fun 242) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--acute) (#\o)) (make-insert-fun 243) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--circumflex :shift) (#\o)) (make-insert-fun 244) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--tilde :shift) (#\o)) (make-insert-fun 245) *lyrics-layer-mode-table*)
+(add-keyseq `((:dead--diaeresis :shift) (#\o)) (make-insert-fun 246) *lyrics-layer-mode-table*)
+
+(add-keyseq '((:dead-above-ring) (#\o)) (make-insert-fun 248) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--grave) (#\u)) (make-insert-fun 249) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--acute) (#\u)) (make-insert-fun 250) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--circumflex :shift) (#\u)) (make-insert-fun 251) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--diaeresis :shift) (#\u)) (make-insert-fun 252) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--acute) (#\y)) (make-insert-fun 253) *lyrics-layer-mode-table*)
 
-(add-keyseq '((#\") (#\y)) (make-insert-fun 255) *lyrics-layer-mode-table*)
+(add-keyseq '((:dead--diaeresis :shift) (#\y)) (make-insert-fun 255) *lyrics-layer-mode-table*)
 
 
 	     	     





More information about the Gsharp-cvs mailing list