/// <summary> /// Registers a callback that will be called by SDK when some of G or M keys are pressed or released /// </summary> /// <param name="CallbackType">Callback that is called by SDK when key is pressed or released</param> /// <param name="context">Arbitrary context that will be returned in callback call. Can be NULL.</param> /// <returns>Boolean value. True if successful. Use CorsairGetLastError() to check the reason of failure</returns> public static bool CorsairRegisterKeypressCallback(CorsairRegisterKeypressCallbackCallback CallbackType, object context) { var callbackMethod = new CUESDKNative.CorsairRegisterKeypressCallbackCallback((IntPtr nativeContext, CorsairKeyId keyId, bool pressed) => { CallbackType?.Invoke(context, keyId, pressed); }); return(CUESDKNative.CorsairRegisterKeypressCallback(callbackMethod, new IntPtr())); }
public static extern bool CorsairRegisterKeypressCallback(CorsairRegisterKeypressCallbackCallback CallbackType, IntPtr context);