3 ms·
I think the point is you're not doing anything with the event immediately, just setting the key state so it can be polled later. Ironically 5 minutes before I
by mandarax8 4y ago
I think the point is you're not doing anything with the event immediately, just setting the key state so it can be polled later.
Ironically 5 minutes before I read this I changed a coworkers POC 3d app to use event polling instead of key events as it was horribly unresponsive.
- moremetadata 4y agoExcept when using a USB keyboard and can type faster than the keyboard can determine the keys pressed especially when when using modifier keys like Alt and Shift and the USB bus is being overwhelmed with other USB data. Stick with a PS/2 keyboard, it makes it easier to spot malware using the USB bus https://wiki.wireshark.org/CaptureSetup/USB https://wiki.wireshark.org/CaptureSetup/USB
- randomdata 4y ago> I think the point is you're not doing anything with the event immediately, just setting the key state so it can be polled later. Which is event-driven architecture. A component signals that something happened and other components take in that information and update their local state as appropriate.
- phkahler 4y agoNo, it's not event driven. Maintaining key state up or down and treating it like a discrete I/O input in the rest of the code is not event driven. The event doesn't trigger any behavior. It's an example of how to handle events if that's all you've got as input - map it to non event driven design.
- randomdata 4y ago> The event doesn't trigger any behavior. Yes, that's right. We're talking about EDA, not CQRS or the like. EDA events signal a change of state from one component for other components to synchronize on. They are not commands to react to.