From 7bb0bdcd09d2dbe2bd0132fc9433a8c0091da18d Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 14 Sep 2013 18:33:45 +0200 Subject: Reduce macro scope --- facetracknoir/shortcuts.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'facetracknoir/shortcuts.cpp') diff --git a/facetracknoir/shortcuts.cpp b/facetracknoir/shortcuts.cpp index c2778806..cf4b81f8 100644 --- a/facetracknoir/shortcuts.cpp +++ b/facetracknoir/shortcuts.cpp @@ -179,10 +179,6 @@ KeybindingWorkerImpl::KeybindingWorkerImpl(FaceTrackNoIR& w, Key keyCenter) should_quit = false; } -#define PROCESS_KEY(k, s) \ - if (isKeyPressed(&k, keystate) && (!k.ever_pressed ? (k.timer.start(), k.ever_pressed = true) : k.timer.restart() > 100)) \ - window.s(); - static bool isKeyPressed( const Key *key, const BYTE *keystate ) { bool shift; bool ctrl; @@ -208,6 +204,10 @@ static bool isKeyPressed( const Key *key, const BYTE *keystate ) { return false; } +#define PROCESS_KEY(k, s) \ + if (isKeyPressed(&k, keystate) && (!k.ever_pressed ? (k.timer.start(), k.ever_pressed = true) : k.timer.restart() > 100)) \ + window.s(); + void KeybindingWorkerImpl::run() { BYTE keystate[256]; while (!should_quit) @@ -223,5 +223,6 @@ void KeybindingWorkerImpl::run() { Sleep(25); } } + #else #endif -- cgit v1.2.3