[FlexJS] MouseEvent

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[FlexJS] MouseEvent

Peter Ent-2
I've been doing work with Drag and Drop and that involves mouse events. I'm wondering if someone could give me a history on the Apache FlexJS MouseEvent? Specially, its use of localX/Y and screenX/Y.

I'm wondering why the platform implements do not simply assign their version of screenX/Y as the screenX/Y values instead of the screenX/Y being getter functions?

I've run into cases where the localX/Y == screenX/Y in the FlexJS MouseEvent but the original event had different values.

Why would we not want the FlexJS MouseEvent to reflect the platform's mouse event values?

SWF: flexJSMouseEvent.screenX = swfMouseEvent.stageX;
JS: flexJSMouseEvent.screenX = jsMouseEvent.pageX;

Thanks.
Peter Ent
Adobe Systems/Apache Flex Project
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [FlexJS] MouseEvent

Harbs
I’m personally not sure that MouseEvent actually works. Any case of MouseEvents in the Framework actually dispatch BrowserEvents. The only exception to this case that you will currently find is in TLF where there is code which generates MouseEvents from points.

Check out my browser-event branch for my attempt to make MouseEvents and KeyboardEvents behave the way you’d expect.

I’m currently struggling with figuring out how to make artificially created MouseEvents behave properly. Maybe we should compare notes…

Harbs

> On Jul 25, 2017, at 9:49 PM, Peter Ent <[hidden email]> wrote:
>
> I've been doing work with Drag and Drop and that involves mouse events. I'm wondering if someone could give me a history on the Apache FlexJS MouseEvent? Specially, its use of localX/Y and screenX/Y.
>
> I'm wondering why the platform implements do not simply assign their version of screenX/Y as the screenX/Y values instead of the screenX/Y being getter functions?
>
> I've run into cases where the localX/Y == screenX/Y in the FlexJS MouseEvent but the original event had different values.
>
> Why would we not want the FlexJS MouseEvent to reflect the platform's mouse event values?
>
> SWF: flexJSMouseEvent.screenX = swfMouseEvent.stageX;
> JS: flexJSMouseEvent.screenX = jsMouseEvent.pageX;
>
> Thanks.
> Peter Ent
> Adobe Systems/Apache Flex Project

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [FlexJS] MouseEvent

Peter Ent-2
I feel like I'm not grasping some concept. Seems to be that

a) you would want at least two points in a MouseEvent: the screen position
and the local position that is relative to the event.target. You could
derive one from the other but why go through that hassle when both
platforms provide that, as far as I can tell.
b) you would want to know other conditions such as which button is used,
if it is up, down, or moved (either with or without a button pressed), if
any keyboard key was also pressed at the same time.

I don't see why computations need to be made unless some value in one
platform is unavailable and needs to be calculated, but I don't see any
that fall into this category.

Having FlexJS MouseEvent extend a platform event class seems to have it
drawbacks, but it also makes the event work in the current system, so I
would let that go.

What's disturbing is that events like Mouse and Keyboard and pretty
fundamental and it seems very late in the game that we are discussing
this. I can probably do what I need to do with DnD with what's there, but
it is just exposing a fundamental issue to me.

‹peter

On 7/25/17, 3:08 PM, "Harbs" <[hidden email]> wrote:

>I¹m personally not sure that MouseEvent actually works. Any case of
>MouseEvents in the Framework actually dispatch BrowserEvents. The only
>exception to this case that you will currently find is in TLF where there
>is code which generates MouseEvents from points.
>
>Check out my browser-event branch for my attempt to make MouseEvents and
>KeyboardEvents behave the way you¹d expect.
>
>I¹m currently struggling with figuring out how to make artificially
>created MouseEvents behave properly. Maybe we should compare notesŠ
>
>Harbs
>
>> On Jul 25, 2017, at 9:49 PM, Peter Ent <[hidden email]> wrote:
>>
>> I've been doing work with Drag and Drop and that involves mouse events.
>>I'm wondering if someone could give me a history on the Apache FlexJS
>>MouseEvent? Specially, its use of localX/Y and screenX/Y.
>>
>> I'm wondering why the platform implements do not simply assign their
>>version of screenX/Y as the screenX/Y values instead of the screenX/Y
>>being getter functions?
>>
>> I've run into cases where the localX/Y == screenX/Y in the FlexJS
>>MouseEvent but the original event had different values.
>>
>> Why would we not want the FlexJS MouseEvent to reflect the platform's
>>mouse event values?
>>
>> SWF: flexJSMouseEvent.screenX = swfMouseEvent.stageX;
>> JS: flexJSMouseEvent.screenX = jsMouseEvent.pageX;
>>
>> Thanks.
>> Peter Ent
>> Adobe Systems/Apache Flex Project
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [FlexJS] MouseEvent

Harbs
I agree with everything you write.

I think BrowserEvent was created to just be a proxy to the goog one, but the work to make proper MouseEvents and KeyboardEvents was not really finished until now.

Please check out the current state of the browser-event branch. I think it’s working pretty well right now and it should address all of these issues.

Thanks,
Harbs

> On Jul 26, 2017, at 12:27 AM, Peter Ent <[hidden email]> wrote:
>
> I feel like I'm not grasping some concept. Seems to be that
>
> a) you would want at least two points in a MouseEvent: the screen position
> and the local position that is relative to the event.target. You could
> derive one from the other but why go through that hassle when both
> platforms provide that, as far as I can tell.
> b) you would want to know other conditions such as which button is used,
> if it is up, down, or moved (either with or without a button pressed), if
> any keyboard key was also pressed at the same time.
>
> I don't see why computations need to be made unless some value in one
> platform is unavailable and needs to be calculated, but I don't see any
> that fall into this category.
>
> Having FlexJS MouseEvent extend a platform event class seems to have it
> drawbacks, but it also makes the event work in the current system, so I
> would let that go.
>
> What's disturbing is that events like Mouse and Keyboard and pretty
> fundamental and it seems very late in the game that we are discussing
> this. I can probably do what I need to do with DnD with what's there, but
> it is just exposing a fundamental issue to me.
>
> ‹peter
>
> On 7/25/17, 3:08 PM, "Harbs" <[hidden email]> wrote:
>
>> I¹m personally not sure that MouseEvent actually works. Any case of
>> MouseEvents in the Framework actually dispatch BrowserEvents. The only
>> exception to this case that you will currently find is in TLF where there
>> is code which generates MouseEvents from points.
>>
>> Check out my browser-event branch for my attempt to make MouseEvents and
>> KeyboardEvents behave the way you¹d expect.
>>
>> I¹m currently struggling with figuring out how to make artificially
>> created MouseEvents behave properly. Maybe we should compare notesŠ
>>
>> Harbs
>>
>>> On Jul 25, 2017, at 9:49 PM, Peter Ent <[hidden email]> wrote:
>>>
>>> I've been doing work with Drag and Drop and that involves mouse events.
>>> I'm wondering if someone could give me a history on the Apache FlexJS
>>> MouseEvent? Specially, its use of localX/Y and screenX/Y.
>>>
>>> I'm wondering why the platform implements do not simply assign their
>>> version of screenX/Y as the screenX/Y values instead of the screenX/Y
>>> being getter functions?
>>>
>>> I've run into cases where the localX/Y == screenX/Y in the FlexJS
>>> MouseEvent but the original event had different values.
>>>
>>> Why would we not want the FlexJS MouseEvent to reflect the platform's
>>> mouse event values?
>>>
>>> SWF: flexJSMouseEvent.screenX = swfMouseEvent.stageX;
>>> JS: flexJSMouseEvent.screenX = jsMouseEvent.pageX;
>>>
>>> Thanks.
>>> Peter Ent
>>> Adobe Systems/Apache Flex Project
>>
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [FlexJS] MouseEvent

Harbs
I have fixed the remaining issues in the branch today.

As far as I’m concerned, I’m ready to merge it in.

Before I do, feel free to let me know if there’s any problems with my code…

BTW: It should be very straight-forward to add mouse wheel event properties to the MouseEvent now. HTML has both x and y properties as opposed to Flash which has only y scrolling. That brings up some implementation questions, but nothing major.

> On Jul 26, 2017, at 12:51 PM, Harbs <[hidden email]> wrote:
>
> I agree with everything you write.
>
> I think BrowserEvent was created to just be a proxy to the goog one, but the work to make proper MouseEvents and KeyboardEvents was not really finished until now.
>
> Please check out the current state of the browser-event branch. I think it’s working pretty well right now and it should address all of these issues.
>
> Thanks,
> Harbs
>
>> On Jul 26, 2017, at 12:27 AM, Peter Ent <[hidden email]> wrote:
>>
>> I feel like I'm not grasping some concept. Seems to be that
>>
>> a) you would want at least two points in a MouseEvent: the screen position
>> and the local position that is relative to the event.target. You could
>> derive one from the other but why go through that hassle when both
>> platforms provide that, as far as I can tell.
>> b) you would want to know other conditions such as which button is used,
>> if it is up, down, or moved (either with or without a button pressed), if
>> any keyboard key was also pressed at the same time.
>>
>> I don't see why computations need to be made unless some value in one
>> platform is unavailable and needs to be calculated, but I don't see any
>> that fall into this category.
>>
>> Having FlexJS MouseEvent extend a platform event class seems to have it
>> drawbacks, but it also makes the event work in the current system, so I
>> would let that go.
>>
>> What's disturbing is that events like Mouse and Keyboard and pretty
>> fundamental and it seems very late in the game that we are discussing
>> this. I can probably do what I need to do with DnD with what's there, but
>> it is just exposing a fundamental issue to me.
>>
>> ‹peter
>>
>> On 7/25/17, 3:08 PM, "Harbs" <[hidden email]> wrote:
>>
>>> I¹m personally not sure that MouseEvent actually works. Any case of
>>> MouseEvents in the Framework actually dispatch BrowserEvents. The only
>>> exception to this case that you will currently find is in TLF where there
>>> is code which generates MouseEvents from points.
>>>
>>> Check out my browser-event branch for my attempt to make MouseEvents and
>>> KeyboardEvents behave the way you¹d expect.
>>>
>>> I¹m currently struggling with figuring out how to make artificially
>>> created MouseEvents behave properly. Maybe we should compare notesŠ
>>>
>>> Harbs
>>>
>>>> On Jul 25, 2017, at 9:49 PM, Peter Ent <[hidden email]> wrote:
>>>>
>>>> I've been doing work with Drag and Drop and that involves mouse events.
>>>> I'm wondering if someone could give me a history on the Apache FlexJS
>>>> MouseEvent? Specially, its use of localX/Y and screenX/Y.
>>>>
>>>> I'm wondering why the platform implements do not simply assign their
>>>> version of screenX/Y as the screenX/Y values instead of the screenX/Y
>>>> being getter functions?
>>>>
>>>> I've run into cases where the localX/Y == screenX/Y in the FlexJS
>>>> MouseEvent but the original event had different values.
>>>>
>>>> Why would we not want the FlexJS MouseEvent to reflect the platform's
>>>> mouse event values?
>>>>
>>>> SWF: flexJSMouseEvent.screenX = swfMouseEvent.stageX;
>>>> JS: flexJSMouseEvent.screenX = jsMouseEvent.pageX;
>>>>
>>>> Thanks.
>>>> Peter Ent
>>>> Adobe Systems/Apache Flex Project
>>>
>>
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [FlexJS] MouseEvent

piotrz
Harbs,

Give me some time, cause I wanted to test it before you merge.

Thanks,
Piotr
Apache Flex PMC
piotrzarzycki21@gmail.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [FlexJS] MouseEvent

Harbs
Sure. No rush.

> On Jul 26, 2017, at 4:22 PM, piotrz <[hidden email]> wrote:
>
> Harbs,
>
> Give me some time, cause I wanted to test it before you merge.
>
> Thanks,
> Piotr
>
>
>
> -----
> Apache Flex PMC
> [hidden email]
> --
> View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-MouseEvent-tp63542p63566.html
> Sent from the Apache Flex Development mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [FlexJS] MouseEvent

Harbs
In reply to this post by piotrz
While you’re at it, if you could write a test for wheel events, that would be very helpful.

I don’t have time to write tests for that right now.

I just added properties for wheel events. Yishay and I added support for wheel events in the framework and falcon last week. (You will need the latest builds of Falcon to use wheel events in MXML at the least.)

Thanks,
Harbs

> On Jul 26, 2017, at 4:22 PM, piotrz <[hidden email]> wrote:
>
> Harbs,
>
> Give me some time, cause I wanted to test it before you merge.
>
> Thanks,
> Piotr
>
>
>
> -----
> Apache Flex PMC
> [hidden email]
> --
> View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-MouseEvent-tp63542p63566.html
> Sent from the Apache Flex Development mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [FlexJS] MouseEvent

piotrz
Harbs,

My local Maven build is failing and I'm actually not sure why... [1]

[1] https://paste.apache.org/hHHU

Piotr
Apache Flex PMC
piotrzarzycki21@gmail.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [FlexJS] MouseEvent

Harbs
It looks like you are missing my commit revert in typedefs.

> On Jul 26, 2017, at 9:16 PM, piotrz <[hidden email]> wrote:
>
> Harbs,
>
> My local Maven build is failing and I'm actually not sure why... [1]
>
> [1] https://paste.apache.org/hHHU
>
> Piotr
>
>
>
> -----
> Apache Flex PMC
> [hidden email]
> --
> View this message in context: http://apache-flex-development.2333347.n4.nabble.com/FlexJS-MouseEvent-tp63542p63573.html
> Sent from the Apache Flex Development mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [FlexJS] MouseEvent

Alex Harui-2
In reply to this post by Harbs
Will anyone ever really ship an app that doesn't need wheel support?  Our
smaller examples don't need it, so I'm wondering if wheel support should
be separated out or not.

Thoughts?
-Alex

On 7/26/17, 9:27 AM, "Harbs" <[hidden email]> wrote:

>While you’re at it, if you could write a test for wheel events, that
>would be very helpful.
>
>I don’t have time to write tests for that right now.
>
>I just added properties for wheel events. Yishay and I added support for
>wheel events in the framework and falcon last week. (You will need the
>latest builds of Falcon to use wheel events in MXML at the least.)
>
>Thanks,
>Harbs
>
>> On Jul 26, 2017, at 4:22 PM, piotrz <[hidden email]> wrote:
>>
>> Harbs,
>>
>> Give me some time, cause I wanted to test it before you merge.
>>
>> Thanks,
>> Piotr
>>
>>
>>
>> -----
>> Apache Flex PMC
>> [hidden email]
>> --
>> View this message in context:
>>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fl
>>ex-development.2333347.n4.nabble.com%2FFlexJS-MouseEvent-tp63542p63566.ht
>>ml&data=02%7C01%7C%7Cdd1a7c3fcc014d734c4008d4d44346a0%7Cfa7b1b5a7b3443879
>>4aed2c178decee1%7C0%7C0%7C636366832801744724&sdata=LZ9EAwK4S9FJdDG7L7PMNu
>>kR4XC5%2FiCFJeUxA54CQxY%3D&reserved=0
>> Sent from the Apache Flex Development mailing list archive at
>>Nabble.com.
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [FlexJS] MouseEvent

Harbs
I don’t really see how we can separate it out. The code which figures out which event is being dispatched is pretty low level in HTMLElementWrapper.

Maybe there’s some way to use dependency injection to specify which events will be needed, but I’m not sure how easy that will be.

FWIW, we’re probably going to want to add touch events at some point, but maybe we can write utility functions to prevent all that to be hard-coded in.

> On Jul 26, 2017, at 9:52 PM, Alex Harui <[hidden email]> wrote:
>
> Will anyone ever really ship an app that doesn't need wheel support?  Our
> smaller examples don't need it, so I'm wondering if wheel support should
> be separated out or not.
>
> Thoughts?
> -Alex
>
> On 7/26/17, 9:27 AM, "Harbs" <[hidden email] <mailto:[hidden email]>> wrote:
>
>> While you’re at it, if you could write a test for wheel events, that
>> would be very helpful.
>>
>> I don’t have time to write tests for that right now.
>>
>> I just added properties for wheel events. Yishay and I added support for
>> wheel events in the framework and falcon last week. (You will need the
>> latest builds of Falcon to use wheel events in MXML at the least.)
>>
>> Thanks,
>> Harbs
>>
>>> On Jul 26, 2017, at 4:22 PM, piotrz <[hidden email]> wrote:
>>>
>>> Harbs,
>>>
>>> Give me some time, cause I wanted to test it before you merge.
>>>
>>> Thanks,
>>> Piotr
>>>
>>>
>>>
>>> -----
>>> Apache Flex PMC
>>> [hidden email]
>>> --
>>> View this message in context:
>>> https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fl <https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-fl>
>>> ex-development.2333347.n4.nabble.com <http://ex-development.2333347.n4.nabble.com/>%2FFlexJS-MouseEvent-tp63542p63566.ht
>>> ml&data=02%7C01%7C%7Cdd1a7c3fcc014d734c4008d4d44346a0%7Cfa7b1b5a7b3443879
>>> 4aed2c178decee1%7C0%7C0%7C636366832801744724&sdata=LZ9EAwK4S9FJdDG7L7PMNu
>>> kR4XC5%2FiCFJeUxA54CQxY%3D&reserved=0
>>> Sent from the Apache Flex Development mailing list archive at
>>> Nabble.com <http://nabble.com/>.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [FlexJS] MouseEvent

piotrz
In reply to this post by Harbs
Hi Harbs,

It looks like everything is ok with your changes in my app. I have checked also MDLExample. The only thing which boders me that Maven build producing for me only js-debug folder - no release version, but that maybe an issue on my setup.

Green light from me for merge.

Thanks,
Piotr
Apache Flex PMC
piotrzarzycki21@gmail.com
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [FlexJS] MouseEvent

Alex Harui-2
In reply to this post by Harbs
There are MouseController beads in many places already.  IMO, they would
be replaced with touch/gesture controllers for those who need it.  The
rollover code isn't needed on mobile devices AFAICT.  The
DragDropControllers at one point "injected" new event types into the
ElementEvents list.

So there are ways to separate it out if we want to.  Touch/Gesture should
be separated out, but I'm not so sure about mouseWheel which is why I
asked.

-Alex

On 7/26/17, 12:56 PM, "Harbs" <[hidden email]> wrote:

>I don’t really see how we can separate it out. The code which figures out
>which event is being dispatched is pretty low level in HTMLElementWrapper.
>
>Maybe there’s some way to use dependency injection to specify which
>events will be needed, but I’m not sure how easy that will be.
>
>FWIW, we’re probably going to want to add touch events at some point, but
>maybe we can write utility functions to prevent all that to be hard-coded
>in.
>
>> On Jul 26, 2017, at 9:52 PM, Alex Harui <[hidden email]>
>>wrote:
>>
>> Will anyone ever really ship an app that doesn't need wheel support?
>>Our
>> smaller examples don't need it, so I'm wondering if wheel support should
>> be separated out or not.
>>
>> Thoughts?
>> -Alex
>>
>> On 7/26/17, 9:27 AM, "Harbs" <[hidden email]
>><mailto:[hidden email]>> wrote:
>>
>>> While you’re at it, if you could write a test for wheel events, that
>>> would be very helpful.
>>>
>>> I don’t have time to write tests for that right now.
>>>
>>> I just added properties for wheel events. Yishay and I added support
>>>for
>>> wheel events in the framework and falcon last week. (You will need the
>>> latest builds of Falcon to use wheel events in MXML at the least.)
>>>
>>> Thanks,
>>> Harbs
>>>
>>>> On Jul 26, 2017, at 4:22 PM, piotrz <[hidden email]> wrote:
>>>>
>>>> Harbs,
>>>>
>>>> Give me some time, cause I wanted to test it before you merge.
>>>>
>>>> Thanks,
>>>> Piotr
>>>>
>>>>
>>>>
>>>> -----
>>>> Apache Flex PMC
>>>> [hidden email]
>>>> --
>>>> View this message in context:
>>>>
>>>>https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache-
>>>>fl
>>>><https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fapache
>>>>-fl>
>>>> ex-development.2333347.n4.nabble.com
>>>><https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fex-dev
>>>>elopment.2333347.n4.nabble.com%2F&data=02%7C01%7C%7C5775235a9aab4f83202
>>>>308d4d4607d62%7Cfa7b1b5a7b34438794aed2c178decee1%7C0%7C0%7C636366958269
>>>>604217&sdata=%2FieGNeqO0UuUuzPyNrh9Shlb7GphOiGU4EbsF%2F7SDI8%3D&reserve
>>>>d=0>%2FFlexJS-MouseEvent-tp63542p63566.ht
>>>>
>>>>ml&data=02%7C01%7C%7Cdd1a7c3fcc014d734c4008d4d44346a0%7Cfa7b1b5a7b34438
>>>>79
>>>>
>>>>4aed2c178decee1%7C0%7C0%7C636366832801744724&sdata=LZ9EAwK4S9FJdDG7L7PM
>>>>Nu
>>>> kR4XC5%2FiCFJeUxA54CQxY%3D&reserved=0
>>>> Sent from the Apache Flex Development mailing list archive at
>>>> Nabble.com
>>>><https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fnabble
>>>>.com%2F&data=02%7C01%7C%7C5775235a9aab4f83202308d4d4607d62%7Cfa7b1b5a7b
>>>>34438794aed2c178decee1%7C0%7C0%7C636366958269604217&sdata=s4z2jRXFmcIQG
>>>>CNW4gaMdOdd4HKecK96jH%2FLjDFAlWw%3D&reserved=0>.
>

Loading...