/// <summary> /// Remove all hooks if set when closing form /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FrmMain_FormClosing(object sender, FormClosingEventArgs e) { myDevice.CloseDevice(); RemoveLocalMouseHook(); RemoveGlobalLLMouseHook(); RemoveLocalKeyboardHook(); RemoveGlobalLLKeyboardHook(); }
void OnApplicationQuit() { Debug.Log("Application ending after " + Time.time + " seconds"); myDevice.CloseDevice(); }