Add Fl::set_mouse method.
This commit is contained in:
parent
02936771b8
commit
6bed472e74
7
FL/Fl.H
7
FL/Fl.H
|
@ -531,13 +531,16 @@ public:
|
|||
open it.
|
||||
*/
|
||||
static void get_mouse(int &,int &); // platform dependent
|
||||
/**
|
||||
Set the pointer position in screen relative coordinates
|
||||
*/
|
||||
static void set_mouse(int x,int y); // platform dependent
|
||||
/**
|
||||
Returns non zero if we had a double click event.
|
||||
\retval Non-zero if the most recent FL_PUSH or FL_KEYBOARD was a "double click".
|
||||
\retval N-1 for N clicks.
|
||||
A double click is counted if the same button is pressed
|
||||
again while event_is_click() is true.
|
||||
|
||||
again while event_is_click() is true.
|
||||
*/
|
||||
static int event_clicks() {return e_clicks;}
|
||||
/**
|
||||
|
|
|
@ -765,6 +765,13 @@ void Fl::get_mouse(int &xx, int &yy) {
|
|||
yy = my;
|
||||
}
|
||||
|
||||
void Fl::set_mouse(int x, int y) {
|
||||
fl_open_display();
|
||||
Window root = RootWindow(fl_display, fl_screen);
|
||||
XWarpPointer(fl_display,None,root,0,0,0,0,x,y);
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
// Code used for paste and DnD into the program:
|
||||
|
||||
|
|
Loading…
Reference in New Issue