denemo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Denemo-devel] Emacs bindings (and midi input)


From: Richard Shann
Subject: [Denemo-devel] Emacs bindings (and midi input)
Date: Tue, 07 Oct 2008 11:49:59 +0100

> Benjamin Summers
> Mon, 10/06/2008 - 16:57
> The main things that keep me from using Denemo are the lack of good
> midi playback and the absence of support for input from a midi
> keyboard. I read some files in the source code that seem to be related
> to these, so maybe this is being worked on?
I suspect a lot of the work was done, but it needs a developer to work
on it right now.
>  I am using the Windows build, by the way.
> 
> I would also like to be able to use Emacs style key bindings in
> Denemo. As far as I can tell, bindings such as C-x C-s aren't
> possible.
It is possible with the latest versions. You need a simple script that
is a command,  say (d-ControlX), that takes a keypress (actually at the
moment we only have (d-GetChar), but that is easy to fix) and calls the
action you want for the next keypress you make.
Here is the outline of the script:

;;;;;;;;;;;;;; emacs commands
(define command (lambda ()
            (d-getUserInput "Control-x" "Undefined combination." "OK")
            ))
(define response (string (d-GetChar)))
(cond
 ((equal? response "s") (set! command d-Save))
 ((equal? response "k") (set! command d-Close))

)         
(command)

This does Save in response to Control-X s and close for Control-X k
It raises a couple of issues, 
        The d-GetChar is returning a char not a string.
        It should really be d-GetKeypress to return a string like
"Control-S" etc.

It occurs to me that this script could really do with knowing which
keyboard shortcut was used to invoke it (you could assign any key to it,
but it is assuming you have assigned Ctrl-X).
Food for thought.
Richard








reply via email to

[Prev in Thread] Current Thread [Next in Thread]