1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-02 03:52:49 -05:00

Modified form of Jim Lucas's PC speaker patch. I don't like

discriminating on the Windows version in order to decide whether to
call MessageBeep(-1) or Beep() - I'd prefer to directly test the
specific OS property in any given case - but it looks as if this is
the best available option.

[originally from svn r3208]
This commit is contained in:
Simon Tatham
2003-05-24 12:31:32 +00:00
parent 2b6fb2ceae
commit 9ebeefa470
3 changed files with 27 additions and 6 deletions

View File

@ -4406,6 +4406,23 @@ void beep(void *frontend, int mode)
MB_OK | MB_ICONEXCLAMATION);
cfg.beep = BELL_DEFAULT;
}
} else if (mode == BELL_PCSPEAKER) {
static long lastbeep = 0;
long beepdiff;
beepdiff = GetTickCount() - lastbeep;
if (beepdiff >= 0 && beepdiff < 50)
return;
/*
* We must beep in different ways depending on whether this
* is a 95-series or NT-series OS.
*/
if(osVersion.dwPlatformId == VER_PLATFORM_WIN32_NT)
Beep(800, 100);
else
MessageBeep(-1);
lastbeep = GetTickCount();
}
/* Otherwise, either visual bell or disabled; do nothing here */
if (!term->has_focus) {