Mir

Mir should read default keymap from udev properties.

Bug #1570340 reported by Matthias Apitz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Canonical System Image
Confirmed
Medium
Stephen M. Webb
Mir
New
Medium
Andreas Pokorny
Ubuntu Terminal App
Confirmed
Wishlist
Unassigned
mir (Ubuntu)
New
Medium
Unassigned

Bug Description

Mir should maintain default keymaps for all physical keyboards, read from the XKBLAYOUT, XKBMODEL, XKBOPTIONS, and XKBVARIANT udev properties associated with the keyboard device.

This will make Mir servers use the system-wide configuration by default.

Original report follows:
Note: the documentation request is NOT for the on-screen-keyboard, but for external keyboards connected through bluetooth;

I have an external BT keyboard with layout UK QWERTY (see a scan of the layout here 1) which works fine with my Ubuntu mobile devices. What I in addition want to archive are the Spanish tilded chars like áéíóñ¿¡ ...

In my FreeBSD netbook I do such configuration on the X11 level with commands like this which are fired up when the desktop comes up, here as an example for the character ñ Ñ:

    # we use the Win-key to add more (esp. Spanish) letters to the keys:
    #
    xmodmap -e "keycode 0x73 = Mode_switch"
    xmodmap -e "keycode 0x39 = n N ntilde Ntilde"

i.e. the useless key "Win" is redefined as a X11-modifier key and pressing the keys Win + n together gives just ñ.

How could I do this within the Ubuntu OTA-10 terminal app or within the M10?

Revision history for this message
Stefano Verzegnassi (verzegnassi-stefano) wrote :

Hi Matthias,

I'd split your request into two parts:

1) Keyboard mapping inside ubuntu-terminal-app:
The terminal plugin we use is a fork of Konsole, which exposes an interface for mapping custom keys inside a profile.
We haven't exposed those bits to the application yet, but it's on our list of things to do.
By the way, you can manually edit <path_to_opt_terminal_app_click_pkg_folder>/lib/<arch>/QMLTermWidget/kb-layouts/default.keytab. This is not a safe procedure, and you terminal-app may stop working as expected.

Anyway, I can surely confirm this bug and mark it as "wishlist".

2) Keyboard mapping in Mir:
I know there's some keyboard mapping in QtMir, but I'm not sure there's a way to customize the keyboard behaviour, or it is applied to the whole Mir environment (i.e. does it work for GTK+ apps too?).
I'm going to mark canonical-devices-system-image as affected, so they can reply on this.

Changed in ubuntu-terminal-app:
status: New → Confirmed
importance: Undecided → Wishlist
Revision history for this message
Matthias Apitz (gubu) wrote :

Thanks for all the information; Re 1) I have added to the file 'default.keytab' (after saving a copy of the original) the following lines for a first test:

# added by <email address hidden> for Spanish tilded chars
#
key A -Alt-Shift : "a"
key A -Alt+Shift : "A"
key A +Alt-Shift : "\xc3\xa1"
key A +Alt+Shift : "\xc3\x81"

and this gives with the Alt + a key or Alt+Schift+a keys together the chars: á and Á, as expected. Of course this will not work, for example, in Mir and Gedit, because the Alt key is a Menu key there;

Revision history for this message
Matthias Apitz (gubu) wrote :

arggh, the change has no effect in other apps like Dekko, or webapp either;

Revision history for this message
Stefano Verzegnassi (verzegnassi-stefano) wrote :

Changes done in terminal-app work only for terminal-app.
If you want to apply your changes to all the applications, you need to set your custom hooks in Mir.

I gave a deeper look at this, and Mir seems to use the XKB format. You may want to have a look at this:
https://help.ubuntu.com/community/Custom%20keyboard%20layout%20definitions

However I'm not able to give you more info, since I'm not aware of how Mir works. I'd suggest you to ask about this on the mailing list, or IRC.

Changed in canonical-devices-system-image:
assignee: nobody → kevin gunn (kgunn72)
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Matthias Apitz (gubu) wrote :

Stefano, thanks for the hint re/ Mir and XKB. I have read the mentioned pages and this would be the place to modify or create a new layout. The problem is, that the layouts are in /usr/share/X11/xkb/symbols, i.e. in a read-only file system. Would it be an option to have there one sym link to, for example, /usr/share/X11/xkb/symbols/xx -> ~phablet/.config/xkb/symbols/xx to let the user define his/her own mapping? Or some other kind of hook? Ofc, this question goes more to canonical-devices-system-image. Thanks

kevin gunn (kgunn72)
Changed in mir:
assignee: nobody → Andreas Pokorny (andreas-pokorny)
importance: Undecided → Medium
Changed in canonical-devices-system-image:
assignee: kevin gunn (kgunn72) → Stephen M. Webb (bregma)
Revision history for this message
Matthias Apitz (gubu) wrote :

Stefano, re/ the terminal-app and the file default.keytab: I got working nearly all the Spanish tilded chars with the add-ons to the file as attached at the end of this comment. One problem remains: there is a key on the keyboard labeled with the '?' and '/' symbols (on a QWERTY the most right key on the second row next to a Shift key). My ideas was to produce together with Alt the char ¿ (questionmarkdown), but I do not know how this physical key is named in QT in the file qnamespace.h from where the key-names are derived. I tried

key Slash
key Question

both have no visible effect. Any idea? Thanks

new lines in 'default.keytab'

# added by <email address hidden> for Spanish tilded chars
# to be placed in:
# /userdata/system-data/opt/click.ubuntu.com/com.ubuntu.terminal/0.7.190/lib/arm-linux-gnueabihf/QMLTermWidget/kb-layouts/default.keytab
#
key A -Alt-Shift : "a"
key A -Alt+Shift : "A"
key A +Alt-Shift : "\xc3\xa1"
key A +Alt+Shift : "\xc3\x81"
#
key N -Alt-Shift : "n"
key N -Alt+Shift : "N"
key N +Alt-Shift : "\xc3\xb1"
key N +Alt+Shift : "\xc3\x91"
#
key E -Alt-Shift : "e"
key E -Alt+Shift : "E"
key E +Alt-Shift : "\xc3\xa9"
key E +Alt+Shift : "\xc3\x89"
#
key I -Alt-Shift : "i"
key I -Alt+Shift : "I"
key I +Alt-Shift : "\xc3\xad"
key I +Alt+Shift : "\xc3\x8d"
#
key U -Alt-Shift : "u"
key U -Alt+Shift : "U"
key U +Alt-Shift : "\xc3\xba"
key U +Alt+Shift : "\xc3\x9a"
#
key O -Alt-Shift : "o"
key O -Alt+Shift : "O"
key O +Alt-Shift : "\xc3\xb3"
key O +Alt+Shift : "\xc3\x93"
#
key 1 -Alt-Shift : "1"
key 1 -Alt+Shift : "!"
key 1 +Alt-Shift : "\xc2\xa1" # 'exclamationdown'
key 1 +Alt+Shift : "\xc2\xbf" # 'questiondown' but gives \x1b\x21
#
key 2 -Alt-Shift : "2"
key 2 -Alt+Shift : "\x22"
key 2 +Alt-Shift : "\xc2\xbf" # 'questiondown'
key 2 +Alt+Shift : "2" # but gives \x1b\x22

summary: - BQ E4.5 (OTA-10): documentation of keymapping
+ Mir should read default keymap from udev properties.
description: updated
Revision history for this message
Chris Halse Rogers (raof) wrote :

I've split this (again!) into two bugs:

This one, to get Mir to read the system-wide defaults (set in /etc/default/keymap, or via other udev properties) and use it as the system default.

And bug #1573405 for a system-settings method of changing the keyboard keymap and options.

Revision history for this message
Michał Sawicz (saviq) wrote :

Syncing task from Mir.

Changed in mir (Ubuntu):
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.