I am new to this website, well posting on here anyway. I've taught myself allot about programming and scripting, so I wanna thank everyone for posting.
This isn't my first program, but its the first useful thing I've done. It uses the 'w', 'a', 'd', 's' keys to move the mouse, similar to video games. Its the first step to a bigger project I'm working on in my spare time. Motion tracking to control the mouse. I know there are a lot of programs already for that. But it will teach me and its fun lol. I wanna get it running for someone I know. He is a quadriplegic "idk how to spell it" he can't move anything from the next down, thus not being able to use a computer. So when I'm done i will present it to the superintendent at my school to maybe getting it in all the schools with kids in similar situations.
Anyway now that I've talked your ear off here's the code.
# WADS mouse control #writen by K.B. Carte "tech b" #date 5/9/09 from ctypes import * #probably don't need all of it import msvcrt user = windll.user32 a = 0 keyup = 'w' keydwn = 's' keylft = 'a' keyrte = 'd' x = 355 # roughly middle y = 355 print """W = up, S = down, D = right, A = left Press key and hold to move mouse **Note: This console box must be up and selected To exit click the "x" or "ctrl c"...""" while a < 1: if msvcrt.kbhit(): if keyup == msvcrt.getch(): y = y - 10 user.SetCursorPos(x,y) if keydwn == msvcrt.getch(): y = y + 10 user.SetCursorPos(x,y) if keylft == msvcrt.getch(): x = x - 10 user.SetCursorPos(x,y) if keyrte == msvcrt.getch(): x = x + 10 user.SetCursorPos(x,y)
Any criticizing is welcome, always up for deferent point of views =)
For the next part of my project is to get the motion tracking. Im using my webcam, possible an ir filter from a camera store, and videocapture lib. I've read some about it, but its not really sinking in. I could use some help, so any advice would be great. Just point me in the right direction because i want to 'self teach' as much as i can to help it really stick in my brain lol.
Thanks in advance!!!