After some trial & error and some experimentation, I have root, the framework.jar à la Renate, and Key Mapper all set up and working. The physical buttons turn the page in every app I want them to turn the page. A couple of apps seem to prefer scrolling or swiping to a simple tap on one or the other side, but I'll work on them next time.
I would have saved myself a lot of time and reading of posts if I knew about this link sooner. It isn't necessary, for my purposes, to build Magisk modules the usual way. All I needed was right
here.