Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
special keys as function arguments
#1
I wrote this simple macro that right clicks the screen to bring up a pop-up menu, then navigates using the up/down/right arrows to get to the desired command:

POINT p; xm(p); ym(p);
int m=getmonitor(p);
if (m=3) or (m=4) ;;if monitor 3 or 4, click to bring out pop-up menu
rig p.x p.y
key UUUUURY

Trouble is, I'm writing the same code 20 times because I have different commands in the pop-up menu I want to call up quickly. So I wanted to make the above code into a function "rClkStentor" and pass a string with the command of where to move:

/
function lpstr's

POINT p; xm(p); ym(p);
int m=getmonitor(p);
if (m=3) or (m=4)
rig p.x p.y
key(s)

Which I then called as rClkStentor("UUUUURY"), rClkStentor("DDDRDY"), etc.

That has failed miserably. I think it's trying to actually type the string characters rather than the special key commands (the arrow keys). Is there a simple way to convert "s" back to special keys to use in the key command?

On a related topic, is this the most logical way of dealing with a pop-up menu within a program? I've been doing this because the objects within the pop-up menu do not appear to be accesible, i.e. when I go click on QM to drag the crosshairs to the pop-up menu it de-selects the pop-up and it's gone. Is there an easier way? Ideally, you'd want a way of grabbing elements in a pop-menu that didn't require a fixed order of the items in the menu.


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)