开发者

2 mice, but track coordinates of 1 using Visual Basic 2008 Express

开发者 https://www.devze.com 2023-03-20 06:21 出处:网络
totally new to VB however have some experience of using VBA in excel. What I am trying to do is to make a form using Visual Basic 2008 Express that track the coordinates of aan old开发者_如何学Go PS/

totally new to VB however have some experience of using VBA in excel.

What I am trying to do is to make a form using Visual Basic 2008 Express that track the coordinates of aan old开发者_如何学Go PS/2 mouse through a usb adapter and then show 2 rotary positions in deg:min:sec. I am planning on using the rotary encoders inside this mouse as a rotational reader to show rotary position of 2 shafts at 90 Deg to each other. Whilst I can get the coords to show on the screen using a simple form as I move the mouse around, I want to be able to "hide" its cursor if possible whilst still tracking the rotation of the 2 shaft encoders, and then use the mouse pad on the laptop for navigating around windows performing normal tasks independently. I am able to calibrate the rotary encoders in the PS/2 mouse and it is accurate enough for what i need. In essence, I want to use the old PS/2 mouse as an input positional sensor whilst keeping the mouse pad for its intended use.

Do you think this can be done??

Thanks for your help!!


I love this question. There is no visualization of what you are trying to do that is not awesome. However, accomplishing this in a way which leaves the other mouse to its own - pardon the pun, its own devices - will be difficult, because as I understand it you are going to need to prevent the mouse events from reaching the pointer stack, which is going to involve writing your own mouse driver. This is going to be really, really hard in VB and is precisely the sort of thing which C++ is good for.

C++ is also hard as heck to learn compared to VBA. Sorry! Another option would be to set up a dedicated machine as your input handler and have it stream rotational data over the network. Depending on your latency tolerance, you could even do this over HTTP with VBA!

This wouldn't be ideal, there is a lot of overhead inherent in the HTTP protocol because it isn't really built for lots of little movement packets like this, but over a local network it is likely to be good enough (and saves you needing to figure out sockets just yet.)

0

精彩评论

暂无评论...
验证码 换一张
取 消