Digital Art Zone

 
     
Keypress (down and up), mouse move, and mouse locking
Posted: 31 March 2013 07:16 PM   [ Ignore ]
New Member
Total Posts:  21
Joined  2013-03-27

Does anyone know how to do either of these functions in Daz script:

Detecting:
Key Down
Key Up
Mouse Movement

Overriding:
Mouse Locking (into the center)


Where could I find out info like this? The documentation is VERY limited, and the most info I get is from examining other scripts on some of the sites out there.

Profile
 
 
Posted: 01 April 2013 05:18 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  14063
Joined  2003-10-09

Mouse movement isn’t available to scripting - it would need a new plugin, which could then make the data available to scripts, but I don’t think there’s anything currently available. I’m not sure if it’s possible to capture key-presses - I was thinking a text edit box might do the job, as a workaround, but it doesn’t look like it.

 Signature 

DAZ Studio Frequently Asked Questions

Index of free DAZ Studio scripts and plugins list

Profile
 
 
Posted: 04 April 2013 07:22 AM   [ Ignore ]   [ # 2 ]
New Member
Total Posts:  21
Joined  2013-03-27

Thanks to “Casual” for this:

ed = new DzLineEdit( wDlg );
  connect( ed, “textChanged(const QString&)”, textChanged ); 

function textChanged( s )
{
if( s.length > 0 )
{
  ed.text = “”;
  switch(s.charAt(0))
  {
  case ‘1’: bf1(); break;
  case ‘2’: bf2(); break;
  case ‘3’: bf3(); break;
  case ‘4’: bf4(); break;
  case ‘5’: bf5(); break;
  case ‘6’: bf6(); break;
  case ‘7’: bf7(); break;
  case ‘8’: bf8(); break;
  case ‘9’: bf9(); break;
  }
}
}

Profile