How to detect pressed key?

Is there any way to know which key has been pressed by the user? To save me all the hotkey management of the addon and simply detect if you have pressed the A or B and the addon works differently.

there is no way to do this out of the box in Blender without an event- and the only way to get an event is inside a modal operator.