# Alt / Command / Ctrl keys



## jesusginard (Oct 3, 2014)

Hi everyone, 

I have two independent sliders, I want them to be linked only when alt/command/ctrl keys are pressed. Is that possible in KSP?

Cheers, 
Jesús


----------



## polypx (Oct 3, 2014)

yes


----------



## jesusginard (Oct 3, 2014)

The next question is "how"?
I know about the $CONTROL_PAR_KEY_ALT, $CONTROL_PAR_KEY_SHIFT and $CONTROL_PAR_KEY_CONTROL but I don't know how to use them, I'm doing something wrong.


----------



## jesusginard (Oct 3, 2014)

OK, mystery solved. 

How to check if a modifier key (ALT) is being pressed on a ui_control callback: 


```
on ui_control($knob)

    if (get_control_par(get_ui_id($knob),$CONTROL_PAR_KEY_ALT) = 1)
        // do something
    else 
       // do something else
    end if

end on
```

Note: it doesn't work with menus and value edits. Use ALT, CONTROL or SHIFT to check the different keys.


----------



## geronimo (Nov 4, 2016)

I have understand the command but how to avoid the order placed with a single click during a Command/ Alt action on the same ui_control?

For example:
on ui_control ($verb)
set_engine_par($ENGINE_PAR_SEND_EFFECT_BYPASS,$verb, -1,0, 0)
if (get_control_par(get_ui_id($verb),$CONTROL_PAR_KEY_ALT) = 1)
set_skin_offset(418)
else set_skin_offset(0)
end if
end on

So I would avoid the first action ($reverb bypass) with the "Command / Alt control.


----------



## EvilDragon (Nov 5, 2016)

Place the bypass in "else" part.


----------



## geronimo (Nov 5, 2016)

Hello _

I tried but it changes nothing. I also reflected with the term "CONTROL_PAR_NONE" on the $verb control but it cancels everything .


----------



## EvilDragon (Nov 5, 2016)

Sorry, BEFORE "else"!


----------



## geronimo (Nov 5, 2016)

No improvements here .

I feel to try something beyond my skills but when I do, for example, right-clicking on a command , the Midilearn Mode appears and snaps it no click the button, switch or Slider .

I have wanted this to happen identical with that way for the shortcut Command (Ctrl for PC) Alt. But it always starts the normal click. Miss it a simple-click code to cancel it ?


----------



## EvilDragon (Nov 5, 2016)

Wait, what exactly are you trying to do?


----------



## geronimo (Nov 5, 2016)

I have a slider that controls the Bypass of an effect (Reverb) and wanted to get another action or result by clicking it with the Alt key to display the parameters of the effect, for example.
With the action Click + Alt, I have always another simple click action (Bypass Reverb) valid. It's embarassing .
A very little film https://www.sendspace.com/file/fjrns7 (Here) . (GUI not over)_


----------



## EvilDragon (Nov 5, 2016)

The problem is that sliders get activated TWICE when you just do a single click on them (no drag) - on mouse down, and on mouse up. So what's happening is basically it bypasses then unbypasses the effect. It is not recommended to do these things in Kontakt because we cannot reliably detect single click vs mouse drag on a slider.


----------



## geronimo (Nov 5, 2016)

Yes, I could see the insoluble character of all this: I will arrange otherwise. Again,many thanks you for your patience, Mario _


----------

