Hi Pete, thanks for the prompt reply.
Both Z and Shift + Ctrl + Z are assigned via PMDG B777's own internal key commands menu which is part of the PMDG setup section built into the FMC display. I am guessing that since a lot of the B777 programming is separate from FSX then they decided to split the autopilot commands into two parts. Z and Shift + Ctrl + Z are their default keyboard commands to accomplish autopilot on and autopilot off respectively, though you can obviously assign different keys through their own menu.
Regarding the flag setting technique, I'll show you the lines I put in based on you examples in the advanced user guide. They are
0=P3, 0, C1005, 3842
1=CP(F+15,2) 3,0,K90,8
2=CR(F-15,2) 3,0,K90,11
My limited understanding from your guide means that the above do the following.
Line 0 toggles the flag based on unused joystick 15 button 2 when joystick 3 (CH Yoke), button 0 is pressed. It then defines the two definitions Z and Shift + Ctrl + Z for button 0 depending on whether the flag is set or not. Thus pressing button 0 (assuming the flag is toggled correctly) switches autopilot on; the next press switches it off. However, due to the programming in the PMDG aircraft, a warning horn then sounds. You will note that line 2 repeats the command, and provided you continue to hold down button 0, after a short pause, (presumably built into the PMDG programming) the horn then also silences.
As I said in my first post, the weakness is that the flag would not get toggled if you switched the autopilot on/off using the keyboard directly, and so the next press of the button 0 on the yoke would not do what was expected. Also you have to remember to hold the button down when switching off the autopilot off, otherwise your next press of button 0 does not silence the horn which is still going but puts the autopilot back on.
Sorry about the typo, it should have been "D07BC=0". Yes I am trying to test an offset, and using it to define my three definitions for button 0, rather than relying on the flag method. Unfortunately, that is where my knowledge and understanding fall down amongst the theory of bits and bytes and so on. What I would like is to test a suitable offset to find out which of the three conditions is appropriate (I) autopilot off, horn not sounding - define button 0 to switch autopilot on next press of button 0 (ii) autopilot on - define button 0 to switch AP off at next press (iii) autopilot off but horn sounding - switch horn off at next press. As I said earlier, the PMDG as set up by their own keyboard commands menu, requires a Z key equivalent for (i) and Shift + Ctrl + Z for both (ii) and (iii). I hope I have been able to answer your questions adequately.
Thanks
Keith