Mouse help

This is a discussion on Mouse help within the C Programming forums, part of the General Programming Boards category; I know how to use the mouse (the setup and recieving data) using interupt 33. However, you can only get ...

  1. #1
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145

    Mouse help

    I know how to use the mouse (the setup and recieving data) using interupt 33. However, you can only get the absolute position of the mouse (like x=0-319, y=0-199). I need to get how far the mouse has moved since the last update (delta x and delta y). Do you know how to do this?

    PS: The program is made for mode 13, if it matters. Check my signature for the compiler
    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.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,824
    > Do you know how to do this?
    Just remember the previous position

    delta = current - previous
    previous = current

    Simple...

  3. #3
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145

    ummm... no

    If the mouse is at the edge of the screen (ie 319), and moves it right, it will be 319-319=0. zero movement when the user moves the mouse to the right... not good.

    I'm sure you can do this by calling the right interupt, I've done this before, but lost the code . Isn't this how mice works? They only send the data how far it has moved relative to the last time. It's up to the mouse handler to calculate where on the screen the mouse pointer is.
    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.

  4. #4
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145

    Unhappy hm

    There must be a way to do this. Take Quake for example, where you rotate the view depending on how much you have moved the mouse, NOT where the mouse is on the screen...

    Someone?
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. need Help in Mouse Pointer
    By obaid in forum C++ Programming
    Replies: 3
    Last Post: 12-07-2006, 03:33 AM
  2. Problem in mouse position
    By Arangol in forum Game Programming
    Replies: 6
    Last Post: 08-08-2006, 08:07 AM
  3. Problem with Mouse Over Menu!!! HELP!!!
    By SweeLeen in forum C++ Programming
    Replies: 3
    Last Post: 02-09-2006, 02:10 AM
  4. Making a mouse hover button, API style
    By hanhao in forum C++ Programming
    Replies: 1
    Last Post: 05-27-2004, 07:17 AM
  5. Game Design Topic #2 - Keyboard or Mouse?
    By TechWins in forum Game Programming
    Replies: 4
    Last Post: 10-08-2002, 04:34 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21