Simen  S M

Simen S M

  • NA
  • 35
  • 32k

Detect USB device (USB mouse) when inserted and make a event

Jan 9 2012 11:17 AM

Hello guys.

 

I'm working on a paintball scoreboard, and have come so far that it begin to be a little bit hard. I have not been working so much on WPF before, have mostly worked on C#, but here is the question.

 

Is it possible to detect USB devices? I read something about that WPF can not detect USB devices, and I have to use driver API? Is this correct, if so, how do I use driver API? I can only find C# codes on the internet?

 

So if can get a code that search for USB devices, I'm thinking like this: when someone plug in 2 mouses in USB, the program (I'm making) will fit them, and I want to make a event for these mouses so when mouse 1 is right-clicked label1 update, and when mouse 2 is right-clicked, label2 updates.

I dont think that is the worst part (or..?), the worst part is to get a code that detects these mouses when plugged in and then make a event for them.

 

Or what are you guy thinking? Do you want me to upload my project so you guys can see?

 

I'm sorry if I should'nt do thing like this before I have read enough about WPF, but I just want to do this and finish my project, and I appreciate all help I can get.

 

Thank you :)


Answers (25)