What's new

Mouse Behavior sometimes ignored?

Mike Greene

Senior Member
Moderator
I've been using the MOUSE_BEHAVIOUR in instances where I have a ui-slider that I replace with a knob png. I use negative values so that the knob (slider in disguise) is effected by up/down motion rather than right/left. Simple stuff. I've been implementing this for months.

Lately, though, I've experienced times when it stops working on one computer, yet it will still work perfectly on my other computers. (All Macs.) Identical instrument with identical script, so this shouldn't be happening. I even doublecheck and look in the resource file and those MOUSE_BEHAVIOUR lines are exactly as they should be.

It's not a huge issue, because if this happens to a customer here or there, they can figure out to move their mouse right/left instead of up/down. But it's weird. Has anyone else encountered this?
 
I never encountered this either. But then I'm on a PC so hopefully some Mac user that uses this a lot will chime in.
 
I'm completely mac-based, and I've never seen this happen. Mike, are you sure there's nothing else coming into the equation? (ie. perhaps old script in the instrument, not being replaced by the resource?)
 
Okay, I'm an idiot. I forgot the "get_ui_id" part in this line:
set_control_par($knob,$CONTROL_PAR_MOUSE_BEHAVIOUR,-2000)

It should be:
set_control_par(get_ui_id($knob),$CONTROL_PAR_MOUSE_BEHAVIOUR,-2000)

What's weird is that I could swear the knobs *did* work correctly most of the time before. Seriously, I'm *sure* I remember being quite pleased with myself that I made the knobs work properly. But that doesn't make sense, because I can see that "get_ui_id" definitely isn't there and I don't see why I would have ever erased it.

Oy. I may need to further investigate my malfunctioning brain, but at least the scripting problem is solved. Thanks for confirming that this doesn't happen to you guys, because that made me look closer at my script. 8)
 
I figured out why the MOUSE_BEHAVIOUR thing worked sometimes, but not always.

Nils' Script Editor automatically changes "$knob" to "get_ui_id($knob)" in that line (and probably other control_par lines as well.) Handy feature, but it's only been in effect since 1.5.1.

I'm running 1.5.1 on my Macs, so everything was working perfectly. But because Kontakt sometimes doesn't like Text Edit (the Mac version of Notepad), I do my final compilation on my Windows laptop . . . which is running KScript 1.5.0, which doesn't convert "$knob" to "get_ui_id($knob)".

Mystery solved. Although it reminds me how annoying it is that Kontakt isn't more Mac friendly.
 
Top Bottom