IGameInput::UnregisterCallback
Removes a callback method. The method will no longer be called, and you may remove resources from the callback function after UnregisterCallback completes.Syntax
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 OverviewIGameInput
IGameInput::RegisterDeviceCallback
IGameInput::RegisterReadingCallback
IGameInput::RegistersystemButtonCallback
