Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Removes a callback method. The method will no longer be called, and you may remove resources from the callback function after UnregisterCallback completes.
Syntax
bool UnregisterCallback(
GameInputCallbackToken callbackToken
);
Parameters
callbackToken _In_
Type: GameInputCallbackToken
Token for the callback function to be unregistered. Generated when the function was initially registered with IGameInput::RegisterDeviceCallback.
Return value
Type: bool
True if callback was unregistered successfully.
Remarks
The IGameInput::StopCallback method and IGameInput::UnregisterCallback methods differ slightly. Calling either method ensures that the associated callback will not be dispatched again. However, it is not safe to free any resources associated with the callback (for example, unloading the DLL that hosts the callback function) until the UnregisterCallback function successfully returns. Therefore, it is not possible to unregister a callback from within its registered callback function, and attempting to do so will trigger a fatal assert. However, it is safe to cancel a callback from within the callback function.
The following C++ sample demonstrates how to get notified when a gamepad or keyboard is disconnected.
Input API Overview
IGameInput
IGameInput::RegisterDeviceCallback
IGameInput::RegisterReadingCallback
IGameInput::RegistersystemButtonCallback