Contents |
This hack makes PuTTY play a sound each time text is output to the terminal. Needless to say, that can be really annoying if the sound is loud. Select a low amplitude sound and you get a nice retro-terminal feel and sound feedback, enabling you to leave the computer alone and still be alerted when anything happens.
Please note that:
do_text_internal, so you might want to disable cursor blinking.
"c:\samples\beep.wav", you might want to change that.
Change putty-src\WINDOWS\WINDOW.C:
void do_text_internal(Context ctx, int x, int y, wchar_t *text, int len,
unsigned long attr, int lattr)
{
// ...
// <Noisy PuTTY Patch>
static long lastbeep = 0;
long beepdiff;
beepdiff = GetTickCount() - lastbeep;
if (!(beepdiff >= 0 && beepdiff < 7)) {
PlaySound("c:\\samples\\beep.wav", NULL,
SND_NOWAIT | SND_ASYNC | SND_FILENAME);
/*
* The above MessageBeep call takes time, so we record the
* time _after_ it finishes rather than before it starts.
*/
lastbeep = GetTickCount();
}
// </Noisy PuTTY Patch>
}
You can download an example beep.wav from this location.