bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

read mouse position beyond column 256 ?


From: Patrick
Subject: read mouse position beyond column 256 ?
Date: Thu, 20 Feb 2014 09:22:27 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131103 Icedove/17.0.10


Hi Everyone

I am trying to read the co-ordinates of a graphics tablet. I could read the X Y position with a GUi toolkit but I would strongly prefer ncurses.

I can't seem to read past 250 something or so. I am guessing that the locations may be stored as short types

At the end of the email is a sample program from Gookin's Programmers Guide To Ncurses.

I changed the #include to link to ncursesw in the hopes that it would support columns beyond 256 but it does not seem to.

I compiled it with this:

gcc mevent.c -o debug `ncursesw5-config --cflags --libs`

If anyone could lend a hand I would really appreciate it-Patrick



#include <ncursesw/ncurses.h>

int main(void)
{
    MEVENT mwhat;
    int ch;

    initscr();
    noecho();
    keypad(stdscr,TRUE);

    mousemask(ALL_MOUSE_EVENTS,NULL);

    while(1)
    {
        ch = getch();
        if( ch == KEY_MOUSE )
        {
            getmouse(&mwhat);
            move(0,0);
            clrtoeol();
            printw("%2d %2d",mwhat.y,mwhat.x);
            refresh();
            continue;
        }
        if( ch == '\n' )
            break;
    }

    endwin();


    return 0;
}



reply via email to

[Prev in Thread] Current Thread [Next in Thread]