/// <summary> /// Registers a callback that will be called by SDK when some event happened /// </summary> /// <param name="onEvent">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 CorsairSubscribeForEvents(CorsairEventHandler onEvent, IntPtr context) { var callbackMethod = new CUESDKNative.CorsairEventHandler((IntPtr ctx, CorsairEvent cEvent) => { onEvent?.Invoke(context, cEvent); }); return(CUESDKNative.CorsairSubscribeForEvents(callbackMethod, new IntPtr())); }
public static bool Subscribe(CorsairEventHandler onEvent, IntPtr context) => Native.CorsairSubscribeForEvents(onEvent, context);
public static extern bool CorsairSubscribeForEvents(CorsairEventHandler onEvent, IntPtr context);