how does the EventKeyboard class get the pressed key? #1163
-
I see that the class constructor receives the keyCode and isPressed variables, but I can't figure out where it gets the information about whether the key is pressed or not. I'm trying to understand how the EventListener works under the hood (I need this to study, because I haven't come across lambdas and std::function yet), but I also don't see where the information about the pressed key comes from. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
You haven't mentioned what it is exactly that you are attempting to achieve. If you need to know how something works, then you have several options. The easiest would be to be to run the application, put a breakpoint on where the event is sent out, and look at the call stack from there. Follow the calls up to see where the information came from. The source of the input is most likely platform specific, so the calls that send out the events will change depending on which platform you're running the application on. For example, this is one implementation:
Just search the source code for "EventKeyboard"; it's all there. |
Beta Was this translation helpful? Give feedback.
-
@10100010010001001010 |
Beta Was this translation helpful? Give feedback.
You haven't mentioned what it is exactly that you are attempting to achieve.
If you need to know how something works, then you have several options. The easiest would be to be to run the application, put a breakpoint on where the event is sent out, and look at the call stack from there. Follow the calls up to see where the information came from. The source of the input is most likely platform specific, so the calls that send out the events will change depending on which platform you're running the application on.
For example, this is one implementation: