How do I wire these to my Arduino Leonardo?

This is a motherboard from Hp Deskjet d1360, and I need the rotary encoder for the steering wheel I'm building to play games with. And my questions is how do I wire it? Thanks!