1
0
mirror of https://github.com/DarthAffe/CUE.NET.git synced 2025-12-12 08:48:30 +00:00

Merge pull request #70 from hmmwhatsthisdo/enablekeypresscallback_issue69

Add sanity-check to CueSDK.EnableKeypressHandler()
This commit is contained in:
DarthAffe 2018-04-22 16:45:09 +02:00 committed by GitHub
commit 850eb66b3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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);
}