Set Device1 = New TDxInput.Device
I would agree with Nuno.
The quoted code creates a new instance of the tdxinput for 3dxware. 3dxware only routes 3D Mouse data to a foreground app with a device instance. Invoking the subroutine creates a new device and querying it for already received data will draw a blank - it is new.
The correct practice would be to create the device once at startup/open and then only query the data in the subroutine.