Mir

Merge lp://staging/~andreas-pokorny/mir/fix-1664610 into lp://staging/mir

Proposed by Andreas Pokorny
Status: Merged
Approved by: Daniel van Vugt
Approved revision: no longer in the source branch.
Merged at revision: 4041
Proposed branch: lp://staging/~andreas-pokorny/mir/fix-1664610
Merge into: lp://staging/mir
Diff against target: 392 lines (+187/-12)
12 files modified
include/client/mir_toolkit/events/input/keyboard_event.h (+12/-0)
include/test/mir/test/event_matchers.h (+12/-0)
src/capnproto/mir_event.capnp (+1/-0)
src/client/input/input_event.cpp (+5/-0)
src/client/input/xkb_mapper.cpp (+39/-7)
src/client/symbols.map (+1/-0)
src/common/events/keyboard_event.cpp (+8/-0)
src/common/symbols.map (+5/-3)
src/include/common/mir/events/keyboard_event.h (+3/-0)
src/include/common/mir/input/xkb_mapper.h (+3/-2)
tests/acceptance-tests/test_client_input.cpp (+37/-0)
tests/unit-tests/client/input/test_xkb_mapper.cpp (+61/-0)
To merge this branch: bzr merge lp://staging/~andreas-pokorny/mir/fix-1664610
Reviewer Review Type Date Requested Status
Mir CI Bot continuous-integration Approve
Daniel van Vugt Approve
Brandon Schaefer (community) Approve
Review via email: mp+317440@code.staging.launchpad.net

Commit message

mirclient: Offer a utf8 representation of the text a key press should produce (LP: #1664610)

The new client API mir_keyboard_event_key_text returns the text a key combination or key sequence generates in the current state of the keyboard.

Description of the change

To properly get the text of a key entry sequence the individual xkb key symbols do not contain enough information. The current xkb_state or xkb_compose_state is needed for that.

This change produces the key text within the XKBMapper and offers that information attached to each mir_keyboard event.

To post a comment you must log in.
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

FAILED: Continuous integration, rev:4036
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https://code.launchpad.net/~andreas-pokorny/mir/fix-1664610/+merge/317440/+edit-commit-message

https://mir-jenkins.ubuntu.com/job/mir-ci/3008/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-mir/4010
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/4096
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=vivid+overlay/4086
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial+overlay/4086
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/4086
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4037
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=clang,platform=mesa,release=zesty/4037/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4037
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=xenial+overlay/4037/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4037
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=amd64,compiler=gcc,platform=mesa,release=zesty/4037/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4037
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=cross-armhf,compiler=gcc,platform=android,release=vivid+overlay/4037/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4037
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=android,release=vivid+overlay/4037/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4037
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-mir/arch=i386,compiler=gcc,platform=mesa,release=xenial+overlay/4037/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/mir-ci/3008/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

xkb_state_key_get_utf8(...)

All uses of this dont assign a null term on the end of the buffer when it is then assigned to a std::string which depends on a null term char*.

review: Needs Fixing
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

Actually mis-read the API. It'll always be null terminated.

review: Approve
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

Cool.

But why should Mir offer this at all?

Users could just call this:
   xkb_state_key_get_utf8(state, mir_keyboard_event_scan_code(e), buffer, sizeof(buffer));
if only they knew what 'state' was...?

review: Approve
Revision history for this message
Daniel van Vugt (vanvugt) wrote :

OK, I think you answered my question in the description.

Revision history for this message
Mir CI Bot (mir-ci-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches