Browse Source

Add Fl::set_mouse method.

tags/v1.3.1000
Jonathan Moore Liles 11 years ago
parent
commit
6bed472e74
2 changed files with 12 additions and 2 deletions
  1. +5
    -2
      FL/Fl.H
  2. +7
    -0
      src/Fl_x.cxx

+ 5
- 2
FL/Fl.H View File

@@ -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;}
/**


+ 7
- 0
src/Fl_x.cxx View File

@@ -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…
Cancel
Save