Vousk-prod. Posted October 31, 2015 Share Posted October 31, 2015 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 ? 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! Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 1, 2015 Share Posted November 1, 2015 OnPointerUpTrigger ? Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted November 1, 2015 Author Share Posted November 1, 2015 That's not a pointer up trigger. A pointer up is raised in any case when click or press is finished (after having moved the mouse while pressed or not).My new trigger will distinguish single click/tap from drag/swipe/pinch one. Quote Link to comment Share on other sites More sharing options...
JohnK Posted November 1, 2015 Share Posted November 1, 2015 onPickClick??????? onClickPick??????? Quote Link to comment Share on other sites More sharing options...
adam Posted November 1, 2015 Share Posted November 1, 2015 Maybe in this case it would be better to refactor if onPickTrigger really should be onPointerDownTrigger. Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted November 1, 2015 Author Share Posted November 1, 2015 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. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 1, 2015 Share Posted November 1, 2015 No rename of public functions but what about OnTapTrigger ? Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted November 1, 2015 Author Share Posted November 1, 2015 OnTapTrigger in not applicable for mouse event. The rename would still leave a usable OnPickTrigger. The only difference would be that this trigger wouldn't be raised anymore if user is actualy dragging or swiping and not just picking. Quote Link to comment Share on other sites More sharing options...
RaananW Posted November 1, 2015 Share Posted November 1, 2015 OnInteractionTrigger? OnUserInteractionTrigger? Quote Link to comment Share on other sites More sharing options...
iiceman Posted November 2, 2015 Share Posted November 2, 2015 OnSelect? Or OnPikachu? jerome and GameMonetize 2 Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted November 8, 2015 Author Share Posted November 8, 2015 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 ? Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted November 8, 2015 Author Share Posted November 8, 2015 (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.) Quote Link to comment Share on other sites More sharing options...
iiceman Posted November 8, 2015 Share Posted November 8, 2015 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. Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted November 8, 2015 Author Share Posted November 8, 2015 @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 ). Quote Link to comment Share on other sites More sharing options...
iiceman Posted November 8, 2015 Share Posted November 8, 2015 Yeah, I guess you are right... OnClickOrTapTrigger is too long? But might be very clear when I imagine the case you described... Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 9, 2015 Share Posted November 9, 2015 let's go for rename: but for EVERY question I will have about why it was working before,YOU will have to answer Quote Link to comment Share on other sites More sharing options...
jerome Posted November 9, 2015 Share Posted November 9, 2015 Why will it be working before ? Vousk-prod. and GameMonetize 2 Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted November 11, 2015 Author Share Posted November 11, 2015 Because. Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted November 11, 2015 Author Share Posted November 11, 2015 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 ) 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 ). Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 11, 2015 Share Posted November 11, 2015 sounds good! Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted January 6, 2016 Author Share Posted January 6, 2016 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. Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted January 6, 2016 Author Share Posted January 6, 2016 Hmm, thinking about ActionManager, I think a function to skip the current (waiting) action for the next active Action (chained by then()) could be sometimes usefull.I'll add this one and make an other PR. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.