Hmmm... maybe you should configure "Mode 3" (or 4) as your "gunner mode". Map all appropriate axis (axe? axes? axi??) and all needed buttons to your mouse only.
Now map one key on keyboard as "Mode 1", the other as "Mode 3". When you hop into gunners position, hit "Mode 3" button, if you jump back into cockpit, hit "Mode 1" button again.