bool hook_HookEvent(HookEventArgs e, KeyBoardInfo keyBoardInfo) { if (keyBoardInfo.vkCode == 117) { if (e.wParam == volumeUp) { MainMap.Zoom = (int)(MainMap.Zoom) + 1; } } else if (keyBoardInfo.vkCode == 118) { if (e.wParam == volumeUp) { MainMap.Zoom = (int)(MainMap.Zoom) - 1; } } return(true); }
private int HookProcedure(int code, IntPtr wParam, IntPtr lParam) { KBDLLHOOKSTRUCT kbdllhookstruct = (KBDLLHOOKSTRUCT) Marshal.PtrToStructure(lParam, typeof(KBDLLHOOKSTRUCT)); if(code >= 0) { HookEventArgs hookArgs = new HookEventArgs(); hookArgs.Code = code; hookArgs.wParam = wParam; hookArgs.lParam = lParam; KeyBoardInfo keyBoardInfo = new KeyBoardInfo(); keyBoardInfo.vkCode = kbdllhookstruct.vkCode; keyBoardInfo.scanCode = kbdllhookstruct.scanCode; if(this.OnHookEvent(hookArgs, keyBoardInfo)) { return 1; } } return CallNextHookEx(this.hookDeleg, code, wParam, lParam); }
private int HookProcedure(int code, IntPtr wParam, IntPtr lParam) { KBDLLHOOKSTRUCT kbdllhookstruct = (KBDLLHOOKSTRUCT)Marshal.PtrToStructure(lParam, typeof(KBDLLHOOKSTRUCT)); if (code >= 0) { HookEventArgs hookArgs = new HookEventArgs(); hookArgs.Code = code; hookArgs.wParam = wParam; hookArgs.lParam = lParam; KeyBoardInfo keyBoardInfo = new KeyBoardInfo(); keyBoardInfo.vkCode = kbdllhookstruct.vkCode; keyBoardInfo.scanCode = kbdllhookstruct.scanCode; if (this.OnHookEvent(hookArgs, keyBoardInfo)) { return(1); } } return(CallNextHookEx(this.hookDeleg, code, wParam, lParam)); }
bool hook_HookEvent(HookEventArgs e, KeyBoardInfo keyBoardInfo) { if(keyBoardInfo.vkCode == 117) { if(e.wParam == volumeUp) { MainMap.Zoom = (int) (MainMap.Zoom) + 1; } } else if(keyBoardInfo.vkCode == 118) { if(e.wParam == volumeUp) { MainMap.Zoom = (int) (MainMap.Zoom) - 1; } } return true; }
protected virtual bool OnHookEvent(HookEventArgs hookArgs, KeyBoardInfo keyBoardInfo) { return ((this.HookEvent != null) && this.HookEvent(hookArgs, keyBoardInfo)); }
protected virtual bool OnHookEvent(HookEventArgs hookArgs, KeyBoardInfo keyBoardInfo) { return((this.HookEvent != null) && this.HookEvent(hookArgs, keyBoardInfo)); }