Re: [LAD] MIDI in jack

From: Pedro Lopez-Cabanillas <pedro.lopez.cabanillas@email-addr-hidden>
Date: Sun Jul 06 2014 - 20:15:57 EEST

On Sunday 06 July 2014 09:44:57 Len Ovens wrote:
> On Sun, 6 Jul 2014, Brett McCoy wrote:
> > You might want to take a look at some previous implementations of
> > similar ideas (using console keyboard for MIDI). They use the ALSA
> > sequencer, I believe
> >
> > http://vmpk.sourceforge.net/
> >
> > http://alsa.opensrc.org/Vkeybd
>
> Some of that code will be useful, but both of these run in user space and
> use the Xorg keyboard inputs. This means that if I have a synth connected
> to virtual kb, as soon as I try to change the synth patch, I loose my
> virtual keyboard access because keyboard follows focus to the synth
> application (which is what we want almost always). That is why I have to
> run as a system user.

VMPK has an option (Edit->Preferences):
[x] Grab Computer Keyboard

If you enable this option, VMPK grabs keyboard events no matter which
application has the focus. It will be temporarily disabled when you minimize
VMPK's main window, and re-enabled when restoring it again. It is also
disabled when you open a dialog.

To do so in X11 applications you only need to invoke the XGrabKeyboard
function: http://www.x.org/archive/X11R7.5/doc/man/man3/XGrabKeyboard.3.html
There may be problems using this function in your program while running other
gtk+ based programs at the same time, because it is used by gtk+ menus as
well.

Regards,
Pedro
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Received on Mon Jul 7 00:15:02 2014

This archive was generated by hypermail 2.1.8 : Mon Jul 07 2014 - 00:15:02 EEST