How to detect mouse double click and simultaneous click

Discussion in 'Windows Vista Drivers' started by Liang Fu, Mar 15, 2005.

  1. Liang Fu

    Liang Fu Guest

    Hi everyone,
    I would like to detect mouse double click and (almost) simultaneous click of
    two or more buttons in moufiltr. Do I need a timer for that or I can do it
    by detecting the bits in ButtonFlags in the same or consecutive
    MOUSE_INPUT_DATA?
    Thanks in advance.
    Liang Fu
     
    Liang Fu, Mar 15, 2005
    #1
    1. Advertisements

  2. Liang Fu

    Ray Trent Guest

    I'm not sure I understand what you mean.

    Each MOUSE_INPUT_DATA will contain information from a single packet and
    will have the button transition bits relevant to that packet, and the
    order of them will be preserved from the viewpoint of a moufiltr/style
    driver. No packets are "combined" or anything like that. Does that
    answer the question?
     
    Ray Trent, Mar 15, 2005
    #2
    1. Advertisements

  3. two or more buttons in moufiltr. Do I need a timer for that or I can do it
    Just call KeQuerySystemTime when the next MOUSE_INPUT_DATA arrives to your
    driver. Then subtract the values when the next data will arrive. This is the
    kind of "timer" you need.
     
    Maxim S. Shatskih, Mar 16, 2005
    #3
  4. you would compare the change in ButtonFlags in 2 consecutive
    MOUSE_INPUT_DATA. the problem here is that double click times are a per
    user setting and the driver does not know what it is.

    d
     
    Doron Holan [MS], Mar 16, 2005
    #4
  5. Liang Fu

    Ray Trent Guest

    Depending on what he's trying to do :)...

    1) if you want to *generate* a double click, calling the service
    callback once with a buffer containing 4 packets of the form
    down/up/down/up will generate a double-click regardless of what the user
    setting is (unless there's a way for a user to disable them entirely...
    I don't remember).

    2) if you're *detecting* double clicks, you *really* need to know the
    user's double click time, so have a user mode app monitor that (remember
    it can change during operation) and send an IOCTL to a device object
    your filter creates.
     
    Ray Trent, Mar 16, 2005
    #5
  6. Liang Fu

    Liang Fu Guest

    Hi everyone,
    Thank you so much for your kind help. I will try with your suggestions.
    Liang Fu
     
    Liang Fu, Mar 16, 2005
    #6
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.