lock key corresponds to sensor select depress button, unclock corresponds do "undesignate", simple as that.
As for A2A weapons just bind the correspondend buttons under for guns , there is a list for these commands called aim7,aim9, ,guns, somethin like that.
Also there is a very good youtube video from GRimreapers
or this one as well
https://www.youtube.com/watch?v=ItBYk5piqLw