Mac OS (High Sierra 10.13.6) volume control spontaneously runs; can I disable it? I have a pretty old MacBook Air (bought it in 2011), so I'm thinking it's probably to do with the keyboard wearing out. But I'll be watching a video or something and the volume control will run up to the max, as if holding down F11, or run all the way down as if holding down F10. (Since I installed High Sierra, these keys have shifted one over to the right, so F12 and F11 really.)

I've tried several things: restarting system, cleaning keyboard, etc., setting it up to hold down the Fn key as well as the function key (doesn't change anything), installing updates. Nothing seems to help.

So, unless anyone has any other ideas, I'm presuming that the problem is hardware-related. I don't really use the system volume control anyway; prefer to control it from within the video itself. Is there a way to disable it, without disabling the ability to control it from within, say, youtube videos?

(Edit: I tried resetting the PRAM by holding Option-Command-P-R on reboot after a complete shutdown. The problems haven't reoccurred after some hours of use. I'll post it as an answer if the problem doesn't resurface after I give it a day.)
Doesn't appear to be a hardware problem after all. Resetting the NVRAM/PRAM seems to have done the trick. Before doing this, the problem was occurring about every two minutes. I've now run the system for 24 hours without an incident.

Edit: the problem is back after three days. I would appreciate any ideas.

Edit: the problem turns out to be traceable to a particular set of earphones. Didn't happen unless they were plugged in. Changed earphones, no recurrence of problem. So, it was indeed a hardware problem, just not with the computer itself.