> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# IGameInput::StopCallback

> IGameInput::StopCallback

# IGameInput::StopCallback

停止触发一个回调函数。

## 语法

```cpp theme={null}
void StopCallback(
    GameInputCallbackToken callbackToken
);
```

### 参数

*callbackToken*   \_In\_\
类型:GameInputCallbackToken

要停止的回调函数的令牌。该令牌在最初通过 [IGameInput::RegisterDeviceCallback](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinput/methods/igameinput_registerdevicecallback.md) 注册函数时生成。

### 返回值

类型:void

无返回值。

## 注解

此函数与 [IGameInput::UnregisterCallback](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinput/methods/igameinput_unregistercallback.md) 函数的区别在于：它不能确保您可以安全地释放与回调函数关联的资源，但它可以从回调函数内部调用。

**StopCallback** 方法与 [IGameInput::UnregisterCallback](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinput/methods/igameinput_unregistercallback.md) 方法略有不同。调用任一方法都可确保关联的回调不再被分发。但是，在 [IGameInput::UnregisterCallback](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinput/methods/igameinput_unregistercallback.md) 函数成功返回之前，释放与回调关联的任何资源（例如卸载承载回调函数的 DLL）都是不安全的。因此，无法在已注册的回调函数内部注销该回调，尝试这样做将触发致命断言。但是，在回调函数内部取消回调是安全的。

## 要求

**头文件:** GameInput.h

[Input API 概述](https://docs.xbox.com/zh-CN/build/core-features/common/input/overviews/input-overview.md)\
[IGameInput](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinput/igameinput.md)\
[IGameInput::RegisterDeviceCallback](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinput/methods/igameinput_registerdevicecallback.md)\
[IGameInput::RegisterReadingCallback](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinput/methods/igameinput_registerreadingcallback.md)\
[IGameInput::RegisterSystemButtonCallback](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinput/methods/igameinput_registersystembuttoncallback.md)

## 版本历史

| 版本 | 变更 |
| - | - |
| **v0** | 引入。 |


## Related topics

- [IGameInput::RegisterDeviceCallback](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinput/methods/igameinput_registerdevicecallback.md)
- [IGameInput::RegisterReadingCallback](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinput/methods/igameinput_registerreadingcallback.md)
- [IGameInput::RegisterKeyboardLayoutCallback](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinput/methods/igameinput_registerkeyboardlayoutcallback.md)
- [IGameInput::UnregisterCallback](https://docs.xbox.com/zh-CN/reference/input/gameinput/interfaces/igameinput/methods/igameinput_unregistercallback.md)
- [IGameInput::RegisterGuideButtonCallback（已弃用）](https://docs.xbox.com/zh-CN/reference/input/gameinput/deprecated/interfaces/igameinput/methods/igameinput_registerguidebuttoncallback.md)
