Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. How do i interface with a mouse?

How do i interface with a mouse?

Scheduled Pinned Locked Moved .NET (Core and Framework)
question
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    basilmir
    wrote on last edited by
    #1

    Hello, I have a small situation. Not quite a developer yet, so i need a top-down view from someone with experience. I have a windows 7 box, and two mice connected to it, both using the windows default driver. As you can imagine they both work as a "mouse". What do i have to do, to "manage" the input of the second mouse to make it do something else, not just mousing around? Use it's movement to map to keys, and so on and so forth. Thank you in advance.

    L C 2 Replies Last reply
    0
    • B basilmir

      Hello, I have a small situation. Not quite a developer yet, so i need a top-down view from someone with experience. I have a windows 7 box, and two mice connected to it, both using the windows default driver. As you can imagine they both work as a "mouse". What do i have to do, to "manage" the input of the second mouse to make it do something else, not just mousing around? Use it's movement to map to keys, and so on and so forth. Thank you in advance.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      samoila.mircea wrote:

      What do i have to do, to "manage" the input of the second mouse to make it do something else, not just mousing around? Use it's movement to map to keys, and so on and so forth.

      Learn C and write your own driver. This ain't possible in .NET, AFAIK.

      I are Troll :suss:

      B 1 Reply Last reply
      0
      • L Lost User

        samoila.mircea wrote:

        What do i have to do, to "manage" the input of the second mouse to make it do something else, not just mousing around? Use it's movement to map to keys, and so on and so forth.

        Learn C and write your own driver. This ain't possible in .NET, AFAIK.

        I are Troll :suss:

        B Offline
        B Offline
        basilmir
        wrote on last edited by
        #3

        If it were only one mouse, then you'd be using a mouse-hook. There's an example on that on Fourth mouse button[^]. I doubt that this technique will work with two mouses (especially if they're identical), but you might want to give it a try before diving deeper into the system. The second alternative is to write a small application that communicates with the serial port. We got many samples on that on CodeProject, especially for .NET - the only drawback being that you're limited to mouses with an old 9 pins serial cable. In that case you'd be interpreting the signals coming from the serial port yourself, and these signals may vary per manufacturer, or even by product. I have some c experience. Do you know any paid or free video tutorials on how to do this... There aren't that much video's on driver-development, you'd best start off with the Windows Driver Kit. http://www.microsoft.com/whdc/Devtools/wdk/ What IDE does one use? You'd best ask the guys in the C++ forum what they're using - last IDE that I used was Borland C++ Builder 5. That compiler is still freely available today, I believe. A big thanks goes to Eddy Vluggen.

        1 Reply Last reply
        0
        • B basilmir

          Hello, I have a small situation. Not quite a developer yet, so i need a top-down view from someone with experience. I have a windows 7 box, and two mice connected to it, both using the windows default driver. As you can imagine they both work as a "mouse". What do i have to do, to "manage" the input of the second mouse to make it do something else, not just mousing around? Use it's movement to map to keys, and so on and so forth. Thank you in advance.

          C Offline
          C Offline
          cjb110
          wrote on last edited by
          #4

          A pure guess this, but you might want take a look at the XNA/DirectX stuff. I'm just thinking that it has more capability of reconizing multiple input devices. tbh as the other replies have suggested the problem will be at the driver level, and the OS doesn't do/offer any distinction between connected 'mice'.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups