Thread: Getting mouse position.

  1. #1
    The Right Honourable psychopath's Avatar
    Join Date
    Mar 2004
    Location
    Where circles begin.
    Posts
    1,071

    Getting mouse position.

    I'm porting a library from Windows to Linux. On Windows, I can use GetCursorPos() and SetCursorPos() to get and set the cursor position.

    Is there any equivalent on Linux? Preferably, i'm looking for a standard-ish function that would work on multiple desktop environments, without dependance on a library like GTK or Qt.
    M.Eng Computer Engineering Candidate
    B.Sc Computer Science

    Robotics and graphics enthusiast.

  2. #2
    Registered User Jaqui's Avatar
    Join Date
    Feb 2005
    Posts
    416
    you might try reading the documentation for the x server itself. both xfree86 and xorg [ same software, just a name change ] have non widgetset based tools for this.

    you can get cursor position, window position, display resolution information from the xserver.

    http://wiki.x.org/wiki/DevelopersPages may be a good starting place for reading the documentation.
    Quote Originally Posted by Jeff Henager
    If the average user can put a CD in and boot the system and follow the prompts, he can install and use Linux. If he can't do that simple task, he doesn't need to be around technology.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Position mouse in external application
    By keira in forum C# Programming
    Replies: 1
    Last Post: 09-15-2008, 07:05 PM
  2. Getting the position of the mouse cursor
    By Mavix in forum Game Programming
    Replies: 5
    Last Post: 12-27-2007, 04:02 PM
  3. Problem in mouse position
    By Arangol in forum Game Programming
    Replies: 6
    Last Post: 08-08-2006, 07:07 AM
  4. Button handler
    By Nephiroth in forum Windows Programming
    Replies: 8
    Last Post: 03-12-2006, 06:23 AM
  5. Mouse position in DirectX
    By Barjor in forum Game Programming
    Replies: 1
    Last Post: 03-09-2003, 09:13 PM