InputDevice: Add methods.

This is based on changes in this patch:
https://bugzilla.gnome.org/show_bug.cgi?id=725125#c9