Removed unused import
Added platform check to keyboard hook