Anyone up for writing a quick SDL app that generates MIDI events based on
the keyboard?

Description of function would be like this:

Grab system-wide keyboard when right Alt key is pressed
Emit ALSA seq midi events when keyboard keys are pressed
Release system-wide keyboard when left Alt key is pressed

On Wed, Sep 10, 2008 at 3:35 AM, Gustavo Homem <[EMAIL PROTECTED]>wrote:

> On Tue, Sep 09, 2008 at 10:05:05PM -0400, Garth Dahlstrom wrote:
> > Just to beat a dead horse a bit more, keyboard event processing is a
> pretty
> > common problem for games (in my youth I spent a long time trying to
> develop
> > games), so SDL has a custom event model that handles this (oh the things
> I
> > could have done if I had SDL in my day)...  I have no idea if there is a
> way
> > to do something like this in pure Qt...
>
> Maybe this helps?
>
> http://doc.trolltech.com/4.4/qkeyevent.html#isAutoRepeat
>
> >
> >
> http://wiki.gamedev.net/index.php/SDL:Tutorials:Keyboard_Input_using_an_Event_Loop
> >
> > if you grab the example source from there you can extract and then build
> and
> > run it on an Ubuntu system like:
> >
> > aptitude install libsdl-dev
> > g++ $(pkg-config --cflags sdl) $(pkg-config --libs-only-l sdl) -o
> > SDL_Keyboard SDL_Keyboard.c
> > ./SDL_Keyboard
> >
> > PRESSED: w
> > RELEASED: w
> > PRESSED: w
> > RELEASED: w
> > PRESSED: left shift
> > RELEASED: left shift
> > PRESSED: left shift
> > PRESSED: LSHIFT w
> > RELEASED: LSHIFT w
> > RELEASED: left shift
> >
> > You can see how the above corresponds to Mouse click/release or Midi Note
> > on/off....
> >
> > -G
> >
> > On Tue, Sep 9, 2008 at 6:54 PM, Garth Dahlstrom <[EMAIL PROTECTED]>
> wrote:
> >
> > > Right line of w's...  It is impossible to tell if that was a single
> press
> > > and hold or mulitple press and releases without a custom keyboard
> handler.
> > > By contrast mouse (and midi) do distinct pressed + released events
> without
> > > repeating.
> > >
> > > You'd need a custom keyboard handler to have any shot of interpreting
> that
> > > type of keyboard event to do what you expect.
> > >
> > >
> > >
> > > On Tue, Sep 9, 2008 at 6:35 PM, Gustavo Homem <[EMAIL PROTECTED]
> >wrote:
> > >
> > >> On Tuesday 09 September 2008 23:35, Garth Dahlstrom wrote:
> > >> > Open your favourite text edtior.  Press and hold 'w' for 5 seconds.
> > >>
> > >> It fills a line of w's, of course.
> > >>
> > >> > keyboard event != mouse event
> > >> >
> > >>
> > >> I know that mouse and keyboard don't work the same way. My question is
> if
> > >> CUE
> > >> behaviour via keyboard is failing for enveryone else. Is this a known
> bug?
> > >>
> > >> --
> > >> Angulo Sólido - Tecnologias de Informação
> > >> http://angulosolido.pt
> > >>
> > >
> > >
> > >
> > > --
> > > __
> > > --- == __/ t.O ==--
> > > http://stacktrace.org/
> > >
> >
> >
> >
> > --
> > __
> > --- == __/ t.O ==--
> > http://stacktrace.org/
>
> --
> Angulo Sólido - Tecnologias de Informação
> http://angulosolido.pt
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Mixxx-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mixxx-devel
>
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Mixxx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mixxx-devel

Reply via email to