Thread: Use C++ to move mouse cursor

  1. #1
    Registered User
    Join Date
    Jan 2011
    Posts
    3

    Use C++ to move mouse cursor

    Hey, i was wondering how to use C++ to move my mouse cursor using my keyboard buttons, I use linux, and was wondering how to do that.

  2. #2
    Registered User
    Join Date
    Aug 2010
    Location
    Poland
    Posts
    733
    SendInput Function (Windows)

    Simpler, but deprecated:

    mouse_event Function (Windows)

    EDIT:

    Sorry, I forgot you meant Linux.
    Last edited by kmdv; 01-31-2011 at 11:15 AM.

  3. #3
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    `XWarpPointer'

    Soma

  4. #4
    Registered User
    Join Date
    Jan 2011
    Posts
    3
    Thanks a lot Soma, exactly what i required.
    Could you just tell me this, will i require extra libs to make it work? I use fltk, and can i use the xlibs from there, because it is built on top of it unless i am mistaken. And could you please point me to some sample code on Xwrappointer?
    Thanks a lot.
    Last edited by AJk101; 01-31-2011 at 03:20 PM.

  5. #5
    printf("Hello Cboard\n"); codeprada's Avatar
    Join Date
    Jan 2011
    Location
    In a little room at the back of your brain
    Posts
    68
    another function is the

    Code:
    SetCursorPos( x, y )
    SetCursorPos Function (Windows)

  6. #6
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,738
    Quote Originally Posted by codeprada View Post
    another function is the

    Code:
    SetCursorPos( x, y )
    SetCursorPos Function (Windows)
    Quote Originally Posted by AJk101 View Post
    Hey, i was wondering how to use C++ to move my mouse cursor using my keyboard buttons, I use linux, and was wondering how to do that.
    .....
    Devoted my life to programming...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Can you help me about tolower() in file
    By nctar in forum C Programming
    Replies: 7
    Last Post: 05-12-2010, 10:04 AM
  2. Retrieving data from a file
    By kamitsuna in forum C++ Programming
    Replies: 45
    Last Post: 02-27-2010, 09:37 PM
  3. get visible mouse cursor height
    By eXistenZ in forum Windows Programming
    Replies: 10
    Last Post: 09-05-2008, 09:46 PM
  4. Formatting Output
    By Aakash Datt in forum C++ Programming
    Replies: 2
    Last Post: 05-16-2003, 08:20 PM
  5. Filestream Out + move cursor back one place
    By h3lm3t in forum C++ Programming
    Replies: 1
    Last Post: 03-20-2002, 07:08 PM