Page 1 of 1
I want to obfuscate some things.
Posted: Tue May 07, 2024 1:04 am
by oldummy
I have a stack in which I want to obfuscate some things.
I want to have a button that when clicked while holding either the controlkey or the commandkey to do something othar than in in the mouseup handler script that in in the current script.
In the current script I have:
on mouseup
if the label of me is "Locked" then
set the label of me to "Unlocked"
end mouseup
My intention is to have the mouseup message accomplish something entirely different.
Thanks in advance.
Re: I want to obfuscate some things.
Posted: Tue May 07, 2024 8:55 am
by Klaus
Hi oldummy,
do you mean something like this:
Code: Select all
on mouseUp
## Not sure if this should happen only with controlkey or commandkey?
if the label of me = "Locked" then
set the label of me to "Unlocked"
end if
if the controlkey = "down" then
## do your stuff
exit mouseup
end if
if the commandkey = "down" then
## do something else
exit mouseup
end if
end mouseUp
Best
Klaus
Re: I want to obfuscate some things.
Posted: Tue May 07, 2024 11:36 am
by stam
The confusion for many readers looking at this will arise from the verb "obfuscate", as you are asking for nothing of the sort as far as I can tell...
obfuscate
UK /ˈɒbfʌskeɪt/
verb (with object)
1.
make obscure, unclear, or unintelligible
e.g.: the spelling changes will deform some familiar words and obfuscate their etymological origins
2.
bewilder (someone)
e.g.: the new rule is more likely to obfuscate people than enlighten them
It seems like you want a button to do something different with the control/commandkey is down and Klaus has you fully covered on that front...
Unless you're talking about obfuscating something else?
Re: I want to obfuscate some things.
Posted: Tue May 07, 2024 4:29 pm
by Klaus
We've already been this far...

Re: I want to obfuscate some things.
Posted: Tue May 07, 2024 6:28 pm
by dunbarx
@Klaus. It is just that not every person who posts in a thread reads the previous history of that thread. I have been guilty of that occasionally.
@ Anthony. Right, but wrong. "optionKey" is a function. You cannot use "if the optionKey()". Use instead "if optionKey()", or go where I always do, "if the optionKey is down". I find that more descriptive when I am re-reading it later on.
Craig