1281 posts
Posted 19 June 2014 - 10:51 PM
I've recently been adding some ctrl+key shortcuts to my program, all of them work like a charm, with the exception of ctrl+v for pasting. Whenever ctrl+v is pressed in CC, it seems to queue the actual computer's clipboard as char events, instead of giving the key event as desired. Anyone know a way around this? I don't want to use a different key, as ctrl+v is pretty much the universal paste shortcut.
8543 posts
Posted 19 June 2014 - 11:43 PM
In old versions, this is impossible. In the newer versions (1.6+), I have heard rumors of a "paste" event with clipboard contents, so that's worth looking into, if true.
7083 posts
Location
Tasmania (AU)
Posted 20 June 2014 - 05:57 AM
I get the impression he wants to paste the contents of his own clipboard.
As far as I can tell by just skimming the BIOS source and applying Occam's razor, other than returning the "real" system's clipboard alongside a single "paste" event (as opposed to multiple "char" events), it still works the same way under 1.6. But I could be wrong about that.
And if memory serves, it doesn't even return the entirety of the copied text - just the first line…
1281 posts
Posted 20 June 2014 - 06:40 AM
Indeed, i want my own clipboard. The issue though, is that there is no key event for pressing 'V' if ctrl is held. The char events would just get ignored anyways. However, using the paste event would indeed work. Sadly, im still on 1.58 :P/>
7083 posts
Location
Tasmania (AU)
Posted 20 June 2014 - 07:45 AM
Aaaaand now it occurs to me that the paste event would indeed do the job, even if it returns the "real" clipboard contents. My bad, Lyqyd.
Ok, so why not just look for a char event that wasn't preceeded by a key event? When you spot one, perform your internal paste process then flush out the rest of the event queue.
Edited on 20 June 2014 - 05:47 AM
1281 posts
Posted 20 June 2014 - 09:23 AM
I suspect that will only work if the person's clipboard actually contains text though. I'll have to do some testing later.
7083 posts
Location
Tasmania (AU)
Posted 20 June 2014 - 12:45 PM
Ugh, good point - you get no event at all if the system clipboard doesn't contain text. Ditto under 1.6.