Debouncing on Multiple Input Pins, both directions

I found the code listed in the link in my original post. The URL is:

The code written by @PerryBebbington is the first response.

I'm reading the inputs from 2 of these switches:

When holding down the switch down (and reading LOW), it will sometimes momentarily read HIGH.
I wanted a way to make sure it stayed HIGH for a few milliseconds before acting on the button being released and reading a HIGH state. Whether or not this is technically "debouncing", I'm not sure.

I had a problem, and I couldn't find any other code that solved my specific problem. When I was able to solve it, I figured I'd post it here so that someone in the future could find the code and use it. If you don't have a use for this code, that's fine.

@lastchancename , there is no question. I'm just posting some code that I found, and tweaked, and solved my very specific problem.

@alto777 , Like I said, I don't know if this is technically debouncing. I just know it solved my very specific problem. If you have a different term for it, we can call it that.