Suddenly the pan and zoom have just stopped working. It’s only in a specific file, in all my other files it works fine. I think I might have pressed a key, since I use a yoga book, and the ghost keyboard is really hard to work with. Any idea of what I could have pressed? Or how to fix it?
I was having the same problem in version 2.82, when pan suddenly stopped working, both manually and with Shift + Middle Mouse Button. In some forums they point out that #1 you may have accidentally activated walk or fly modes; or #2 you accidentally locked your view to a particular object (N menu, View > View Lock.
If you tried to undo walk mode, fly mode, and view lock, and none of them were activated, then it may just be an old, obscure bug, predating since version 2.78. You can "solve" it by opening the N-menu, View, and changing the *Clip Start * and Clip End parameters by few orders of magnitude (i.e., x100 to x10000), until you start losing visibility nearby your rotation center.
It may let you pan and rotate just slightly between some weird unphysical boundaries. Keep changing the visibility until it suddenly starts working normally again. Then put back the old clip parameters.