-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multitouch listener canceling/interaction system #218
Comments
Also phetsims/joist#70 |
I'm dealing with circumstances like the above in Bending Light, by forwarding events to another listener, I'm having to hack the event.currentTarget like so: // HACK ALERT. Changes the event's currentTarget. Why didn't we need to do this with the other nodes?
// Presumably because they were in similar coordinate frames?
// See Scenery #131 create drag listener
// See Scenery #218 multitouch
// There is a precedent for this hack in SimpleDragHandler.js
var c = event.currentTarget;
event.currentTarget = prismNode;
prismNode.movableDragHandler.forwardStartEvent( event );
event.currentTarget = c; |
phetsims/charges-and-fields#20 deals with this as well. That sim specifically runs into Example 1 above while dragging the meters:
|
Running into this issue again with function-builder, need to cancel in-progress interactions when "Reset All" is pressed. Labeling for "developer-meeting" to discuss. Skype conversation: [1/11/16, 1:05:15 PM] Chris Malley: Anyone know the preferred method of canceling a SimpleDragHandler drag cycle if (for example) the "Reset All" button is pressed? |
Two things to discuss at developer meeting: (1) Should this feature be elevated in priority, since it needs to be handled in all sims? When will it be available? Who should work on it? Etc. (2) Should I ignore this general issue in function-builder (as we seem to have done for most/all sims), or do I need to handle it in a sim-specific manner until this feature is available? |
Jan 14 meeting: @jonathanolson will look into it |
1/14/2016 dev meeting: |
The Isotopes and Atomic Mass (IAAM) sim recently underwent some dev testing, and several issues were logged that relate directly to having no general way to cancel multitouch listeners. Most of these IAAM issues have to do with a reset or a mode change while simultaneously dragging something, such as an atom. The issues are:
What's the status of this issue, and how close are we to having a proposal to address it? |
Was looking into approaches for automatically "interrupting" any active listeners beneath a Node tree (e.g. entire sim screen). For most listeners (button/drag), seems appropriate to have an array of listeners for each pointer that would need to be interrupted. Also need to determine if it's acceptable to act like it's an "end" of a drag, or if we need a callback for canceling (which we would also move 'cancel' events to trigger). |
2/11/16 developer meeting: Deferred by @ariel-phet, not a common use case. Not a concern for IAAM, may revisit for Function Builder. |
I removed the deferred label because #131 is full-speed ahead. |
I noticed that I was added to the list of assignees, and I think it is to respond to what @pixelzoom said above, specifically:
I looked through the code where @pixelzoom is using I'm unassigning myself, but I know that we discussed integrating the updated drag listener into Expression Exchange as a test bed once it is ready, so @pixelzoom or @jonathanolson - please reassign if that was what you were after. |
@jbphet You were added to the list of assignees because of this decision in yesterday's dev meeting:
I don't see that you've reviewed this in the context of #218, assigning you again. |
@jonathanolson I see a bunch of commits and assignment to me by you, but no notes about what was done, or what you'd like me to review. Can you give me some direction? |
Review of DragListener/FireListener/PressListener and the example demo would be helpful. Available over Skype to discuss together or to give an introduction if that would help. |
@jonathanolson how is that different from what you wanted in #131? |
Is "the example demo" scenery/examples/input.html, or something else? |
Sorry, did the work for this at the same time as #131, forgot which issue I was in.
Yes, that is the main demo. It handles canceling of inputs with the provided button (or switching of the in-example tabs). For interruption, this is handled in Node.interruptInput/interruptSubtreeInput, and Pointer (multiple attachment methods). |
Commits and comments for this issue appear to be combined (unintentionally?) with #131. So I'm going to give all of my feedback in that issue. Removing my assignment. |
What is the relationship between this issue and #131? I'll plan on giving my feedback in that issue unless I hear otherwise. |
They were implemented at the same time, but #131 more deals with the actual listeners side of things, and this issue deals with the Pointer/Node/Input support for the interruption. |
…ctivity), and to SimpleDragHandler/DownUpListener and subtypes. See phetsims/scenery#218, phetsims/scenery#619
Note to self: Look into the interruption of Display listeners. When should this be done? Is it needed? |
The above commit finished the last remaining item to be done above. Closing. |
We'll need to support canceling of drags and button presses when another action is triggered.
Example 1: You are dragging something and hit "reset all" with another finger. The drag should be canceled. Also applies to 'down' states for buttons, etc.
Example 2: (From ABS phetsims/acid-base-solutions#117) We want the ability to go down on a button, but then have a touchSnag (a) allow to be started even though the pointer is active, and (b) cancel the button press state.
Example 3: You are pressing down on a button with one finger, but then press down another finger and attempt to pinch-zoom. We want the choice of whether to cancel the button, or prevent the pinch-zoom behavior.
Example 4: Moving something in the play area, but another finger switches the screen (what you were dragging is now invisible), and we want to cancel the drag.
Example 5: Using a slider (say on a faucet node) to control the rate of flow, but when X is full we want to cancel the slider manipulation and set the slider to a rate of 0.
For implementation, when a pointer is active (controlling something), we'll want to keep a reference (somehow) to it on the pointer. Other listeners need to be able to inspect what the pointer is doing to make decisions. Then we'll want the ability to interrupt() the pointer and have its listener cancel (adding in better "cancel" behavior to SimpleDragHandler and ButtonListener). We'll also need an easy way to iterate through pointers and determine which ones need to be interrupted (say, for the "Reset All" button).
The text was updated successfully, but these errors were encountered: