in your mousetrap example you are not getting a patent on all remotely activated mousetraps, only for your particular combination of hooks, levers, etc that you used.
software patents generally do not include code listings, at most they include pseudocode (and even then, usually as an example "this patent could be implemented like this")
It's frequently hard for the original inventor to match up the patent legalese with the description of the idea that they submitted to the legal department.
if you have never read any software patents, you really don't have any idea how bad they are.