Here’s what I came up with about IOTOGGLE and UDTOGGLE.
UDTOGGLE does not have an effect on switches without a mechanical center, like the Boat Switch,
but does have an effect on switches with a mechanical center, like the China Hat. When the UDTOGGLE
parameter is added to the SetShiftButton for a switch with a mechanical center like the China Hat,
the shift button hooks the layer until the shift button is pressed again (see EXAMPLE 4). The
IOTOGGLE has the same hooking/unhooking effect. Maybe I’ll be able to make some good use of this
info about UDTOGGLE/IOTOGGLE in my profile. I’ve read where it might be good to have 3 layers,
Nav, Air, Ground.
EXAMPLE 1
SetShiftButton(&Joystick, S4, &Throttle, BSF, BSB);
MapKeyUMD(&Throttle, SC, ‘u’, ‘m’, ‘d’)
1. Boat at M, Press SC 3 times
Output
Key Press: M
Key Release: M
Key Press: M
Key Release: M
Key Press: M
Key Release: M
2. Boat at F, Press SC 3 times
Output
Key Press: U
Key Release: U
Key Press: U
Key Release: U
Key Press: U
Key Release: U
3. Boat at B, Press SC 3 times
Key Press: D
Key Release: D
Key Press: D
Key Release: D
Key Press: D
Key Release: D
–--------------------------------------------------------
EXAMPLE 2
SetShiftButton(&Joystick, S4, &Throttle, BSF, BSB, UDTOGGLE);
MapKeyUMD(&Throttle, SC, ‘u’, ‘m’, ‘d’);
1. Boat at M, Press SC 3 times
Output
Key Press: M
Key Release: M
Key Press: M
Key Release: M
Key Press: M
Key Release: M
2. Boat at F, Press SC 3 times
Output
Key Press: U
Key Release: U
Key Press: U
Key Release: U
Key Press: U
Key Release: U
3. Boat at B, Press SC 3 times
Key Press: D
Key Release: D
Key Press: D
Key Release: D
Key Press: D
Key Release: D
EXAMPLE 3
SetShiftButton(&Joystick, S4, &Throttle, CHF, CHB);
MapKeyUMD(&Throttle, SC, ‘u’, ‘m’, ‘d’);
1. Push and release China Up, then press SC 3 times
Output
Key Press: M
Key Release: M
Key Press: M
Key Release: M
Key Press: M
Key Release: M
2. Don’t touch China Hat, then press SC 3 times
Output
Key Press: M
Key Release: M
Key Press: M
Key Release: M
Key Press: M
Key Release: M
3. Pull and release China Hat, then press SC 3 times
Output
Key Press: M
Key Release: M
Key Press: M
Key Release: M
Key Press: M
Key Release: M
EXAMPLE 4
SetShiftButton(&Joystick, S4, &Throttle, CHF, CHB, UDTOGGLE);
MapKeyUMD(&Throttle, SC, ‘u’, ‘m’, ‘d’);
1. Push and release China Up, then press SC 3 times
Output
Key Press: U
Key Release: U
Key Press: U
Key Release: U
Key Press: U
Key Release: U
2. Don’t touch China Hat, then press SC 3 times-----or-----2. Push and release China Hat unhooks the UDTOGGLE. Press SC 3 times
Output-----------------------------------------------------------Output
Key Press: U-------------------------------------------------------Key Press: M
Key Release: U----------------------------------------------------Key Release M
Key Press: U-------------------------------------------------------Key Press: M
Key Release: U----------------------------------------------------Key Release: M
Key Press: U-------------------------------------------------------Key Press: M
Key Release: U----------------------------------------------------Key Release: M
3. Pull and release China Hat, then press SC 3 times
Output
Key Press: D
Key Release: D
Key Press: D
Key Release: D
Key Press: D
Key Release: D