Enter function using keypad

I tried switching them before this. I deleted all of my failed attempts and commented out my attempts at using case statements. I actually have reference code that does something almost identical to what I'm trying to do but for the life of me can't figure out how they got their code to work. It's on GitHub so there's likely more code involved that wasn't uploaded