I want to obfuscate some things.

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
oldummy
Posts: 80
Joined: Mon Jun 13, 2016 3:21 pm

I want to obfuscate some things.

Post by oldummy » Tue May 07, 2024 1:04 am

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.

Klaus
Posts: 13863
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: I want to obfuscate some things.

Post by Klaus » Tue May 07, 2024 8:55 am

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

stam
Posts: 2736
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: I want to obfuscate some things.

Post by stam » Tue May 07, 2024 11:36 am

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?

Klaus
Posts: 13863
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: I want to obfuscate some things.

Post by Klaus » Tue May 07, 2024 4:29 pm

We've already been this far... :D

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9731
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: I want to obfuscate some things.

Post by dunbarx » Tue May 07, 2024 6:28 pm

@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

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”