Pointer holding

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.

Greets,
Timo

It would be good to have a demo and more understandable explanation of what pointer holding is…

Well, imagine clicking your left mouse button. Then keep holding it. That’s pointer holding.

1 Like

I think “ClickLock” is more common term for it.
In Windows it possible to turn Clicklock on and off.

Would be interesting to see your implementation.

Ok, i don’t think it’s called clicklock but i don’t have the project anymore to show it.

cc @amoebachant

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. :slightly_smiling_face:

1 Like

I don’t think it’s that usefull, why would you just need to hold pointer without there being mouse down and mouse up.

Maybe you’re referring to pointer capture? I’m curious to know more about scenario you’re proposing we add support for in Babylon.

Thanks!

2 Likes

Have a look at this example: lola/src/models/playerSelf/Controller.ts at main · wdda/lola · GitHub

Recently posted by @Rubaka. Lola — a third-person game example

1 Like

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.