Merge pull request #70 from hmmwhatsthisdo/enablekeypresscallback_issue69

Add sanity-check to CueSDK.EnableKeypressHandler()
This commit is contained in:
DarthAffe authored and GitHub committed 2018-04-22 16:45:09 +02:00
commit 850eb66b3b
1 file changed
+3
+3
View File
@@ -269,6 +269,9 @@ namespace CUE.NET
if (!IsInitialized)
throw new WrapperException("CueSDK isn't initialized.");
if (_onKeyPressedDelegate != null)
return;
_onKeyPressedDelegate = OnKeyPressed;
_CUESDK.CorsairRegisterKeypressCallback(Marshal.GetFunctionPointerForDelegate(_onKeyPressedDelegate), IntPtr.Zero);
}