diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/stdidle/idle.cpp | 22 | ||||
-rw-r--r-- | src/modules/skin/hotkeys.cpp | 9 |
2 files changed, 8 insertions, 23 deletions
diff --git a/src/core/stdidle/idle.cpp b/src/core/stdidle/idle.cpp index 15981a872d..3991217fd8 100644 --- a/src/core/stdidle/idle.cpp +++ b/src/core/stdidle/idle.cpp @@ -140,7 +140,6 @@ static const WORD aa_Status[] = {ID_STATUS_AWAY, ID_STATUS_NA, ID_STATUS_OCCUPIE static IdleObject gIdleObject;
static HANDLE hIdleEvent;
-static BOOL (WINAPI * MyGetLastInputInfo)(PLASTINPUTINFO);
void CALLBACK IdleTimer(HWND hwnd, UINT umsg, UINT_PTR idEvent, DWORD dwTime);
@@ -186,25 +185,10 @@ static int IdleObject_IsUserIdle(IdleObject * obj) return GetTickCount() - dwTick > (obj->minutes * 60 * 1000);
}
- if (MyGetLastInputInfo != NULL) {
- LASTINPUTINFO ii;
- ZeroMemory(&ii, sizeof(ii));
- ii.cbSize = sizeof(ii);
- if (MyGetLastInputInfo(&ii))
- return GetTickCount() - ii.dwTime > (obj->minutes * 60 * 1000);
- }
- else {
- POINT pt;
- GetCursorPos(&pt);
- if (pt.x != obj->mousepos.x || pt.y != obj->mousepos.y) {
- obj->mousepos = pt;
- obj->mouseidle = 0;
- }
- else obj->mouseidle += 2;
+ LASTINPUTINFO ii = { sizeof(ii) };
+ if ( GetLastInputInfo(&ii))
+ return GetTickCount() - ii.dwTime > (obj->minutes * 60 * 1000);
- if (obj->mouseidle)
- return obj->mouseidle * 1000 >= (obj->minutes * 60 * 1000);
- }
return FALSE;
}
diff --git a/src/modules/skin/hotkeys.cpp b/src/modules/skin/hotkeys.cpp index fec07d812a..fc8ca86828 100644 --- a/src/modules/skin/hotkeys.cpp +++ b/src/modules/skin/hotkeys.cpp @@ -99,12 +99,13 @@ static LRESULT CALLBACK sttKeyboardProc(int code, WPARAM wParam, LPARAM lParam) for (int i=0; i < hotkeys.getCount(); i++) {
THotkeyItem *item = hotkeys[i];
+ if (item->type != HKT_LOCAL || !item->Enabled)
+ continue;
+
BYTE hkMod, hkVk;
- if (item->type != HKT_LOCAL) continue;
sttWordToModAndVk(item->Hotkey, &hkMod, &hkVk);
- if ( !hkVk) continue;
- if ( !item->Enabled) continue;
- if (item->pszService && (vk == hkVk) && (mod == hkMod)) {
+ if (!hkVk) continue;
+ if (item->pszService && vk == hkVk && mod == hkMod) {
CallService(item->pszService, 0, item->lParam);
return TRUE;
} } } }
|