On Tue, 2008-06-17 at 16:50 +0200, Jens M Andreasen wrote:
> A virtual midi-keyboard would solve that, perhaps vkeybd?
> 

AlgoMantra,

In any case, the supplied kbhit() will not work if you haven't already
screwed up your Xterm, but this one will:

/* We will use the keyboard for musical input
 */
int kbhit()
{
    static const int STDIN = 0;
    static int initialized = 0;

    if (! initialized) {
        // Use termios to turn off line buffering
        struct termios term;
        tcgetattr(STDIN, &term);
        term.c_lflag &= ~ICANON;
        tcsetattr(STDIN, TCSANOW, &term);
        setbuf(stdin, NULL);
        initialized = 1;
    }

    int bytesWaiting;
    ioctl(STDIN, FIONREAD, &bytesWaiting);
    return bytesWaiting;
}



_______________________________________________
Linux-audio-dev mailing list
[email protected]
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev

Reply via email to