If you are using Clootie's DirectX 9 headers, you need add:
[pascal]{$DEFINE DIRECTX7}[/pascal]
to the top of the DirectInput.pas file to make it use DirectX 7 definitions.