Hello, back from the future.
I made this quite a while ago, like 4-5 years maybe. Never got the chance to make a request for this to be inbuilt, but this just recently popped into my head and thought i would share it now since according to the documents i looked up online it doesn’t exist.
Maybe you need to power-up some ability and this could be used for instead of building holding from scratch.
I think an implementation isn’t a good idea due to the nature of JS, what would be more valuable is an example of control implementation.
From the top of my head: I would have a global manager that detects which button was last “held-down”. Also, do you want to support multiple locks at once? Do you want users to be able to cancel any conditionally like if taking damage? Probably… to all. This manager gets too complex to fit all scenarios as a generic class.
All this logic would normally be in your PlayerController.
Also consider different browser behaviours like switching tabs, losing focus and consumption. Many potential bugs and observers required, that we probably don’t want to introduce and maintain.
Hello, thanks for the interest, but i no longer think this is a feature that is needed.
I just remember coming up with something that made me able to do something while the pointer was being held down. Of course you need pointer down and pointer up to do it.