I’m trying to keybind a waxpen

Hello, basically just the title. I’m very inexperienced with computers, but I have an insane game night idea that I want to do. I have no idea how I’d approach this though. Is all I need the keyboard? Is my controller a better idea? Do I need to get an external device? My monkey brain says I should wire it to a specific key, so that when the pen turns on it simulates that key being pressed. But I feel like it’s not that easy, and I don’t wanna fuck up my only keyboard.