2 motors controlled by one joystick

yes i want them to go opposite directions when making the turns and, no it does not have a trigger or switch. is it possible to make them both go the same way when the joystick is in the forward or backwards positions and go opposite directions when in the left or right positions? if so please help, any advice for coding this would be appreciated.