The new field input can detect "which movement keys the player is pressing", quoting the official release note.
However it does not work with players looking at UI, like inventory. I do not know if this is intended. but it says "which keys is pressing" and it suggests that it should always work when the key is being pressed.
Steps To Reproduce:
Run the following command in a repeating command block:
execute as @a at @s if predicate { "condition": "entity_properties", "entity": "this", "predicate": { "type_specific": { "type": "player", "input": { "right": true } } }} run say detected!
Open inventory
Press d, or the key that moves you to the right.
Expected Result:
The input would be detected inside the GUI.
Observed Result:
Nothing is detected, no say
command is output.
Thank you for your report!
After consideration, the issue is being closed as Working as Intended.
Please note, that mechanics of the game may change between updates.
Things such as graphics, sounds, world creation, biomes, redstone, villagers, and animals may not work the same in current versions.
Full Version History – Snapshot Version History – The official Minecraft feedback site
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki