Explanation of some code please.

Everything regarding the Power-Grid SDK can be asked and discussed here.

Re: Explanation of some code please.

Postby Vora » 31. May 2015, 00:14

Another question!

Well two actually.

I've tried to use the editor software to get the code snippets for the following but nothing works.

Middle Mouse Button

The editor doesn't recognise this, I've tried to enter in a few possibilities i.e. MOUSE2,3,4 in the hope that would work, but no luck.

Any ideas?

Next is the ; button. I know this is used in programming as a separator of sorts. I tried to use the editor and got the following macro:

d ;;u ;;

That didn't work, I spotted a few old threads about something similar and tried "t ; ;" but that didn't work either.

Is it possible to enter in a ; as a command?

Thanks.
Vora
 
Posts: 12
Joined: 9. May 2015, 18:46

Re: Explanation of some code please.

Postby Addihash » 1. Jun 2015, 12:34

1) You can insert mouse button events via right-clicking in the macro editor and select a mouse event from the context menu,

2) I can't check that now but I think you can use \ to escape the seperator functionality. So your macro would be
Code: Select all
d \;; 50; u \;;

I'll check that later.
Addihash
Administrator
 
Posts: 232
Joined: 2. Feb 2015, 14:35

Re: Explanation of some code please.

Postby Vora » 1. Jun 2015, 19:23

Add,

Thanks for the reply as always. The middle mouse button worked a treat, thanks for that.

Unfortunately the ; code didn't. I tried to play with it by moving the \ before and after the first ; but not luck.
Vora
 
Posts: 12
Joined: 9. May 2015, 18:46

Re: Explanation of some code please.

Postby Addihash » 2. Jun 2015, 12:29

Yup you are right, we need to look into that!
Code: Select all
t \;;
works though, but that is just
Code: Select all
Shift+,
(on a german layout) and I think that doesn't fit your needs right?

Edit: It worked for us when using a shortcut instead of a macro. To use a shortcut in a plugin use
Code: Select all
// taken from the TrainSim Plugin
var that = this;
this.CallFunc("DFP:SendShortcut",[';',"down"]);
this.setTimeout(function(){that.CallFunc("DFP:SendShortcut",[';',"up"]);},50);
Addihash
Administrator
 
Posts: 232
Joined: 2. Feb 2015, 14:35

Previous

Return to Power-Grid SDK

Who is online

Users browsing this forum: No registered users and 2 guests

cron