[Solved] Necessity of Physical Simulation lazarus / 34-Windows ---------------------------------------------------------------------- loaded · 2025-05-30 12:44 Hi All, Can mouse or keyboard movements be physically simulated in the Windows operating system? To prevent the screen saver from being activated. ---------------------------------------------------------------------- 440bx · 2025-05-30 13:15 Quote from: loaded on May 30, 2025, 02:44:23 pmHi All, Can mouse or keyboard movements be physically simulated in the Windows operating system? To prevent the screen saver from being activated. The answer to the those events being susceptible to be simulated is yes but, not really physically as that would require a ring-0 driver to fool the corresponding driver into believing a character was retrieved by the keyboard controller or a physical mouse movement occurred. It's not hard to simulate keyboard or mouse events.  Check out the following link: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf- winuser-sendinput What I don't know is if the simulated input using that function will prevent the screen saver from being activated but, it's fairly easy to test.  My guess is it probably does. HTH. ETA: Based on what it says in the following article: https://stackoverflow.com/questions/463813/programmatically-prevent- windows-screensaver-from-starting SendInput will prevent the screen saver from starting and apparently, the call to SendInput doesn't even have to move the mouse to be effective.  It can simply move the mouse to where the mouse already is to prevent the screen saver from starting. ---------------------------------------------------------------------- loaded · 2025-05-30 13:34 Thanks 440bx, the tip you gave was like a small match burning a big tree. I didn't think I would find a solution so quickly. ---------------------------------------------------------------------- ccrause · 2025-05-30 14:05 Quote from: loaded on May 30, 2025, 02:44:23 pmTo prevent the screen saver from being activated. While one can fake user interaction to prevent the screen saver from starting, there is also a Wndows API to manage this more formally: SetThreadExecutionState.  See for example this discussion. ---------------------------------------------------------------------- loaded · 2025-05-30 18:13 Thanks a lot for the extra information ccrause.  🧐