Skip to content

Commit

Permalink
fixed a bug in getting "not in movement" value of DPad/POV
Browse files Browse the repository at this point in the history
  • Loading branch information
DeveloppeurPascal committed Apr 10, 2023
1 parent 8b8ded2 commit 9a4d184
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Gamolf.RTL.Joystick.Windows.pas
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,10 @@ procedure TGamolfJoystickWindowsService.getInfo(JoystickID: TJoystickID;
end;

if ((FTabDevCaps[JoystickID].JoyCapsW.wcaps and JOYCAPS_HASPOV) > 0)
then
Joystick.DPad := JoyInfoEx.dwpov div 100
then begin
Joystick.DPad := JoyInfoEx.dwpov div 100;
if Joystick.DPad>359 then Joystick.DPad := ord(TJoystickDPad.Center);
end
else
Joystick.DPad := ord(TJoystickDPad.Center);
end;
Expand Down

0 comments on commit 9a4d184

Please sign in to comment.