Method: Curses.getmouse

Defined in:
ext/curses/curses.c

.getmouseObject

Returns coordinates of the mouse.

This will read and pop the mouse event data off the queue

See the BUTTON*, ALL_MOUSE_EVENTS and REPORT_MOUSE_POSITION constants, to examine the mask of the event



1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
# File 'ext/curses/curses.c', line 1519

static VALUE
curses_getmouse(VALUE obj)
{
    struct mousedata *mdata;
    VALUE val;

    curses_stdscr();
    val = TypedData_Make_Struct(cMouseEvent,struct mousedata,
				&mousedata_type,mdata);
    mdata->mevent = (MEVENT*)xmalloc(sizeof(MEVENT));
    return (getmouse(mdata->mevent) == OK) ? val : Qnil;
}