I'm building an MCP that is similar to what you see in an Airbus a320 (since that's what I fly the most). My prototype is working ok, I can change all values for speed, heading and so on. Each rotary encoder that I use have a push button as well and I want to use them to activate or deactivate the corespondent function. The thing here is that if i dial a value, lets say for the heading, and then activate it the value is reset to the heading the plane is pointing to right now. In this case I'm using heading hold mode, the value is B04.

Is there any way to just activate or deactivate what I have dialed or am I using the auto pilot incorrect? I often set a value in advance, then I activate speed, heading etc when the right come.
Perhaps each part should be activated, then set to a value?

The thing is that you can activate each function from the VC without reseting the value. If you use the keyboard command for this the value is reset.