Trigger event when content on system clipbooard changes
Mostra commenti meno recenti
Hi!
I would like to trigger an event and code when the content of the clipboard changes.
I am creating polygons in a GIS-software by using a built in function of that software which captures X and Y coordinates when clicking in a map and sends these coordinates in a standadized manner to the system clipboard. Currently I'm manually pasting these coordinates into an excel sheet column and then use a script to create a SQL-string which is re-imported into the GIS-software.
I would like to initiate a MATLAB listener which triggers when the content of the system cliipboard (i.e. the clipboartd('paste') ) changes so I can automate the whole process and create the SQL-string when e.g. pressing TAB three times in a row. That bit with the TAB I've got nailed down - but the part where an event triggers when the system cliupboard changes has got me stumped.
I believe that I have to create a custom class and create a observable property for the clipboard. I can then listen for changes on that property. But how would I make the property dynamically/automatically update when the system clipboard changes? Is there a way to do this?
I guess one way would be to create a timer and every say two seconds get the value of the clipboard and update the property - but I would very much prefer not to do it this way.
My difficulty may also in no small part be that I'm really a Naval Architect and in all honesty have very little experience in programming with classes. =)
Anyone got some ideas to do this? Or is it impossible and should I just go for the option with the timer instead?
Best regards
//Martin
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Environment and Settings in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!