Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to terminate ActionTriggers right way
#2
`ActionTriggers.Stop`.
 
Code:
Copy      Help
// script "ActionTriggers cancellation.cs"
using Au.Triggers;

ActionTriggers Triggers = new();

//this thread will stop triggers after 5 s
_ = Task.Run(() => {
    5.s();
    Triggers.Stop();
});


Triggers.Hotkey["Ctrl+K"] = o => { print.it(o); };

Triggers.RunThread();

print.it("stopped");

Quote:inside a windows service to respond on third party windows etc
If it's a true Windows service, triggers won't work in its process, because services run in non-interactive session 0.


Messages In This Thread
RE: How to terminate ActionTriggers right way - by Gintaras - 03-06-2026, 12:32 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)