Make the script compatible with python 3 as well

This should work the same way if python3-uinput and python3-pyusb are installed.