I’m really loving the Christmas holiday season at the moment. It has gave me so much time to do things with the Kinect I never thought I could do. I remember when the Kinect SDK originally came out and I found a Cursor online which was nice and packaged for the Kinect SDK. The thing that bugged was that it didn’t come with any real code. You couldn’t see what was going on behind it.
At last! I figured out how to get the Kinect to use your hand as a cursor. Once I get some of the minor details fixed in my voice recognition I’m excited about making some really great apps. It means that applications aren’t just limited to the SDK anymore! You could make flash games and use the cursor. You could say “pen down”, then draw a picture and say “pen up” to stop. I’m really excited about these opportunities.
This lesson was a little more tricky with the coding, which is why I have included a finished example and a blank example for you to try it yourself. Click here to download both the files.
The YouTube video below is available in HD so you should be able to work out the code without any issues. Hope it helps.
Pingback: Interesting Links 02 January 2012 | MSDN Blogs
Hi!
Here is Joe again!
I have try this code in my project and wonder if I can add the mouse wheel event?
something using the distance between HandRight.Position and HandLeft.Position to replace the e.delta value to zoom in and out of a image
I have already had the distance but cant figure how to send this into a mousewheel event.
Any hint?
Thanks again!
And I have try to access the delta value but its read only….
Hi.. I’m beginner and I have try your tutorial. but I don’t too understand about the mouse event. do u have any tutorial or explanation about this? and I also want to try the same thing as Joe said , to zoom in and zoom out image..
your lesson very helpful. thank you so much! 🙂
Unfortunately there is no extra tutorial for the mouse event, however…. I can explain something about the code… Each time you add a new mouse event, you will probably notice the bit at the top you included with the parameters 0x0003 etc…. when you set up the mouse event you give it a name like right click, left click…. the 0x0003 number is a virtual key code. It sends a replica message. Here are some examples here:
VK_LBUTTON 01 Left mouse button – 0x0001
VK_RBUTTON 02 Right mouse button – 0x0002
VK_CANCEL 03 Control-break processing – 0x0003
VK_MBUTTON 04 Middle mouse button (three-button mouse) 0x0004
http://msdn.microsoft.com/en-us/library/ms927178.aspx here are a lot of virtual key codes. Hope this helps a little bit
oh…I see.
Thank you so much Mr. Ray.. your information is helpful. 🙂
hello there m8
thanks alot for the great tutorial
but i have a question, what kind of events can i do for the click ?
i mean can i do the gesture forward for the click ?
if you can please give me any gesture that is usable for a click
regards
ahmed
Hi there,
What I tend to do is put hand above your head when clicking. I’m investigating how to do better gestures though.
Ray
hello ,
how to update the code to work with the new sdk ?
regards
Abdalruhman
Uploaded 5 of the lessons today with new sample files which are SDK V1 ready. Hope they help. – Ray
thanks ,
regards
Abdalruhman
Hi
I am studying information system
and for my capstone I need to control the mouse cursor with Kinect my coding is working but the cursor is always stuck in the middle and go a little to left and a little to right
Also I downloaded your code to try it but its not opening with My microsoft visual basic 2010 can you tell me what version to use
thank you alot
Regards,
Fajer Khajah
I used vb 2010 with the sdk