summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsje <sje@4f64403b-2f21-0410-a795-97e2b3489a10>2007-01-25 13:39:29 +0000
committersje <sje@4f64403b-2f21-0410-a795-97e2b3489a10>2007-01-25 13:39:29 +0000
commit3b417126cb3f5e7c0d4bbc026913387add8d192d (patch)
tree9478e9b3653ae9e5b2b15e614cd91ea7bbac2cdb
parent8bbcba6b7a48fd8f6e72728c4b78d9df157bf2de (diff)
fix for key state not reset correctly
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@77 4f64403b-2f21-0410-a795-97e2b3489a10
-rw-r--r--last_contact/LastContact.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/last_contact/LastContact.cpp b/last_contact/LastContact.cpp
index ba66cca..6bb0fb2 100644
--- a/last_contact/LastContact.cpp
+++ b/last_contact/LastContact.cpp
@@ -52,7 +52,7 @@ void stack_update(MessageWindowEventData *data) {
PLUGININFO pluginInfo={
sizeof(PLUGININFO),
MODULE,
- PLUGIN_MAKE_VERSION(0,0,0,4),
+ PLUGIN_MAKE_VERSION(0,0,0,5),
"Re-open the last open message window using a configurable hot key.",
"Scott Ellis",
"mail@scottellis.com.au",
@@ -138,10 +138,16 @@ int Shutdown(WPARAM wParam, LPARAM lParam) {
}
void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD) {
- if(GetAsyncKeyState(options.vk)
- && (options.mod_alt == false || GetAsyncKeyState(VK_MENU))
- && (options.mod_shift == false || GetAsyncKeyState(VK_SHIFT))
- && (options.mod_ctrl == false || GetAsyncKeyState(VK_CONTROL)))
+ // read all values - GetAsyncKeyState function is statefull
+ short state_key = GetAsyncKeyState(options.vk),
+ state_menu = GetAsyncKeyState(VK_MENU),
+ state_shift = GetAsyncKeyState(VK_SHIFT),
+ state_control = GetAsyncKeyState(VK_CONTROL);
+
+ if(state_key
+ && (options.mod_alt == false || state_menu)
+ && (options.mod_shift == false || state_shift)
+ && (options.mod_ctrl == false || state_control))
{
MessageWindowEventData wd;
if(stack_pop(&wd)) {