emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Let input queue deal gracefully with up-events


From: David Kastrup
Subject: Re: [PATCH] Let input queue deal gracefully with up-events
Date: Wed, 28 Jan 2015 20:50:34 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>> * keyboard.c (apply_modifiers_uncached, parse_solitary_modifier)
>> (parse_modifiers_uncached): React gracefully to "up-" modifiers:
>> those may easily be injected by user-level Lisp code.
>
> Can you provide some context?  When would Lisp code inject events with
> an "up-" modifier?

How else would you want to call the key release from a piano keyboard?
It is basically auxiliary information that can often be discarded: the
key press event is much more important when using a piano keyboard.

I'll append my current context.  Note that when you remove the code
pre-filling the modifier-cache (and haven't applied the given patch),
Emacs will crash when you press (actually when you release) a key on the
connected Midi keyboard, generating a [Ch1 up-C_4] event (for example).

The long-term goal is to integrate Midi event generation into the Emacs
binary.  But at the current point of time, I am still experimenting
around with figuring out just what information should arrive in what
form, and feeding Emacs with such non-native events should be possible
as well.

If you don't have actual Midi hardware, install vmpk (a virtual Midi
keyboard) and do

sudo insmod snd_virmidi

then use the "Connections" menu of vmpk for connecting the keyboard
output to the first virtual Midi device, load the attached file, and
then do M-x midikbd-open RET RET in order to have keypresses and
releases from the keyboard arrive in Emacs.  If the "... is undefined"
messages are not helpful enough, try

M-: (while t (message "%S" (read-event))) RET

to see more details.  End with C-g of course.

-- 
David Kastrup

Attachment: midi-kbd3.el
Description: application/emacs-lisp


reply via email to

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