Article View: borland.public.cppbuilder.nativeapi
Article #14943Re: jOYsTICK CONTROL
From: Henry
Date: Mon, 28 Jul 2003 16:21
Date: Mon, 28 Jul 2003 16:21
61 lines
1896 bytes
1896 bytes
First to all, You have to include:
#include "Mmsystem.h"
then, in you program:
JOYINFO joy_data;
if (joyGetPos(JOYSTICKID1, &joy_data) == JOYERR_NOERROR) // "JOYSTICKID2"
if you want to read the second joystick
{
. OK, do something
}
else
{
... error!
}
the "JOYINFO" struct ("joy_data" in the example above), contains the
following info:
UINT wXpos � Current X-coordinate
UINT wYpos � Current Y-coordinate
UINT wZpos � Current Z-coordinate
UINT wButtons � State of joystick buttons (bits 0, 1, 2 and 3)
Henry
"RORY WALSH" <RORYTHEROAR@YAHOO.COM> ha scritto nel messaggio
news:3f24fac4@newsgroups.borland.com...
> Can anyone give me an example of how to use the Joystick API in BOrland
C++
> builder, I have looked through all the API help but I still cannot figure
> out how to do this?
>
>
Technical Details
Message-ID:
<3f254d91@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.news2me.com!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<3f24fac4@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 10cc67,1e3d2eab73d38afb X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-07-28 09:33:56 PST Reply-To: "Henry" <eangelo@libero.it> From: "Henry" <eangelo@libero.it> Newsgroups: borland.public.cppbuilder.nativeapi References: <3f24fac4@newsgroups.borland.com> Subject: Re: jOYsTICK CONTROL Date: Mon, 28 Jul 2003 18:21:35 +0200 Lines: 63 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 212.38.42.99 Message-ID: <3f254d91@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1059409297 212.38.42.99 (28 Jul 2003 09:21:37 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.news2me.com!small1.nntp.aus1.giganews.com!border1.nntp.aus1.giganews.com!nntp.giganews.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail