Let me see if I have this straight:
You want to monitor the track on a treadmill as the input to a mouse port. Correct?
If so, what you need is a good old roller ball mouse that supports a USB connection.
Open the mouse and take a look at the innards.
You will see 2 slotted wheels that are driven by the mouse roller.
The slots in the wheels spin past an optical gate that senses the slots in the wheel to determine direction and speed.
What you need to do, is drive the slotted wheel from the treadmill, while keeping the wheel properly aligned to the gate.
One way to do this would be to connect a pulley to the shaft of either roller on the treadmill.
Then, run a belt from the pulley to the shaft of the mouse wheel.
By changing the size of the pulleys used, you can change the rate of mouse movement versus treadmill speed.
You do want to keep the sensor covered to avoid interference issues from stray light.
Chas