Event triggered by pasting data into a field

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
bbalmerTotalFluency
Posts: 84
Joined: Mon Apr 06, 2020 1:19 pm
Contact:

Event triggered by pasting data into a field

Post by bbalmerTotalFluency » Sat Aug 03, 2024 3:56 am

Good morning.

Is there one? An event triggered by pasting data into a field? I know we have textChanged but that does not appear to be triggered by pasting.

I'd like something to happen automatically on data being pasted into a field? Possible? If not possible, any smooth ways around it? I don't want the user to have to do something complicated or have to move the mouse out of the field to trigger the action (if possible).

Thanks

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Event triggered by pasting data into a field

Post by jmburnod » Sat Aug 03, 2024 9:34 am

Good Morning,
TextChanged works here (OSX 12.7.4, LC 9.66).
No tested as standalone.
Best regards
Jean-Marc
https://alternatic.ch

bbalmerTotalFluency
Posts: 84
Joined: Mon Apr 06, 2020 1:19 pm
Contact:

Re: Event triggered by pasting data into a field

Post by bbalmerTotalFluency » Sat Aug 03, 2024 12:07 pm

Jean-Marc:

DELETED
Last edited by bbalmerTotalFluency on Sat Aug 03, 2024 12:10 pm, edited 1 time in total.

bbalmerTotalFluency
Posts: 84
Joined: Mon Apr 06, 2020 1:19 pm
Contact:

Re: Event triggered by pasting data into a field

Post by bbalmerTotalFluency » Sat Aug 03, 2024 12:10 pm

Jean-Marc:

Thanks for the reply. Well, I was expecting textChanged to work and it appeared not to have. But fortified by your resolute assurance of success, I tried again and this time it worked. I have NO explanation for why it did not work for me earlier. Human error being the most likely explanation.

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Event triggered by pasting data into a field

Post by Klaus » Sat Aug 03, 2024 1:17 pm

You could also catch the "pastekey" message.
However this will only work in a standalone, the IDE will just "eat" this message. :D

bbalmerTotalFluency
Posts: 84
Joined: Mon Apr 06, 2020 1:19 pm
Contact:

Re: Event triggered by pasting data into a field

Post by bbalmerTotalFluency » Sun Aug 04, 2024 2:30 am

Klaus:

Were I a university I would give you an honorary degree in all things livecode.

I saw pasteKey. I wondered if it would work. Tried it. It did not work. I did not know it was standalone only. That explains it.

It's an education chatting with you guys.

Thanks

Post Reply