fetching control variable

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

fetching control variable

Postby MagicMush » 5. Sep 2016, 23:57

When you create a .dll, how do you fetch the variable set in the roccat power-grid option box like the precision in your trackpad?
MagicMush
 
Posts: 4
Joined: 18. Aug 2016, 06:15

Re: fetching control variable

Postby Addihash » 12. Sep 2016, 10:23

In the plugin.json you can create a option for a control, the option for the sensitivity of the trackpad looks like this:
Code: Select all
{
   Name:"Sensitivity",
   Items:["1","2","3","4","5","6","7","8","9","10","11","12","13","14","15"],
   Type:"SpinDrop",
   Value:"8",
   Params:"range=5:1-15",
   Title:"@Sensitivity",
   Layout:"<hr>,<addstretch=1>",                      
}


You can read that option in your .qs file like this:
Code: Select all
var xCtrl=p_xSkin.getControl();         // getting the Control from the skin
var xCfgData=xCtrl.getConfigData();     // getting the ConfigData from the Control
var sens=xCfgData["Sensitivity"];       // getting the Config Value using its name.


And from that the .qs you can pass the variable to the .dll with
Code: Select all
this.CallFunc("PluginName:FunctionName", [sens, param2, ...]);    // passing sens and more params if needed
Addihash
Administrator
 
Posts: 232
Joined: 2. Feb 2015, 14:35


Return to Power-Grid SDK

Who is online

Users browsing this forum: No registered users and 1 guest