[linux-audio-dev] Howto grab keys?

Paul Davis paul at linuxaudiosystems.com
Fri Aug 20 12:42:18 UTC 2004


>On Fri, 20 Aug 2004 12:56:00 +0200
>Pamplemousse_mk2 <pamplemousse_mk2 at netcourrier.com> wrote:
>
>> Does anybody knows some internet sites, or some other libraries, or some 
>> methods (perhaps multithreads? seems to be heavy for just event 
>> managements...). I have look at ncurses docs but they shows an example 
>> with a kind of loop like the one I just talk about above. Any advice is 
>> welcome
>
>man select
>man poll

if simply getting ascii characters from ncurses is enough, then this
message doesn't matter. but if you start to want to use modifiers
combined with keys (e.g. Alt-a, Ctrl-F1), you need to move beyond the
normal ncurses model.

if you take a look at the ardour ncurses front end "ardour/ksi", you
will find a relatively small app that does something pretty close to
what you are thinking about. the key element is setting up the tty in
medium-raw mode so that you can get actual key events from the
keyboard rather than ASCII chars the way that ncurses normally does.

try browsing CVS at:

   http://ardour.org/cgi-bin/viewcvs.cgi/ardour/ksi_ardour/

and take a look at physical_keyboard.cc and ksi.cc to get an idea of
what i am talking about.

--p



More information about the Linux-audio-dev mailing list