Platform-independent input handling.