I was using keyboard/mouse and would tap x repeatedly, did I miss something obvious?
The way it works with mouse and keyboard is just that it's a toggle. It'll lock onto whatever enemy is nearest to your cursor.