I actually have no idea how to do it in Mass Effect 2. If you could tell me, that would be awesome.
But this is how you do it in ME3:
1 - Download this right
here. It will allow you to edit your
coalesced.bin (found in your Origin Games/Mass Effect 3/BIOGame/CookedPCConsole) file for Mass Effect 3. I cannot, for the life of me, find the website for this thing, where you can get updates, but this works and it's safe.
2 - Go to bioinput.ini -> sfxgame -> sfxgamemodeflycam -> bindings = (multiple) and in an empty space at the bottom add ( Name="F1", Command="ToggleFlyCam" ). Replace F1 with whatever you want. You can also add a toggle HUD command by replacing "ToggleFlyCam' with "ToggleHUD".
3 - Also in bioinput.ini -> sfxgame go to -> sfxgamemodedefault -> bindings = (multiple) and add the same command at the bottom. ( Name="F1", Command="ToggleFlyCam" )
4 - Hit save and you are done. Oh and you should back up that file before you do anything, just to be safe.
Enjoy!
Also, can you tell me how to disconnect the camera in ME2? I have never gotten anything to work.