windows, right mouse btn, and copy paste

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
dynamech-bruce
Posts: 3
Joined: Wed Dec 24, 2008 12:56 am

windows, right mouse btn, and copy paste

Post by dynamech-bruce » Fri Aug 20, 2010 9:42 pm

Being a relative newbie, I've looked and searched through the files but am unable to figure out how to incorporate the right mouse button into my scripts. As I have been forced to use Windoze computers for quite a while, I have gotten used to using the right mouse button to do copy and pasting of text. I have written several stacks the latest of which I need to enter a UserName and Password. I have a program that stores my passwords and such and frequently use it to copy and paste from, but when I right click on the "Enter Username:" dialog box, nothing happens. I can however use the keyboard shortcut ctrl-v which works as long as I'm running Rev. If I build a standalone, even that doesn't work. I'm not sure if the problem exists because the answer command is a blocking command or not. Thanks in advance for your help. Sorry so wordy.
Running Win XP, Rev Studio 3.0.0
wish it was a new PowerBook ;-)

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: windows, right mouse btn, and copy paste

Post by Mark » Sat Aug 21, 2010 2:14 am

Hi dynamech-bruce ,

Looks like you're asking many questions in one paragraph. Alright, since you're a newbie, it be forgiven ;-) but since it isn't entirely clear to me what you're asking, let me just tell you how to deal with the right mouse click.

First of all, you can check the mouseButton in the parameter that come with the mouseUp and mouseDown (etc) messages. Please, make sure to read the documentation about these messages.

Example:

Code: Select all

on mouseDown theBtn
  if theBtn is 3 then
    -- do something here
  end if
end mouseDown
What you probably want it to show a popup menu on mouseDown. Create a popup menu button and give it a menuPick handler. Look in the dictionary to read about the menuPick command and the switch control structure. Note the name of your new button and add the following to your script (at "--do something here"):

Code: Select all

popup btn "Name of your menu button" at the mouseLoc
If you add your script to e.g. a card, then the popup menu will appear whenever you right-click on that specific card.

Make sure to report back if this works for you. There might be problems with specific versions of RunRev on specific platforms.

Best regards,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

dynamech-bruce
Posts: 3
Joined: Wed Dec 24, 2008 12:56 am

Re: windows, right mouse btn, and copy paste

Post by dynamech-bruce » Sat Aug 21, 2010 5:22 pm

Thanks Mark. Although I don't think I explained correctly my problem. I have included a stack which hopefully explains my situation better than I can. But I'll try again. When I want to enter info into an "Ask" dialog box, (username or password for example) the standalone app doesn't show any text being entered. It appears to be a CR.

If you run Windows, can you try to build and see if your results are the same as mine? I used the radio btn "Search for required inclusions when saving the standalone application" A friend of mine who uses a Mac says the standalone for him works fine.

As for the the right mouse button, Rev doesn't seem to trap for it without any handlers. For instance, when running the stack in Rev, no popup shows up. I would have thought that an "Ask" dialog box should accept a right mouse click with a prompt for pasting. I would have to rewrite the script for the "Ask Dialog" stack, which I hear is like doing brainsurgery on oneself.

Again thanks in advance.
Attachments
Paste Testing.zip
(1.27 KiB) Downloaded 207 times
Running Win XP, Rev Studio 3.0.0
wish it was a new PowerBook ;-)

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: windows, right mouse btn, and copy paste

Post by Mark » Sat Aug 21, 2010 5:33 pm

dynamech-bruce,

Before I download and try your stack, at which point exactly should your standalone show text and where should this text be shown?

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

dynamech-bruce
Posts: 3
Joined: Wed Dec 24, 2008 12:56 am

Re: windows, right mouse btn, and copy paste

Post by dynamech-bruce » Sat Aug 21, 2010 7:56 pm

The program I made is just two buttons that ask "Can you paste text into the field". If the user puts any text into the field, it replies, "You entered xxxxxx". If not it replies "You didn't enter any text." This is just to see what is different between the stack and the standalone.
Running Win XP, Rev Studio 3.0.0
wish it was a new PowerBook ;-)

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Re: windows, right mouse btn, and copy paste

Post by Mark » Sat Aug 21, 2010 8:09 pm

Bruce,

OK, I understand your problem. It won't work, not even on Mac. The people who say it works on Mac are using command-V instead of right-click.

There is no script in the ask dialog window that handles a right click. If you want this to work, you have to make a new stack. The script I posted earlier will definitely help you.

One more hint: a right-click in a field will trigger a mouseDown and a mouseUp message, but a normal click in a field won't. You can use this to display the popup menu.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply