"Key * pressed" procedure condition block

Published by DaanMC on Sat, 02/02/2019 - 14:02
Status
Won't fix
Product/platform
Not applicable
Priority
Minor
Issue description

 

EDIT: turns out that key bind DOES detect key release; using that and a global boolean I got thing to work exactly like I wanted. Still would be a nice feature though, so I'm gonna let this stay up here.

Original post:

Wouldn't it be nice to have a block in the procedure editor that outputs "true" while key(*dropdown menu*) is pressed and output "false" while the key is not pressed? like a condition:

if/while (key LSHIFT pressed) {
 action
}

I know there is a key bind element option, but that only gives a signal when you start pressing the key, and it doesn't detect when you've stopped pressing it.

Is there a way I can work around this problem, or am I gonna have to leave it at this feature request?

Issue comments

Unfortunately, checking key press is client side only. We won't add this as official procedure block as this block would crash servers. Consider just using key bindings instead.

How is that way of detecting when the key is pressed and when it is released?

 

Unfortunately, checking key press is client side only. We won't add this as official procedure block as this block would crash servers. Consider just using key bindings instead.

We found out we can't implement this properly.

This feature would be server incompatible.



Donate to MCreator

By donating to developers you can speed up development, as with more resources, we can dedicate more time to MCreator. It is a free project made by developers working on it in their free time.