Beispiel #1
0
        /// <summary>
        ///     Handles a key press event
        /// </summary>
        private void OnKeyPress(BaseKeyboardManager sender, HotkeyEventArgs args) {
            //handles which process was it hit on,

            var topmost = ProcessFinder.GetForegroundProcess().ToProcessInfo();

            var topmost_log = ActiveLogs.FirstOrDefault(log => log.Process.Equals(topmost));
            if (topmost_log == null) {
                ActiveLogs.Add(topmost_log = new ProcessLog() {Process = topmost});
                topmost_log.LineClosed += line => LineClosed?.Invoke(line);
            }
            //Convert Hotkey to LogKey - includes in keyboardlayout
            var lk = new LogKey { Key = args.Hotkey.Key, Modifiers = args.Hotkey.Modifiers, KeyboardLayout = KeyboardLanguage.GetCurrentKeyboardLayout() }; //67699721 hebrew?
            topmost_log.AddContent(lk);
        }
Beispiel #2
0
        /// <summary>
        ///     Handles a key press event
        /// </summary>
        private void OnKeyPress(BaseKeyboardManager sender, HotkeyEventArgs args)
        {
            //handles which process was it hit on,

            var topmost = ProcessFinder.GetForegroundProcess().ToProcessInfo();

            var topmost_log = ActiveLogs.FirstOrDefault(log => log.Process.Equals(topmost));

            if (topmost_log == null)
            {
                ActiveLogs.Add(topmost_log = new ProcessLog()
                {
                    Process = topmost
                });
                topmost_log.LineClosed += line => LineClosed?.Invoke(line);
            }
            //Convert Hotkey to LogKey - includes in keyboardlayout
            var lk = new LogKey {
                Key = args.Hotkey.Key, Modifiers = args.Hotkey.Modifiers, KeyboardLayout = KeyboardLanguage.GetCurrentKeyboardLayout()
            };                                                                                                                                              //67699721 hebrew?

            topmost_log.AddContent(lk);
        }