Check for IndexError

It's happened to me on a laptop, where the trackpad has probably been detected as a joystick interface. The error becomes very annoying.
I'm not sure if this check is enough to silence it, but I think we should check that `b` isn't out of range anyway.
Check for b in buttons
Merge pull request #6 from efernandez/patch-2

Filter out buttons not available