procedure TForm1.DGCJoystick1Joy1BtnDown(B1, B2, B3, B4: Boolean); begin // If the appropriate button is pressed, change the panels color. // NOTE: The buttons return as boolean values. If the button // is pressed then it's value will be TRUE If B1 then Panel10.Color := clRed; If B2 then Panel11.Color := clRed; If B3 then Panel12.Color := clRed; if B4 then Panel13.Color := clRed; end; procedure TForm1.DGCJoystick1Joy1BtnUp(B1, B2, B3, B4: Boolean); begin // If the appropriate button was released, change the color back. // NOTE: The buttons return as boolean values. If the button was // released, then it's value will be TRUE If B1 then Panel10.Color := clMaroon; If B2 then Panel11.Color := clMaroon; If B3 then Panel12.Color := clMaroon; if B4 then Panel13.Color := clMaroon; end; |
procedure TForm1.DGCJoystick1Joy1Center(Sender: TObject); begin //If the Joystick is Centered (DIGITAL ONLY) Panel1.Color := clNavy; Panel2.Color := clNavy; Panel3.Color := clNavy; Panel4.Color := clNavy; Panel5.Color := clBlue; //Center Panel Panel6.Color := clNavy; Panel7.Color := clNavy; Panel8.Color := clNavy; Panel9.Color := clNavy; end; procedure TForm1.DGCJoystick1Joy1Down(Sender: TObject); begin //If the Joystick is Down (DIGITAL ONLY) Panel1.Color := clNavy; Panel2.Color := clNavy; Panel3.Color := clNavy; Panel4.Color := clNavy; Panel5.Color := clNavy; Panel6.Color := clNavy; Panel7.Color := clNavy; Panel8.Color := clBlue; //Down Panel Panel9.Color := clNavy; end; |
//Start capturing joystick messages DGCJoystick1.StartJoysticks; |
//Stop capturing Joystick Messages DGCJoystick1.StopJoysticks; |
// Demo3 プログラムです! 注意! procedure TForm1.DGCScreen1Flip(Sender: TObject); var ShipHit: Boolean; begin DGCJoystick1.UpdateJoysticks; if DGCJoystick1.Joy1Info.wXpos < 16000 then px := px - 2 else if DGCJoystick1.Joy1Info.wXpos > 48000 then px := px + 2; |