/// <summary> /// Attaches the major hotkey events /// to the Hotkey Listener. /// </summary> private void AttachEvents() { _handle.HotkeyPressed += (s, e) => { HotkeyPressed?.Invoke( new SourceApplication( SourceAttributes.GetID(), SourceAttributes.GetHandle(), SourceAttributes.GetName(), SourceAttributes.GetTitle(), SourceAttributes.GetPath(), SourceAttributes.GetSelection() ), new HotkeyEventArgs { Hotkey = e.Hotkey, SourceApplication = new SourceApplication( SourceAttributes.GetID(), SourceAttributes.GetHandle(), SourceAttributes.GetName(), SourceAttributes.GetTitle(), SourceAttributes.GetPath(), SourceAttributes.GetSelection() ) }); }; }
/// <summary> /// [Special] Gets the currently selected text in the active application. /// </summary> /// <returns>The selected text, if any.</returns> public string GetSelection() { return(SourceAttributes.GetSelection()); }