mirror of
https://github.com/DarthAffe/CUE.NET.git
synced 2025-12-12 08:48:30 +00:00
Add sanity-check to CueSDK.EnableKeypressHandler() to ensure handlers are only enabled once. Resolves #69.
This commit is contained in:
parent
3b4649604f
commit
f3f7f498af
@ -269,6 +269,9 @@ namespace CUE.NET
|
|||||||
if (!IsInitialized)
|
if (!IsInitialized)
|
||||||
throw new WrapperException("CueSDK isn't initialized.");
|
throw new WrapperException("CueSDK isn't initialized.");
|
||||||
|
|
||||||
|
if (_onKeyPressedDelegate != null)
|
||||||
|
return;
|
||||||
|
|
||||||
_onKeyPressedDelegate = OnKeyPressed;
|
_onKeyPressedDelegate = OnKeyPressed;
|
||||||
_CUESDK.CorsairRegisterKeypressCallback(Marshal.GetFunctionPointerForDelegate(_onKeyPressedDelegate), IntPtr.Zero);
|
_CUESDK.CorsairRegisterKeypressCallback(Marshal.GetFunctionPointerForDelegate(_onKeyPressedDelegate), IntPtr.Zero);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user