Page 1 of 1
windows, right mouse btn, and copy paste
Posted: Fri Aug 20, 2010 9:42 pm
by dynamech-bruce
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.
Re: windows, right mouse btn, and copy paste
Posted: Sat Aug 21, 2010 2:14 am
by Mark
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
Re: windows, right mouse btn, and copy paste
Posted: Sat Aug 21, 2010 5:22 pm
by dynamech-bruce
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.
Re: windows, right mouse btn, and copy paste
Posted: Sat Aug 21, 2010 5:33 pm
by Mark
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
Re: windows, right mouse btn, and copy paste
Posted: Sat Aug 21, 2010 7:56 pm
by dynamech-bruce
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.
Re: windows, right mouse btn, and copy paste
Posted: Sat Aug 21, 2010 8:09 pm
by Mark
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