Solved

Detect force feed back effects

Posted on 2006-11-28
3
280 Views
Last Modified: 2010-04-04
I tried everthing mmsystem.pas, directx components delphix( I really do not like to use components because I need to study the code behind it), I do not have any more ideas so if someone could help me...
I got a sidewinder from logiteck that i would like to add some my one effects to the efects that are hapenning when I trigger in the control pannel a button I can detect the button but i can not detect the efect, there needs to be a way :)
Is there a procedure, function anything??
0
Comment
Question by:RuiGraca
  • 2
3 Comments
 
LVL 9

Accepted Solution

by:
bernani earned 500 total points
ID: 18033547
Hi,

It can maybe give you some clues or infos:

PcGPE is the PC Games Programmer Encyclopedia, with info on graphics mode, mouse, joystick, effects as fire, rotations, perspectives... Most sources are Pascal, with asm routines. A 720 K zip file.
http://www.nachocabanes.com/utils/pcgpe.zip

http://krypt.dyndns.org:81/joy2midi/
http://www.koders.com/cpp/fid3F5D42E8BBBC07CC252C13511347A50C6670077D.aspx (in C++)
http://www.bsdg.org/SWAG/JOYSTICK/index.html
A compo with source http://www.delphi32.com/vcl/2778
http://www.delphi32.com/vcl/2660/download,xid,2660.asp
http://www.savagesoftware.com.au/delphi/articles/article1_1.html
http://www.obsti.se/sos/gamedev.html#Keyboard%20and

http://www.usb.org/developers/hidpage.html
and read :  Usage Tables for Physical Interface Devices
The Device Class Definition for PID 1.0 provides information for the development of Physical Interface Devices. These devices include force feedback joysticks, steering wheels, etc. It allows peripheral and driver developers to use a common set of HID report descriptors, device usages and reports to describe the characteristics of a PID class device.


0
 

Author Comment

by:RuiGraca
ID: 18044467
Thanks a lot I will try it, I just hope i get my goal.. if i get it i make a release
0
 
LVL 9

Expert Comment

by:bernani
ID: 18053756

Hi,

Forgot to mention  the DelphiX components

http://www.yks.ne.jp/~hori/DelphiX-e.html

In the sample folder, there is a folder called FFEffects and in the folde called Sample there is 3 demos. One of them give a sample like this:


procedure TMainForm.TimerTimer(Sender: TObject);
begin
  DXInput1.Update;
           
  if (isButton1 in DXInput1.States) and (not (isButton1 in FOldStates)) then
  begin
    DXInput1.Joystick.Effects.Find('Machine gun').Start;
  end else                                            
  if (not (isButton1 in DXInput1.States)) and (isButton1 in FOldStates) then
  begin
    DXInput1.Joystick.Effects.Find('Machine gun').Stop;
  end;                                              

  FOldStates := DXInput1.States;
end;
 
Maybe the uit DXInput can gives you more infos. It contains this:

  TForceFeedbackEffect = class;
  TForceFeedbackEffects = class;

  TForceFeedbackEffectObject = class
  private
    FAxes: array[0..1] of DWORD;
    FAxesCount: Integer;
    Feff: TDIEffect;
    FDirections: array[0..1] of DWORD;
    FEnvelope: TDIEnvelope;
    FConstantForce: TDIConstantForce;
    FCondition: TDICondition;
    FPeriodic: TDIPeriodic;
    FEffect: IDirectInputEffect;
    procedure Clear;
    procedure Init(Effect: TForceFeedbackEffect);
    procedure Release;
  public
    destructor Destroy; override;
  end;

Hope this can also help.
0

Featured Post

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!

Question has a verified solution.

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

Suggested Solutions

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

679 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