Jump to content

Need help naming a new trigger


Vousk-prod.
 Share

Recommended Posts

Hello all,

 

Currently BABYLON.ActionManager.OnPickTrigger acts as a "pointer down" trigger and not as a real click / tap trigger.

So I've implemented this new trigger in the engine, but I need your help to find an appropriate name.

 

OnClickTrigger doesn't take mobiles in account, OnTapTrigger in not applicable for mouse, OnPickTrigger would be perfect but it's already used and I don't want to make kind of a breaking change.

 

OnInstantPickTrigger ?

OnRealPickTrigger ?

OnNotMovingNorSwipingPointerEventTrigger ? :P

 

And I also plan to add a "long press" trigger but I don't know for now if I'll call it OnPressTrigger or OnLongPressTrigger, what do you think ?

 

As you can see I need advices... To your keyboard guys!

Link to comment
Share on other sites

Maybe in this case it would be better to refactor if onPickTrigger really should be onPointerDownTrigger.

 

That's also what I would prefer.

Current OnPickTrigger would be renamed to OnPointerDownTrigger, and the new one would be OnPickTrigger.

 

But I'd like to have the boss (and community) approval before doing this.

Link to comment
Share on other sites

I think OnSelect could be misleading, because we are not actually selecting an object, only clicking on it. And a real OnSelectTrigger could be implemented with more selection options (for instance a "draw box" selection).

 

The idea is to find a name that clearly indicates we are talking about a single not moving click or tap (not raised if the user press and then drag before releasing).

 

OnStillPickTrigger ?

 

Or the more logical option for users (DK, really not ??) : this new trigger raised on OnPickTrigger and the current OnPickTrigger raised on new OnPointerUpTrigger ?

Link to comment
Share on other sites

(I know I insist a little, but whereas it's good to be backward compatible, it's also great to be standard compliant and easily guessable.

In every GUI API worldwide mouse up is always distinguished from simple mouse click, but currently the BJS "pick" reacts differently than usual way and I find it pretty unatural.)

Link to comment
Share on other sites

 

 

OnClickTrigger doesn't take mobiles in account, OnTapTrigger in not applicable for mouse...

 

What about two names? Name it OnClickTrigger and create an alias called OnTagTrigger. The functionality is the same (it is, isn't it?) and the user can decide what he feels is the more appropriate name in his use case.

Link to comment
Share on other sites

@iiceman I don't think that's an applicable idea. Usually when people creates an HTML5 app, the idea is to target the widest possible audience, including mobile device (BJS philosophy has mobile compliance in mind for everything).

When one will have to put a trigger and see there is one for mouse and one for touch devices, he will naturally put both, and so, events will be raised twice... (and he won't understand why, and he will come here to ask questions ;) ).

Link to comment
Share on other sites

let's go for rename: but for EVERY question I will have about why it was working before,YOU will have to answer :)

 

No problem. I'll take my responsibiility!

(and I'll create an answer template I will copy/paste each time :lol:)

 

So I will finish and rename appropriate methods and PR all of this (next next week only, I'll be in music recording session for a couple of days from now B)).

Link to comment
Share on other sites

  • 1 month later...

Oh, I've just noticed I totally forgot to PR this branch. I do it right now.

 

BTW I choosed to call the pointer down trigger OnPickDownTrigger instead of OnPointerDownTrigger, because there is already a OnPickUpTrigger and it's better (and easier) for BJS users if naming is consistent.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...