<?xml version="1.0"?>
<Denemo>
  <merge>
    <title>A Denemo Keymap</title>
    <author>AT, JRR, RTS</author>
    <map>
      <row>
        <after>ParenthesizeNote</after>
        <action>ChordComment</action>
        <scheme>;;; ChordComment
(let ()
(define current (d-DirectiveGet-chord-display "ChordComment"))
(define position (GetPosition))
(let script ((answer (d-GetUserInput (_ "Insert Comment") (_ "Comment this chord") (if current current "") #f)))
	(if (and answer (not (string=? answer "")))
		(begin
			(if (not (PositionEqual? position (GetPosition)))
				(begin
					(if (not (equal? (_ "y") (d-GetUserInput (_ "Cursor has Moved") (_ "Apply Command to new position of cursor?")  (_ "y"))))
					(apply d-GoToPosition position))))
			(d-DirectivePut-chord-override "ChordComment" DENEMO_OVERRIDE_EDITOR)
			(d-DirectivePut-chord-display "ChordComment" answer))
		#f)))</scheme>
        <label>Comment</label>
        <tooltip>Attach a textual comment to the chord at the cursor</tooltip>
      </row>
    </map>
  </merge>
</Denemo>
