Not quite sure what you mean by 'the screen trying to switch to a different screen'.
Just out of interest, do you have an external keyboard and mouse you could try? See whether your laptop works that way?
You might also check to see whether the battery has swollen at all. You'd need the correct screwdriver to take the back off.
The battery in my old white MacBook was swollen and it affected the behaviour of the trackpad. The cursor would move rapidly all over the screen at random when I attempted to use the trackpad.
I think the swelling may have been more visible externally in my MacBook due to the polycarbonate casing and its rear access panel to the battery (and to the memory). In the 2012 MacBook Pro the casing may not be so susceptible to such visual evidence of a swollen battery.
Of course, it may not be the battery at all, though these are simple, cheap troubleshooting procedures and so worth a try perhaps.
In the meantime, do you have a backup of all your data?