From ca45ed7ccc334c8dc8065671ed436be705174b3c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 30 Apr 2012 20:55:55 +0000 Subject: Implement key repeat ignore on Windows. --- pugl/pugl_win.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'pugl') diff --git a/pugl/pugl_win.cpp b/pugl/pugl_win.cpp index 6c4b07f..03bee11 100644 --- a/pugl/pugl_win.cpp +++ b/pugl/pugl_win.cpp @@ -212,8 +212,6 @@ puglProcessEvents(PuglView* view) { MSG msg; PAINTSTRUCT ps; - int button; - bool down = true; PuglKey key; while (PeekMessage(&msg, view->impl->hwnd, 0, 0, PM_REMOVE)) { setModifiers(view); @@ -265,6 +263,9 @@ puglProcessEvents(PuglView* view) } break; case WM_KEYDOWN: + if (view->ignoreKeyRepeat && (msg.lParam & (1 << 30))) { + break; + } // else nobreak case WM_KEYUP: if (key = keySymToSpecial(msg.wParam)) { if (view->specialFunc) { -- cgit v1.2.1