diff options
Diffstat (limited to 'xW/xW.cpp')
-rw-r--r-- | xW/xW.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -165,6 +165,14 @@ window_get_text(HWND hWnd) return buffer; } +static void +beep() +{ + if (!PlaySound(MAKEINTRESOURCE(IDR_BEEP), + GetModuleHandle(NULL), SND_ASYNC | SND_RESOURCE)) + Beep(800, 100); +} + // --- Networking -------------------------------------------------------------- static bool @@ -785,8 +793,7 @@ relay_process_buffer_line(Buffer &b, Relay::EventData_BufferLine &m) if (line->is_highlight || (!visible && !line->is_unimportant && b.kind == Relay::BufferKind::PRIVATE_MESSAGE)) { - // TODO(p): Avoid the PC speaker, which is also unreliable. - Beep(800, 100); + beep(); if (!visible) { b.highlighted = true; @@ -1261,9 +1268,8 @@ input_complete(const InputStamp &state, const std::wstring &error, SendMessage(g.hwndInput, EM_REPLACESEL, TRUE, (LPARAM) insert.c_str()); } - // TODO(p): Avoid the PC speaker, which is also unreliable. if (response->completions.size() != 1) - Beep(800, 100); + beep(); // TODO(p): Show all completion options. } |