See inside for the block! Simply right-click the variable and choose the variable that controls the key you want pressed! Backpack them, but don't take them apart, they won't go back together.
Thanks to all those tutorials and projects out there on how to hack blocks together. I learned how to hack the JSON file to make blocks like these, and this is my first attempt.