diff --git a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp index 0942105ae9..1e6aa93dab 100644 --- a/modules/juce_gui_basics/native/juce_win32_Windowing.cpp +++ b/modules/juce_gui_basics/native/juce_win32_Windowing.cpp @@ -2965,19 +2965,11 @@ public: { if (Process::isForegroundProcess()) { - // simulate a shift key getting pressed.. - INPUT input[2]; - input[0].type = INPUT_KEYBOARD; - input[0].ki.wVk = VK_SHIFT; - input[0].ki.dwFlags = 0; - input[0].ki.dwExtraInfo = 0; + INPUT input = { 0 }; + input.type = INPUT_MOUSE; + input.mi.mouseData = MOUSEEVENTF_MOVE; - input[1].type = INPUT_KEYBOARD; - input[1].ki.wVk = VK_SHIFT; - input[1].ki.dwFlags = KEYEVENTF_KEYUP; - input[1].ki.dwExtraInfo = 0; - - SendInput (2, input, sizeof (INPUT)); + SendInput (1, &input, sizeof (INPUT)); } } }; @@ -2997,24 +2989,6 @@ bool Desktop::isScreenSaverEnabled() return screenSaverDefeater == nullptr; } -/* (The code below is the "correct" way to disable the screen saver, but it - completely fails on winXP when the saver is password-protected...) - -static bool juce_screenSaverEnabled = true; - -void Desktop::setScreenSaverEnabled (const bool isEnabled) noexcept -{ - juce_screenSaverEnabled = isEnabled; - SetThreadExecutionState (isEnabled ? ES_CONTINUOUS - : (ES_DISPLAY_REQUIRED | ES_CONTINUOUS)); -} - -bool Desktop::isScreenSaverEnabled() noexcept -{ - return juce_screenSaverEnabled; -} -*/ - //============================================================================== void LookAndFeel::playAlertSound() {