[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Detect joystick force feedback effect in delphi using mmsystem.pas or others but not directx components or others

Posted on 2006-11-24
10
Medium Priority
?
1,578 Views
Last Modified: 2012-08-14
How can I detect joystick force feedback effects using delphi7, I know the  mmsystem.pas functions and procedures  but i can not find any function that identify the effect that the joystick( Ex. tremble) is doing, I get the buttons, axis... how can I solve this problem without using external components like directx component or others?
Could somebody help me?

0
Comment
Question by:RuiGraca
  • 6
  • 3
10 Comments
 
LVL 11

Expert Comment

by:robert_marquardt
ID: 18010413
AFAIK force feedback is only available through DirectX.
0
 

Author Comment

by:RuiGraca
ID: 18014082
Yes I know but how can I access it? What do I need to use and witch functions that is my problem even using DelphiX DirectX component collection I can not get the joystick force feedback as I get the joystick axis and buttons that is my BIG Problem??
Please help me?
0
 

Author Comment

by:RuiGraca
ID: 18023885
Is there somebody how can help me?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:RuiGraca
ID: 18033091
I am repeating the question sorry!!
0
 
LVL 9

Expert Comment

by:bernani
ID: 18033559
0
 

Author Comment

by:RuiGraca
ID: 18044475
Its the same question in other words I was getting desperate
0
 
LVL 9

Expert Comment

by:bernani
ID: 18046088
Hi,

I understand.

I've never tried to program a joystick  . I'm not sure the links given  in your other thread will give you the solution. I believe, as written above by robert_marquardt that you'll need use DirectX.

You can eventually see at http://www.clootie.ru/delphi/download_dx92.html if you can't find sth newer to help you in this way.

If you don't plan to use external compos or directX, you'll probably need to write your own implementation.

Good luck.
0
 

Author Comment

by:RuiGraca
ID: 18047163
Is digging in a pile of endless code to get a clue ...
Well I got to your link I even think the code  as
 DIEFFECT_DX5 = packed record
    dwSize: DWORD;                   (* sizeof(DIEFFECT_DX5) *)
    dwFlags: DWORD;                  (* DIEFF_*              *)
    dwDuration: DWORD;               (* Microseconds         *)
    dwSamplePeriod: DWORD;           (* Microseconds         *)
    dwGain: DWORD;
    dwTriggerButton: DWORD;          (* or DIEB_NOTRIGGER    *)
    dwTriggerRepeatInterval: DWORD;  (* Microseconds         *)
    cAxes: DWORD;                    (* Number of axes       *)
    rgdwAxes: PDWORD;                (* Array of axes        *)
    rglDirection: PLongint;          (* Array of directions  *)
    lpEnvelope: PDIEnvelope;         (* Optional             *)
    cbTypeSpecificParams: DWORD;     (* Size of params       *)
    lpvTypeSpecificParams: Pointer;  (* Pointer to params    *)
  end;


In Koders there are a C++ header that help somethink but getting a howto or something that explains is impossible I don´t get it.
0
 
LVL 9

Accepted Solution

by:
bernani earned 1600 total points
ID: 18049859
Hi,

See here for mor info at http://www.reactos.org/en/index.html
http://www.reactos.org/generated/doxygen/d2/d79/structDIEFFECT__DX5.html

and

http://www.shorthike.com/svn/trunk/libraries/dx80sdk/include/dinput.h

http://www.winehq.com/hypermail/wine-patches/2005/08/att-0123/01-ff-4-effect.diff
+/* This file contains all the Effect specific functions that can be used as stubs
+   by real force feedback effect implementations.
+
+   It also contains all the helper functions.



It's not in Delphi but maybe can help:

http://www.cygwin.com/ml/cygwin-patches/2004-q3/msg00120.html


+ * IDirectInputDevice8W interface
+ */
+#define INTERFACE IDirectInputDevice8W
+#define IDirectInputDevice8W_METHODS \
+    IDirectInputDevice7W_METHODS \
+    STDMETHOD(BuildActionMap)(THIS_ LPDIACTIONFORMATW lpdiaf, LPCWSTR lpszUserName, DWORD dwFlags) PURE; \
+    STDMETHOD(SetActionMap)(THIS_ LPDIACTIONFORMATW lpdiaf, LPCWSTR lpszUserName, DWORD dwFlags) PURE; \
+    STDMETHOD(GetImageInfo)(THIS_ LPDIDEVICEIMAGEINFOHEADERW lpdiDevImageInfoHeader) PURE;
+DECLARE_INTERFACE_(IDirectInputDevice8W,IDirectInputDevice7W) { IDirectInputDevice8W_METHODS };
+#undef INTERFACE
+typedef struct IDirectInputDevice8W *LPDIRECTINPUTDEVICE8W;
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define IDirectInputDevice8_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#define IDirectInputDevice8_AddRef(p)             (p)->lpVtbl->AddRef(p)
+#define IDirectInputDevice8_Release(p)            (p)->lpVtbl->Release(p)
+/*** IDirectInputDevice methods ***/
+#define IDirectInputDevice8_GetCapabilities(p,a)       (p)->lpVtbl->GetCapabilities(p,a)
+#define IDirectInputDevice8_EnumObjects(p,a,b,c)       (p)->lpVtbl->EnumObjects(p,a,b,c)
+#define IDirectInputDevice8_GetProperty(p,a,b)         (p)->lpVtbl->GetProperty(p,a,b)
+#define IDirectInputDevice8_SetProperty(p,a,b)         (p)->lpVtbl->SetProperty(p,a,b)
+#define IDirectInputDevice8_Acquire(p)                 (p)->lpVtbl->Acquire(p)
+#define IDirectInputDevice8_Unacquire(p)               (p)->lpVtbl->Unacquire(p)
+#define IDirectInputDevice8_GetDeviceState(p,a,b)      (p)->lpVtbl->GetDeviceState(p,a,b)
+#define IDirectInputDevice8_GetDeviceData(p,a,b,c,d)   (p)->lpVtbl->GetDeviceData(p,a,b,c,d)
+#define IDirectInputDevice8_SetDataFormat(p,a)         (p)->lpVtbl->SetDataFormat(p,a)
+#define IDirectInputDevice8_SetEventNotification(p,a)  (p)->lpVtbl->SetEventNotification(p,a)
+#define IDirectInputDevice8_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
+#define IDirectInputDevice8_GetObjectInfo(p,a,b,c)     (p)->lpVtbl->GetObjectInfo(p,a,b,c)
+#define IDirectInputDevice8_GetDeviceInfo(p,a)         (p)->lpVtbl->GetDeviceInfo(p,a)
+#define IDirectInputDevice8_RunControlPanel(p,a,b)     (p)->lpVtbl->RunControlPanel(p,a,b)
+#define IDirectInputDevice8_Initialize(p,a,b,c)        (p)->lpVtbl->Initialize(p,a,b,c)
+/*** IDirectInputDevice2 methods ***/
+#define IDirectInputDevice8_CreateEffect(p,a,b,c,d)           (p)->lpVtbl->CreateEffect(p,a,b,c,d)
+#define IDirectInputDevice8_EnumEffects(p,a,b,c)              (p)->lpVtbl->EnumEffects(p,a,b,c)
+#define IDirectInputDevice8_GetEffectInfo(p,a,b)              (p)->lpVtbl->GetEffectInfo(p,a,b)
+#define IDirectInputDevice8_GetForceFeedbackState(p,a)        (p)->lpVtbl->GetForceFeedbackState(p,a)
+#define IDirectInputDevice8_SendForceFeedbackCommand(p,a)     (p)->lpVtbl->SendForceFeedbackCommand(p,a)
+#define IDirectInputDevice8_EnumCreatedEffectObjects(p,a,b,c) (p)->lpVtbl->EnumCreatedEffectObjects(p,a,b,c)
+#define IDirectInputDevice8_Escape(p,a)                       (p)->lpVtbl->Escape(p,a)
+#define IDirectInputDevice8_Poll(p)                           (p)->lpVtbl->Poll(p)
+#define IDirectInputDevice8_SendDeviceData(p,a,b,c,d)         (p)->lpVtbl->SendDeviceData(p,a,b,c,d)
+/*** IDirectInputDevice7 methods ***/
+#define IDirectInputDevice8_EnumEffectsInFile(p,a,b,c,d) (p)->lpVtbl->EnumEffectsInFile(p,a,b,c,d)
+#define IDirectInputDevice8_WriteEffectToFile(p,a,b,c,d) (p)->lpVtbl->WriteEffectToFile(p,a,b,c,d)
+/*** IDirectInputDevice8 methods ***/
+#define IDirectInputDevice8_BuildActionMap(p,a,b,c) (p)->lpVtbl->BuildActionMap(p,a,b,c)
+#define IDirectInputDevice8_SetActionMap(p,a,b,c)   (p)->lpVtbl->SetActionMap(p,a,b,c)
+#define IDirectInputDevice8_GetImageInfo(p,a)       (p)->lpVtbl->GetImageInfo(p,a)
+#endif
+
+DECL_WINELIB_TYPE_AW(LPDIRECTINPUTDEVICE8)
+DECL_WINELIB_TYPE_AW(IDirectInputDevice8)
+
+#endif /* DI8 */

0
 

Author Comment

by:RuiGraca
ID: 18059407
I give you the point the question is not resoved but you are being a very cool guy in helping, i do not have words to show me gratfulness thanks the other i will leave open.

The Directinput9.pas uses mmsysstem I will try to pass the pointer to directinput and findout the struct that has the effects  I think I am close.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses
Course of the Month20 days, 7 hours left to enroll

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question