How to make a key stored, without using OnGUI

Hello , here’s the point.
I want a button to store a Keycode when a key on the keyboard is pressed, but i don’t want to use OnGUI() and Update() function , how do I do?
If something ain’t clear just ask , thank you for your time.

If I remember correctly, you can’t do that. Is there a reason you don’t want to use Update? Because it won’t slow down your game if you use it.