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
1,550 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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 400 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Process Javascript errors with Delphi TWebBrowser 1 210
Intraweb download file link ? 1 168
Correct Component for Shopping Cart. 2 121
When i run adoquery my application freezes 26 192
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

730 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