3232// ─────────────────────────────────────────────────────────────────────────────
3333
3434static std::atomic<bool > g_running{true };
35- static std::atomic<bool > g_reload{false }; // set by SIGHUP
35+ static std::atomic<bool > g_reload{false }; // set by SIGHUP (Linux only)
3636
3737static void on_sigint (int )
3838{
3939 std::cout << " \n [exit] SIGINT\n " ;
4040 g_running.store (false );
4141}
42+
43+ #if !defined(_WIN32)
4244static void on_sighup (int ) { g_reload.store (true ); }
45+ #endif
4346
4447// ─────────────────────────────────────────────────────────────────────────────
4548// Hotkey thread
@@ -131,7 +134,7 @@ static std::string find_keyboard()
131134
132135 bool has_f1 = (key_bits[KEY_F1 / 8 ] >> (KEY_F1 % 8 )) & 1 ;
133136 bool has_a = (key_bits[KEY_A / 8 ] >> (KEY_A % 8 )) & 1 ;
134- bool has_rep = (ev_bits[EV_REP / 8 ] >> (EV_REP % 8 )) & 1 ; // ← fixed
137+ bool has_rep = (ev_bits[EV_REP / 8 ] >> (EV_REP % 8 )) & 1 ;
135138
136139 std::string lo (name);
137140 std::transform (lo.begin (), lo.end (), lo.begin (), ::tolower);
@@ -344,7 +347,10 @@ static void print_config(const Config &cfg)
344347 << " tracking : lost_thresh=" << cfg.lost_frames_thresh << ' \n '
345348 << " debug : " << (cfg.debug ? " true" : " false" ) << ' \n '
346349 << " \n F1=exit F2=toggle aim F3=toggle debug F4=toggle triggerbot\n "
347- << " kill -HUP <pid> to hot-reload config.json\n\n " ;
350+ #if !defined(_WIN32)
351+ << " kill -HUP <pid> to hot-reload config.json\n "
352+ #endif
353+ << " \n " ;
348354}
349355
350356// ─────────────────────────────────────────────────────────────────────────────
@@ -354,7 +360,9 @@ static void print_config(const Config &cfg)
354360int main ()
355361{
356362 std::signal (SIGINT , on_sigint);
363+ #if !defined(_WIN32)
357364 std::signal (SIGHUP , on_sighup); // kill -HUP <pid> → hot-reload config
365+ #endif
358366
359367 Config cfg;
360368 try
@@ -418,12 +426,13 @@ int main()
418426
419427 // ── Main thread: debug display + SIGHUP hot-reload ────────────────────────
420428 // disp is declared once outside the loop so the buffer is reused every
421- // frame (copyTo in DisplayFrame won't alloc as long as dims stay the same)
429+ // frame (copyTo won't alloc as long as dims stay the same)
422430 DisplayFrame df;
423431 cv::Mat disp;
424432
425433 while (g_running.load ())
426434 {
435+ #if !defined(_WIN32)
427436 // ── SIGHUP config hot-reload ──────────────────────────────────────
428437 // Reloads config.json at runtime — no restart needed when tweaking
429438 // tolerance, fov, smoothness, etc. CaptureThread and AimThread hold
@@ -444,6 +453,7 @@ int main()
444453 std::cerr << " [config] Reload failed: " << e.what () << ' \n ' ;
445454 }
446455 }
456+ #endif
447457
448458 if (!debug.load ())
449459 {
0 commit comments