Foottracking with optical mouse sensors as keyboard output

when moving in the treadmill over the carpet surface the Up-Down movement

Take a look at your mouse. What, exactly, does it do when you move it up (off the desk) or down (onto the desk)?

If up and down mean something else to you, a picture is worth 1000 words.