Using a Joystick as a mouse

Just starting out? Need help? Post your questions and find answers here.
Rookie
Enthusiast
Enthusiast
Posts: 106
Joined: Tue May 20, 2003 4:16 pm
Location: Florida
Contact:

Using a Joystick as a mouse

Post by Rookie »

I am trying to code a way to use the joystick as a mouse. I found a way to do it on purearea, but I can only use the demo and want to use it in linux. Is there a demo friendly way of doing this. I have tried, but for the life of me can't figure it out. Also something that can work for windows and linux.

Thanks for the help.
Insanity is over rated, unless you can join me in mine.
Don't post questions at work
Don't post questions at work
Don't post questions at work
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

This is possible on Windows using the DirectInput library. I don't know how it would be done on Linux.

According to this article these functions are also available through the Windows PSDK. These commands do appear to be included with PureBasic's wrapper for the WINMM library:

http://support.microsoft.com/kb/133065

I believe this is a complete list of the functions exposed by the Win32 API. You'll have to use DirectInput for force-feedback:

Code: Select all

joyGetDevCaps
joyGetNumDevs
joyGetPos
joyGetPosEx
joyGetThreshold
joyReleaseCapture
joySetCapture
joySetThreshold
User avatar
Hroudtwolf
Addict
Addict
Posts: 803
Joined: Sat Feb 12, 2005 3:35 am
Location: Germany(Hessen)
Contact:

Post by Hroudtwolf »

Hi,

Don't reinvent the wheel.
Try this...
http://www.hroudtwolf.de/components/com ... /jouse.zip

Regards

Wolf
Mistrel
Addict
Addict
Posts: 3415
Joined: Sat Jun 30, 2007 8:04 pm

Post by Mistrel »

He may want something custom which would require source code.
Rookie
Enthusiast
Enthusiast
Posts: 106
Joined: Tue May 20, 2003 4:16 pm
Location: Florida
Contact:

Post by Rookie »

Lets see if I can explain it a bit better.
What I need is a way to change the position of the mouse cursor on the desktop.
Also a way to simulate a mouse click as well.
I can't use the Windows API for 2 reasons. I have the demo and linux.
Insanity is over rated, unless you can join me in mine.
Don't post questions at work
Don't post questions at work
Don't post questions at work
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

it is not possible to move the mousecursor on the desktop with native PB-commands.
oh... and have a nice day.
Rookie
Enthusiast
Enthusiast
Posts: 106
Joined: Tue May 20, 2003 4:16 pm
Location: Florida
Contact:

Post by Rookie »

Well that sucks. There goes my little project.
Insanity is over rated, unless you can join me in mine.
Don't post questions at work
Don't post questions at work
Don't post questions at work
Post Reply