friend!
That is actually a great question, so let me try to clear things out.
If you wanted to simply: call method when W is pressed, then any solution for this would be correct. But in a real world scenario that's is really never gonna happen. There will always be some "what ifs" at one point or another that will force you to increment the logic of capturing the W key. That's where the Enhance Input System comes in.
So, basically the Enhanced Input System is not just a "different way" to handle hardware input. Is THE way of handling hardware input. That's because, although more complex to implement, it comes ready to handle an array of different situations.
I'll try to give some examples that you would have to learn how to work around if you were to use direct capture of Key Press:
- Enhanced Input System can map different inputs to the same action: In your example, what happens if the player uses a controller in the future? You would need a different logic to capture every different input type. Not in Enhanced Input. In you Enhanced Input Mapping edit window you can define multiple different inputs to the same action. Meaning that no code has to be updated if you decide that a new key should or should not fire a certain action.
- Enhanced Input System can handle runtime remapping: Let's say you are using the usual WASD for movement but you decide that your player can rebind his keys in the Options menu. What you do? Now you need a way to capture every possible keyboard and controller input that he could use and then compare it to some other data to decide what type of mapping he is using now. Not with Enhanced Input. You can in runtime access an Input Mapping Context and update its structure, and its literally as simple has
IMC->UnmapKey() / IMC->MapKey()
.
- Enhanced Input System can differentiate input types: Let's say that your player can press E to open a door and he can also hold E to bash it. There's really one way you could handle this without Enhanced Input System: You have to keep track of all subsequent frames that your player have pressed a given key and, depending of the time pressed, perform a certain action. If you try to imagine this just for a second on a client/server type of scenario you will understand how prone to failure this is. Well, not with Enhanced Input system. You can just enter your Input Action edit window, add a Trigger for Hold and define how many seconds before triggering your action. Even if it should be fired only once or should be affected by time dilation. I am not kidding when I say that, if you wanted to build something similar by hand somehow in blueprints, it could take you months to achieve the same result. I'm not kidding. Not only that but Input Actions can easily differentiate between actions that should be fired only once per action and when. And it's so simple to use.
- Switching mappings on the fly: Let's say you need your character to
Jump
when the player presses Space Bar, but if he's under water he needs to Swim Up
. You could keep track of all different player states in your game and define a different logic for each key and each state, or you could just switch mapping inputs. If you simply switch map inputs (or work smartly with their priority), you need no new logic whatsoever. Just bind every player state to a Input Mapping Context (if there's need of one) and when the player changes state, it changes the mapping. Simple.
- Different events for different moments of the input: Let's say that you need your player to keep walking forward while hold W. BUT, you need to fire a specific method in the first frame he presses W and in the last frame he was pressing W (to handle triggering animations, let's say). I won't even start explaining how you would work with this with direct Key Press capture because it's not worth it. BUT, in Enhanced Input System you can define different methods for the same actions at different Events of the input. For instance, you have the Started event, which will be only called in the first frame a key is pressed. Or the Completed event, that will be fired in the last frame. Every event belonging to the same Input Action can be bound to a different method in your script. Completely removing the necessity of any logic to evaluate the type of event you are receiving whatsoever.
I'm going to be honest, I could keep going but I think I made my point and I'm also working on a Youtube video about this and I don't want to spoil it all here. xD
Anyway, I hope I could help and, trust me, Enhanced Input System is the way to go.