@@ -83,19 +83,14 @@ _Controller = record
8383 Yaw: double;
8484 Pitch: double;
8585 Roll: double;
86- Buttons: dword ;
86+ Buttons: word ;
8787 Trigger: byte;
8888 ThumbX: smallint;
8989 ThumbY: smallint;
9090end ;
9191 Controller = _Controller;
9292 TController = Controller;
9393
94- const
95- IDHMD = 0 ;
96- IDController = 1 ;
97- IDController2 = 2 ;
98-
9994var
10095 Main: TMain;
10196 LibPath: string;
@@ -173,10 +168,10 @@ procedure TMain.GetBtnClick(Sender: TObject);
173168 Label14.Caption:=' Pitch = ' + FloatToStr(myController.Pitch);
174169 Label15.Caption:=' Roll = ' + FloatToStr(myController.Roll);
175170
176- if (myController.Buttons and 1 ) <> 0 then keys:=keys + ' 1 ' ;
177- if (myController.Buttons and 2 ) <> 0 then keys:=keys + ' 2 ' ;
178- if (myController.Buttons and 4 ) <> 0 then keys:=keys + ' 3 ' ;
179- if (myController.Buttons and 8 ) <> 0 then keys:=keys + ' 4 ' ;
171+ if (myController.Buttons and 1 ) <> 0 then keys:=keys + ' GP ' ;
172+ if (myController.Buttons and 2 ) <> 0 then keys:=keys + ' TS ' ;
173+ if (myController.Buttons and 4 ) <> 0 then keys:=keys + ' MN ' ;
174+ if (myController.Buttons and 8 ) <> 0 then keys:=keys + ' SM ' ;
180175
181176 if keys <> ' ' then
182177 Label16.Caption:=' Buttons = ' + keys;
@@ -197,10 +192,10 @@ procedure TMain.GetBtnClick(Sender: TObject);
197192
198193 keys:=' ' ;
199194
200- if (myController2.Buttons and 1 ) <> 0 then keys:=keys + ' 1 ' ;
201- if (myController2.Buttons and 2 ) <> 0 then keys:=keys + ' 2 ' ;
202- if (myController2.Buttons and 4 ) <> 0 then keys:=keys + ' 3 ' ;
203- if (myController2.Buttons and 8 ) <> 0 then keys:=keys + ' 4 ' ;
195+ if (myController2.Buttons and 1 ) <> 0 then keys:=keys + ' GP ' ;
196+ if (myController2.Buttons and 2 ) <> 0 then keys:=keys + ' TS ' ;
197+ if (myController2.Buttons and 4 ) <> 0 then keys:=keys + ' MN ' ;
198+ if (myController2.Buttons and 8 ) <> 0 then keys:=keys + ' SM ' ;
204199
205200 if keys <> ' ' then
206201 Label27.Caption:=' Buttons = ' + keys;
@@ -241,14 +236,14 @@ procedure TMain.Button1Click(Sender: TObject);
241236var
242237 iResult: integer;
243238begin
244- iResult:=SetCentering(IDHMD );
239+ iResult:=SetCentering(0 );
245240 if iResult = 1 then ShowMessage(' Centering success' );
246241end ;
247242
248243procedure TMain.Button2Click (Sender: TObject);
249244begin
250- SetControllerData(IDController, 65535 );
251- SetControllerData(IDController2, 32761 );
245+ SetControllerData(1 , 32761 );
246+ SetControllerData(2 , 65535 );
252247end ;
253248
254249end .
0 commit comments