Xplorer
October 16th, 2001, 09:00 AM
Hi,
I'm looking for a way to control the mouse from within a program, and I want to do this by using MouseKeys.
In short I have a joystick hooked up to a microcontroller who sends directional data to the serialport and this data should be used to control the mousepointer. MouseKeys use the numerical keyboard to control the mouse and therefor I've tried to use keybd_event vbKeyNumpadX, 0, 0, 0
keybd_event vbKeyNumpadX, 0, KEYEVENTF_KEYUP, 0
I've also tried SendInput() and SendMessage() but I couldn't get it to work. I know that you can send keys with the SendKeys statement also, but I don't know how to send numerical keys with it. Does anyone know how to do this? Or any smart way to send numerical keys so that MouseKeys picks it up?
(Btw, I tried to write my own "MouseKeys" using SetCursorPos(), but the result wasn't as smooth as the original.)
I would really appreciate an answer.
/Xplorer
I'm looking for a way to control the mouse from within a program, and I want to do this by using MouseKeys.
In short I have a joystick hooked up to a microcontroller who sends directional data to the serialport and this data should be used to control the mousepointer. MouseKeys use the numerical keyboard to control the mouse and therefor I've tried to use keybd_event vbKeyNumpadX, 0, 0, 0
keybd_event vbKeyNumpadX, 0, KEYEVENTF_KEYUP, 0
I've also tried SendInput() and SendMessage() but I couldn't get it to work. I know that you can send keys with the SendKeys statement also, but I don't know how to send numerical keys with it. Does anyone know how to do this? Or any smart way to send numerical keys so that MouseKeys picks it up?
(Btw, I tried to write my own "MouseKeys" using SetCursorPos(), but the result wasn't as smooth as the original.)
I would really appreciate an answer.
/Xplorer