Add a more compatible method of detecting hover

Fixes #2