cpp-remapper icon indicating copy to clipboard operation
cpp-remapper copied to clipboard

Support async

Open fredemmott opened this issue 2 years ago • 1 comments

  • add a co_await runner to profiles
  • support async lambdas and mappers

This is to allow:

  • running other stuff in the main profile run loop, e.g. a webserver
  • a nicer API for running stuff with a delay - co_await winrt::resume_after(std::chrono::milliseconds(100));

fredemmott avatar Jan 03 '24 23:01 fredemmott

  • most things (including DirectInput) can boil down to a waitable HANDLE, then WaitForMultipleObjects()
  • timers can either be implemented via CreateWaitableTimer() + SetWaitableTimer(), or by keeping track of them and using the timeout for WaitForMultipleObjects()
  • if windows are created (eg for a system tray icon), the event loop must run in the thread that owns the window, and use MsgWaitForMultipleObjects()

fredemmott avatar Jan 04 '24 14:01 fredemmott