OK, What about this?

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10354
Joined: Wed May 06, 2009 2:28 pm

OK, What about this?

Post by dunbarx » Sun Jan 04, 2015 6:05 pm

OK.

I had an unlocked text field. Ordinary one, right out of the palette. It has a few lines of text in it. If I click in that field, a mouseUp (and a mouseDown, for that matter) message is sent every few times. Not in any repeatable way, but certainly every few times.

Never if the cursor is within a word, rather only when at the end of a line. Never (I am on a MacBook Air) if I "tap" the trackpad, only when I actually click the trackpad.

I trapped both messages, and was able to get the clickline, a random number, whatever. The message watcher showed both messages being sent. I changed the script some more, and the messages stopped. So I made a new field in a new mainstack. Same behavior. But then it, too, went away, and I cannot duplicate any longer.

Anyone else ever see this? I have not been drinking.

OS 10.6.8, LC 6.7

Craig Newman

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4174
Joined: Sun Jan 07, 2007 9:12 pm

Re: OK, What about this?

Post by bn » Sun Jan 04, 2015 6:14 pm

Hi Craig,

could it be that you have configured your trackpad to send a right-click when you click in certain parts of your trackpad?

An unlocked field will get right-clicks, not left-clicks.

try this in the script of the unlocked field:

Code: Select all

on mouseUp pWhich
   put pWhich && the milliseconds into field "fRes"
end mouseUp
if pWhich is 3 then it is the right-click

Kind regards
Bernd

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10127
Joined: Fri Feb 19, 2010 10:17 am

Re: OK, What about this?

Post by richmond62 » Sun Jan 04, 2015 6:33 pm

On of the things you could do was include a 'lockText' in your script:

on mouseDown
set the lockText of fld "TEXTSTUFF" to true
end mouseDown

on mouseUp
get the clickline
set the lockText of fld "TEXTSTUFF" to false
on mouseUp

I wonder why Livecode has 'clickText', 'clickChunk' and 'clickChar' but NO 'clickWord"?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10354
Joined: Wed May 06, 2009 2:28 pm

Re: OK, What about this?

Post by dunbarx » Sun Jan 04, 2015 8:00 pm

Bernd.

I knew I should have put this in the beginners section.

It turns out that when I tap, I hit the middle of the trackpad with my index finger. When I click, I use my right thumb, and often hit near the lower right corner. A right-click, in other words.

Craig

Post Reply