Generic input device handling library