Skip to main content
gamedev.net
🔒 Locked

mouse control

Started by Thoover 9 replies 1.7k views
Original Post
Thoover
Thoover
I don't know where else to post this: I want to make a program in eather c/c++ that controls mouse movement from an external device on port 0378 (lpt port) which is a glove that detects hand movements; not quite finished yet, i have to wait a week for my microprocessors and ram chips to come in so i can have more control; sorry for getting off the subject. so back on the topic, i know this is possible, i need links and source code that can help me out. thanks in advance thoover. i will post the code and electric specifics on my web page, http://www.gamersandcheatersland.com, when I'm completely finished with the code and electronics, i hope it all works as it should. well that was more than enough said, I'll be back in an hour or two to see any posts, if any.
Crypter
Crypter
What system API?

If you are not using any API, you may need to use inline asm.
You can easily use the in and out instructions to send/write data
to/from the port.

What data to send is a different story. (This is very specific to the
device and the device driver)
Thoover
Thoover
Quote:
Original post by Crypter
What system API?

If you are not using any API, you may need to use inline asm.
You can easily use the in and out instructions to send/write data
to/from the port.

What data to send is a different story. (This is very specific to the
device and the device driver)


all i need to know is how to move the mouse and click the mouse from a program.
this is all i need info for, i googled the whole time between this and the last post and found nothing, i shouldn't need to use API im using inportb and outportb commands for i/o. I may just choose to make the device ps/2 even though it will be much harder to program and that will need many inf and dll's.

this can be done, it is done by all botting programs for RS2 but they don't give out sources anymore.
Ravuya
Ravuya
Maybe look into the Windows message system and inject some messages along the way. I seem to think that's how the old GUI scripting stuff did it.

Other than that, maybe writing a driver or something might work.
Crypter
Crypter
Quote:

i shouldn't need to use API im using inportb and outportb commands for i/o.

What you are asking is system dependent, hence requires either API
or direct port access (Which you seem to be doing)

It can be done, but without an API, will require low level coding
(Either inline asm, or low level C-which is what you seem to be using)

Ravuya posted some suggestions you can try (Which requires Win32 programming,
or device driver programming)

btw, inportb()/outportb() are nothing more then the in and out asm instructions.
This tells me you are trying to directly access the ports. If so, creating
a device driver is your best bet.
Thoover
Thoover
how would i make an API if i wanted to, and drivers the 2 things i never did before
Monder
Monder
If you have a look around the win32 API I'm sure there's something for setting the position of the mouse pointer.

As for talking to your hardware you can't read and write directly from ports under windows. You need a driver to do that. I think there's a generic parallel port driver for windows that allows you to read and write to and from the various data pins but I can't recall it's name.

Though if you do want to just use this thing as a mouse, why not just implement the PS/2 mouse protocol? It wouldn't require any extra drivers or anything, just the generic mouse one.
DaWanderer
DaWanderer
If you're using Win32 programming, take a look at the SendInput API function.
Thoover
Thoover
Quote:
Original post by Monder
If you have a look around the win32 API I'm sure there's something for setting the position of the mouse pointer.

As for talking to your hardware you can't read and write directly from ports under windows. You need a driver to do that. I think there's a generic parallel port driver for windows that allows you to read and write to and from the various data pins but I can't recall it's name.

Though if you do want to just use this thing as a mouse, why not just implement the PS/2 mouse protocol? It wouldn't require any extra drivers or anything, just the generic mouse one.


yes it would still need extra drivers, i dont have exact mouse output that default mice use, i cant find any info on this so i cant make an exact mouse like device

Quote:
Original post by DaWanderer
If you're using Win32 programming, take a look at the SendInput API function.

useful if i had the libraries and windows.h header for djgpp, but i looked it up and couldn't get the header working on my compiler

this is starting to get more difficult than i ever thought it would, lol

i wish their were some open source windows drivers, i googled for Open Source Drivers, found nothing at all, I'm sorry if i am wasting anyones time, i just need help, I'm a newbie at Windows programming, i can make all the devices, but then when it comes to programming, i cant do anything right

I'll pay someone to make the code, i will post all the outputs from the device in am hour or two if anyone is interested private message me, ill look at your posts to see if you really know what you are doing and the one with the most experience will be chosen i will pay up to 30USD for a compiled program, or drivers fully made and compiled.
gunning
gunning
You might get more programmer diversity on rentacoder.com.
....[size="1"]Brent Gunning
Monder
Monder
Quote:
yes it would still need extra drivers, i dont have exact mouse output that default mice use, i cant find any info on this so i cant make an exact mouse like device


Well the PS/2 mouse protocol isn't exactly the hardest thing to track down, e.g. check this page out.

Quote:
i wish their were some open source windows drivers, i googled for Open Source Drivers, found nothing at all, I'm sorry if i am wasting anyones time, i just need help, I'm a newbie at Windows programming, i can make all the devices, but then when it comes to programming, i cant do anything right


The Windows DDK isn't freely available online. I believe it's free, however if you want it you need to pay shipping which was $25 last time I checked, either that or get it through an MSDN subscription (in which case you can download it). This may explain the lack of open source drivers.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.