private static void UnsubscribeInner(KeyboardListener instance) {
if (Subscribed.Remove(instance) && Subscribed.Count == 0 && _hookHandle != 0) {
var result = User32.UnhookWindowsHookEx(_hookHandle);
_hookHandle = 0;
_hookProc = null;
AcToolsLogging.Write("Unsubscribed: " + result);
if (result == 0) throw new Win32Exception(Marshal.GetLastWin32Error());
}
}
#endregion