Thread: Mouse question

  1. #1
    Registered User
    Join Date
    Sep 2002
    Posts
    10

    Question Mouse question

    Is it possible to make the mouse cursor move for example 32 pixels at a time inside a window when you move it?

  2. #2
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    I don't think so. If you're trying to do something tile-aligned, divide the position by 32, truncate then multiply by 32 again.
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  3. #3
    Registered User
    Join Date
    Sep 2002
    Posts
    10
    Ok, thanks

  4. #4
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    Look at SetCursorPos()

    May need to call ClipCursor() to restrict the mouse movement (beware as can be evil when debugging), SetCapture() to get mouse msg's.

    GetCursor() will help and so may the ClientToScreen() and ScreenToClient()
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. another do while question
    By kbpsu in forum C++ Programming
    Replies: 3
    Last Post: 03-23-2009, 12:14 PM
  2. Identifying mouse used with Global mouse hooks
    By Chillance in forum Windows Programming
    Replies: 4
    Last Post: 02-15-2009, 08:42 AM
  3. Replies: 12
    Last Post: 12-08-2008, 07:13 PM
  4. Making a mouse hover button, API style
    By hanhao in forum C++ Programming
    Replies: 1
    Last Post: 05-27-2004, 06:17 AM
  5. linux mouse troubles
    By Kinasz in forum Tech Board
    Replies: 0
    Last Post: 01-07-2004, 05:35 AM