private IntPtr HookDelegate(int nCode, IntPtr wParam, IntPtr lParam) { var message = new Message() { nCode = nCode, wParam = wParam, lParam = lParam }; if (message.ShouldBeProcessed()) ProcessMessage(message); return HookApi.CallNextHookEx(_hookHandle, nCode, wParam, lParam); }
private void ProcessMessage(Message message) { if (_hotkeys.ContainsKey(message.Key)) _hotkeys[message.Key](); }