Merge lp://staging/~mir-team/mir/introduce-pointer-event into lp://staging/mir
- introduce-pointer-event
- Merge into development-branch
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Andreas Pokorny | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 2228 | ||||
Proposed branch: | lp://staging/~mir-team/mir/introduce-pointer-event | ||||
Merge into: | lp://staging/mir | ||||
Diff against target: |
753 lines (+491/-33) 9 files modified
client-ABI-sha1sums (+2/-1) common-ABI-sha1sums (+2/-1) include/common/mir_toolkit/events/input/input_event.h (+12/-1) include/common/mir_toolkit/events/input/pointer_input_event.h (+120/-0) platform-ABI-sha1sums (+2/-1) server-ABI-sha1sums (+2/-1) src/client/symbols.map (+6/-0) src/common/input/input_event.cpp (+137/-1) tests/unit-tests/input/test_input_event.cpp (+208/-27) |
||||
To merge this branch: | bzr merge lp://staging/~mir-team/mir/introduce-pointer-event | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Andreas Pokorny (community) | Approve | ||
Alan Griffiths | Approve | ||
Daniel van Vugt | Abstain | ||
Cemil Azizoglu (community) | Approve | ||
Chris Halse Rogers | Approve | ||
PS Jenkins bot (community) | continuous-integration | Approve | |
Kevin DuBois (community) | Approve | ||
Review via email: mp+245679@code.staging.launchpad.net |
Commit message
Introduce MirPointerEvent
Description of the change
Introduce MirPointerEvents as distinguished from Mir touch events. Recognized via the device class flags provided by android input.
PS Jenkins bot (ps-jenkins) wrote : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:2196
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:2197
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Kevin DuBois (kdub) wrote : | # |
needs fixing:
Shouldn't we have the new symbol be in its own stanza in the symbols.map for the client library?
needs info:
With MirPointerInput
Robert Carr (robertcarr) wrote : | # |
>> Shouldn't we have the new symbol be in its own stanza in the symbols.map for the client library?
Ah...I didn't know about that. How does this work with the global: * catch in the MIR_CLIENT_8 stanza?
Updated anyway :)
>> With MirPointerInput
I've been thinking that once the device introspection API is available it will also be possible to obtain the identifiers for more buttons via that, then you can use the introspection API to query their names etc.
MirPointerInput
MirPointerInput
To
bool mir_pointer_
This way the button enum is not using flags and it will be easier to expand/use other values in the future.
This way the pointer button enum doesnt have to be flags and wi to expand as time goes on.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:2199
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:2200
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Daniel van Vugt (vanvugt) wrote : | # |
This distinction is confusing:
306 +// Differentiate between MirTouchInputEvents and MirPointerInput
307 +MirInputEventType type_from_
308 +{
309 + switch (source_class)
310 + {
311 + case AINPUT_
312 + case AINPUT_
313 + case AINPUT_
314 + return mir_input_
315 + // Realistically touch events should only come from Stylus and Touchscreen
316 + // device classes.
317 + default:
318 + return mir_input_
319 + }
320 +}
If "pointer" events don't include the pointiest kind of input (stylus, finger) then we need to clarify the terminology. Perhaps:
MirAbsoluteI
MirRelativeI
MirFocussedI
Robert Carr (robertcarr) wrote : | # |
>> If "pointer" events don't include the pointiest kind of input (stylus, finger)
>> then we need to clarify the terminology
Pointer refers to the system pointer/cursor rather than the "pointiness of the input".
This MP does leave some open questions....e.g. what becomes of joystick events, or how would you get access to raw relative events from a mouse?
This is to be addressed in future MPs through the distinction of raw and synthetic events. For mice, joysticks, etc, the raw event would feature the relative axis. In the case that the relative axis device is controlling the system pointer, a Pointer event will also be generated with a "synthesized_from" member referring to the raw event.
Daniel van Vugt (vanvugt) wrote : | # |
Ah OK. That does kind of clarify another question I had --
Do we mean something that's a physical pointer or something that results in a mouse arrow cursor on screen? I think "pointer" means the latter here.
It sounds like MirRelativeInpu
Maybe to avoid confusion over different meanings of pointer, we should say the source of the input is a MirRelativeInpu
Similarly, a MirAbsoluteInpu
Andreas Pokorny (andreas-pokorny) wrote : | # |
133 +/* Relative axis containing the speed of the vertical scroll wheel */
134 + mir_pointer_
135 +/* Relative axis containing the speed of the horizontal scroll wheel */
speed -> change?
looks good to me otherwise
Robert Carr (robertcarr) wrote : | # |
>> speed -> change?
Hey! You're back. Happy new years...we have some fun to have on evdev-input-
Hmm. I agree its kind of confusing.
I think speed may be correct because change makes it seem like you are talking about change in the axis state over time. Imagine you are scrolling up and receive a +7...then you reverse the direction of your scroll...at one point you will hit +0 which has to be interpreted as a current scroll speed of zero, not a change in the scroll axis state over time (because the change would be zero). Likewise if this entire reveral of speed (say from +7 to -3) happens in a single input frame, -3 is not your change (which would be 10) but rather just your new negative speed.
I have this sinking feeling that I am turning things over wrong in my head though so will continue to think some today.
Robert Carr (robertcarr) wrote : | # |
>>
>> It sounds like MirRelativeInpu
>> indeed relative input devices. Only when "cooked" do such devices gain a logical pointing location
>> on screen.
Yes. Though I am imagining there will only be one MirRawInputEvent type, and the user can introspect whether a given axis is relative or absolute. It seems to be a good strategy to report input in frames which contain snapshots of device state...so it should be easy to mix relative and absolute axis on a single event (e.g. input frame).
>> Maybe to avoid confusion over different meanings of pointer, we should say the source of the input >> is a MirRelativeInpu
>> come into it.
We are close to agreement :). In this model the source is a raw input event with relative axis, and a pointer event is synthesized from it. I don't think pointer is particularly ambiguous and there is a long history of using "pointer" or "cursor" to refer to the onscreen system.
>> Similarly, a MirAbsoluteInpu
>> (LP: #1396421)
Definitely you could enable this via the configuration API. In this case you would get raw absolute axis events, and rather than (in addition to?) a synthetic touch event would receive a synthetic pointer event.
Chris Halse Rogers (raof) wrote : | # |
Globally: how difficult would it be to use a 24.8 fixed-point scheme? We do want subpixel motion precision, but we don't need all that much precision.
+ /* Axis values or button state has changed for the pointer */
122 + mir_pointer_
This appears to be a lie¹? It seems to only be for motion; perhaps it should be mir_pointer_
I think mir_pointer_
Additionally, there doesn't seem to be a way to figure out *which* button went up/down? You can get the current state through get_button_state, but unless the client maintains the previous button states it can't work out what button changed.
Likewise, we can get the current axis values but not their changes. It would seem sensible for the client to be able to know which ones have changed?
133 +/* Relative axis containing the speed of the vertical scroll wheel */
134 + mir_pointer_
Are we really reporting the time-derivative of the scroll axis values? Why? We don't get that from the kernel; we get the values themselves.
input_axis_vscroll and input_axis_hscroll should be relative axes. (Most) scroll wheels aren't joysticks; you can just keep spinning them :).
¹: Relevant bit is:
357 +MirPointerInpu
...
373 + case mir_motion_
374 + case mir_motion_
375 + case mir_motion_
376 + default:
377 + return mir_pointer_
Chris Halse Rogers (raof) wrote : | # |
Mark as needs-fixing, so it gets on my review list.
Daniel van Vugt (vanvugt) wrote : | # |
I think the ease with which I found the word "pointer" confusing suggests I won't be the last one. We have an opportunity to choose less ambiguous terminology now. Probably not so much later.
Chris:
I don't think fixed point is necessarily better than floats for input. If you have fixed 24.8 (32-bit) then to avoid overflows you need to remember to always work with 64-bit numbers. And of course, you need to shift in the end to get to your whole numbers. OK, yes there's a performance advantage in doing lots of ops with ints instead of floats, but not as great as it used to be. Can anyone cite a specific case for input where sub-pixel precision is important?...
Daniel van Vugt (vanvugt) wrote : | # |
"Needs Fixing" because I think we should seize the opportunity to avoid introducing confusing wording with "pointer". Less ambiguous alternatives mentioned above.
Andreas Pokorny (andreas-pokorny) wrote : | # |
> >> speed -> change?
>
> Hey! You're back. Happy new years...we have some fun to have on evdev-input-
> platform ;)
>
> Hmm. I agree its kind of confusing.
>
> I think speed may be correct because change makes it seem like you are talking
> about change in the axis state over time. Imagine you are scrolling up and
> receive a +7...then you reverse the direction of your scroll...at one point
> you will hit +0 which has to be interpreted as a current scroll speed of zero,
> not a change in the scroll axis state over time (because the change would be
> zero). Likewise if this entire reveral of speed (say from +7 to -3) happens in
> a single input frame, -3 is not your change (which would be 10) but rather
> just your new negative speed.
>
> I have this sinking feeling that I am turning things over wrong in my head
> though so will continue to think some today.
Yes in the example above I expect to find a change expressed as the value "-10" attached to the event. I believe you are exposing relative changes along the vertical and horizontal axis.
I do not think that you plan to measure the velocity here.. and expect users to integrate speed change events over time diffs, to get to the amount of ticks scrolled.
So I really think that you mean something like a delta expressed in ticks. How about "ticks"?
Robert Carr (robertcarr) wrote : | # |
Fixed vscroll and hscroll comments...I got in to a weird state of confusion imagining spinning scroll balls ;)
Chris other comments:
Updated the actions now button_up and button_down and change.
Robert Carr (robertcarr) wrote : | # |
Chris: With respect to previous button and axis state I agree including it would be useful. Until we change the internal MirEvent representaiton it's difficult though. In the meantime clients will have to track the previous button state (just as they do now). Following the transition, we can add backwards compatible new functions to query the collection of changed axis and buttons.
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:2204
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Chris Halse Rogers (raof) wrote : | # |
On Wed, Jan 14, 2015 at 6:35 PM, Daniel van Vugt
<email address hidden> wrote:
> I think the ease with which I found the word "pointer" confusing
> suggests I won't be the last one. We have an opportunity to choose
> less ambiguous terminology now. Probably not so much later.
I don't think we have a better candidate terminology available yet?
The thing is, pointer events *don't* come from any physical input
device; they come from a synthesised virtual pointer.
It shouldn't be called MirRelativeInpu
of the event) event is absolute (and the vscroll, hscroll axes are
relative ☺).
And, as you note, absolute devices like the stylus on a tablet *can*
produce MirPointerInput
produced RelativeInputEv
We *could* have a different model; make everything MirInputDeviceEvent
and then have a special “device 0” virtual pointer device. I'm not
sure if that's any better, though.
>
> Chris:
> I don't think fixed point is necessarily better than floats for
> input. If you have fixed 24.8 (32-bit) then to avoid overflows you
> need to remember to always work with 64-bit numbers. And of course,
> you need to shift in the end to get to your whole numbers. OK, yes
> there's a performance advantage in doing lots of ops with ints
> instead of floats, but not as great as it used to be. Can anyone cite
> a specific case for input where sub-pixel precision is important?...
Sub-pixel precision is important for two cases:
For relative motion events it's flat out necessary - otherwise, it's
possible to move the mouse at a slow but reasonable speed without
generating any non-zero input events.
For absolute events it's necessary if you're doing any sort of
transformation.
Hm. I was suggesting fixed point in part because that's what we get out
of libinput, but it seems that libinput switched to double since I last
looked at it.
Since float will still give us 8bits of subpixel precision all the way
out to 65,000x65,000 pixel outputs that might be enough. The reasons
why we might want doubles include: that's what we get from libinput,
and it gives nested servers some headroom.
If we need to we can double later.
Chris Halse Rogers (raof) wrote : | # |
Hm. Rather than “ticks” I think it would be better to describe the scroll axes as measured in pixels. The other axes are measured in pixels, and pixels are a useful unit for scrolling.
Otherwise, ok.
Daniel van Vugt (vanvugt) wrote : | # |
Alright, I trust all confusion will be resolved later. When we finish designing the client API ;)
Andreas Pokorny (andreas-pokorny) : | # |
FAILED: Continuous integration, rev:2194 jenkins. qa.ubuntu. com/job/ mir-ci/ 2574/ jenkins. qa.ubuntu. com/job/ mir-android- vivid-i386- build/739 jenkins. qa.ubuntu. com/job/ mir-clang- vivid-amd64- build/739/ console jenkins. qa.ubuntu. com/job/ mir-mediumtests -vivid- touch/704/ console jenkins. qa.ubuntu. com/job/ mir-vivid- amd64-ci/ 571/console jenkins. qa.ubuntu. com/job/ mir-mediumtests -builder- vivid-armhf/ 704/console
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/mir- ci/2574/ rebuild
http://