[linux-audio-dev] Re: C++ Keyboard Event Handling

Carlo Capocasa capocasa at gmx.net
Fri Jan 20 12:44:03 UTC 2006


Hi David! Thanks for your reply! I'm impressed with your credentials, too :)

> That is, MIDI output, as in sending MIDI messages to an onboard or 
> external hardware synth, or a softsynth running in the driver or as a 
> separate application? (As opposed to generating "wave" audio in your 
> application.)

MIDI output, sending events to the ALSA sequencer, and from there to the
softsynths...

> Anyway, keybord input is done by handling "press" and "release" 
> events. When you get a "press" event, you set some state variable for 
> the corresponding key to "down", and when you get a "release" event, 
> you clear that state variable.

Sounds great! Do you have a code example?

> SDL also has an alternative API that has this logic built in: 
> SDL_GetKeyState():

Hm, I'm wondering if I could do this sticking to C++ builtins...

Carlo




More information about the Linux-audio-dev mailing list