06-21-2007, 08:40 PM
How can QM detect when something has been copied to the clipboard?
How to detect clipboard copy
|
06-21-2007, 08:40 PM
How can QM detect when something has been copied to the clipboard?
06-22-2007, 06:07 AM
Where you will use it? Should it be like a trigger, or like a wait command in macro?
To press Ctrl+C and wait until clipboard is populated, use getsel function of str. str s s.getsel ;;presses Ctrl+C, waits until clipboard is populated, and stores the text into s
06-22-2007, 11:49 AM
Yes, I think I can simply trigger on Ctrl+C, use .getsel. But a trigger that used the clipboard chain would also work when copying via menu selection, toolbar button, etc.
06-29-2007, 12:16 PM
I'm processing copying in other applications triggered on Cc:
;;keep stack of recently copied text This results in several applications on my computer reporting the inability to access the clipboard every other time Ctrl+C is pressed. Is there a better way? A true trigger on the WM_DRAWCLIPBOARD notification would be preferable since it would also handle copy via the mouse, cut, copy with another keyboard shortcut, etc. Thanks.
06-29-2007, 12:28 PM
I don't know about how to do this in qm but i use yankee clipper to keep a clipboard history.
http://www.intelexual.com/products/index.aspx
06-29-2007, 12:39 PM
I had been using ClipX http://bluemars.org/clipx/ which works great except for a couple annoyances, and I'm trying to reduce the # of apps I need installed, so I rewrote it in QM in about 60 lines of code. But the problem/limitation above is annoying.
06-29-2007, 12:40 PM
getsel also presses Ctrl+C. Instead of
getsel ... key Cc Try opt clip 1 ;;don't restore clipboard text getsel ;and no key Cc ------ Quote:A true trigger on the WM_DRAWCLIPBOARD notification would be preferable You can create this trigger in QM. It is possible to add user-defined triggers to Properties.
06-29-2007, 12:47 PM
Gintaras Wrote:getsel also presses Ctrl+C. Instead ofThat didn't help, but checking 'When released' on the hotkey trigger did. Quote:You can create this trigger in QM. It is possible to add user-defined triggers to Properties.Is there a sample that triggers on a Windows notification?
06-29-2007, 12:54 PM
Two samples are in c:\program files\quick macros 2\installed files\samples2.qml. Import it, or part of it.
1. Power management triggers. It is simpler (very simple for programmers) but does not add the trigger to Properties. 2. Keyboard triggers 2. Adds to Properties. If you want to add to Properties, also read 'Triggers: user-defined' topic in Help.
06-29-2007, 01:35 PM
I created a function DrawClipboard triggered on QM file loaded:
;\ I don't get any output when copying. Is it running? How do I tell? Thanks.
06-29-2007, 01:43 PM
Every window does not receive WM_DRAWCLIPBOARD. Call SetClipboardViewer to register the window. Also needed some more management code. See 'Using the Clipboard' in the MSDN Library.
Running threads are displayed in the Threads dialog. It is in Tools menu and in tray menu.
02-28-2009, 11:01 AM
This is too complicated for me.
Can you help us with this user-defined trigger?
02-28-2009, 03:54 PM
Function dlg_clipboard_viewer
\Dialog_Editor
03-02-2009, 10:34 AM
Quote:You can create this trigger in QM. It is possible to add user-defined triggers to Properties. Thanks, but How can I add this function (Activate a macro based on the contents of the clipboard) to QM triggers like 'Shell menu' or 'Keyboard 2'?
03-02-2009, 05:01 PM
03-02-2009, 05:50 PM
Thanks to you.
I think I will never be able to create functions such as yours ... Note: You can add this function to a new QM version. (it can be very useful).
07-15-2021, 07:40 AM
Just thought how useful this feature would be - and here it is!
This discussion ended in 2009 - has anything happened since then or is that still the suggested approach?
07-16-2021, 07:11 PM
A newer Windows version added message WM_CLIPBOARDUPDATE. Now it is recommended.
https://www.quickmacros.com/forum/showth...1#pid34251 |
« Next Oldest | Next Newest »
|