[Reboot] missing plain control & alt keys in overlay

Bug #1400285 reported by Alan Pope 🍺🐧🐱 πŸ¦„
68
This bug affects 15 people
Affects Status Importance Assigned to Milestone
Ubuntu Terminal App
Confirmed
High
Alan Pope 🍺🐧🐱 πŸ¦„

Bug Description

The overlay has a keyboard for "CTRL" which contains CTRL+R, C, Z & A. However we're mising plain CTRL and ALT keys to allow other keyboard shortcuts to be used.

Related branches

Revision history for this message
Filippo Scognamiglio (flscogna) wrote :

Yesterday, I tried working on this one with no success. The virtual keyboard events are routed in a different way (due to autocomplete, and other automatic facilities) so we intercept just a commit string containing the UTF8 representation with the modifiers baked in. I haven't actually found a way to force additional modifiers in this situation so, if someone has any idea I'm all ears.

Changed in ubuntu-terminal-app:
importance: Undecided → High
Revision history for this message
Niklas Wenzel (nikwen) wrote :

What's about adding another (invisible) component which is focused after pressing the universal CTRL (or ALT) key and unfocused after the next key press, so that the input is not routed to the terminal but can be combined with the CTRL (or ALT) key to one commit string just like it's done when pressing one of the predefined keys?

If for some reason that's not doable, it might be possible to capture the next keystroke which is sent to the terminal, send a backspace event to the terminal and then send the combined commit string.

What do you think?

Revision history for this message
Niklas Wenzel (nikwen) wrote :

Okay, forget about what I wrote. I think I found a way to do that while working on LP: #1401994. :)

One can add the following to the QMLTermWidget to prevent the key from being sent to the terminal widget:

Keys.onPressed: {
    if (event.key === Qt.Key_A && (event.modifiers & Qt.ControlModifier)) {
        event.accepted = true
    }
}

From the documentation:

"Setting accepted to true prevents the key event from being propagated to the item's parent."

Source: http://doc.qt.io/qt-5/qml-qtquick-keyevent.html#accepted-prop

I assigned myself but if anybody is faster than me with implementing this, feel free to assign it to you. I'll first work on the other bug and then come to this.

Changed in ubuntu-terminal-app:
assignee: nobody → Niklas Wenzel (nikwen)
Revision history for this message
Malena Vasquez (malevasquez) wrote :

This bug can still be reproduced.

Changed in ubuntu-terminal-app:
status: New → Confirmed
Revision history for this message
Myrmidon83 (myrmidon83) wrote :

This bug makes using Irssi impossible if you have more than one channel open as you need Alt to switch between channels.

Revision history for this message
Evan McIntire (mcintire-evan) wrote :

myrmidon, you can switch channels in Irssi using /window [number], though this does make that inconvenient

Also, http://bazaar.launchpad.net/~popey/ubuntu-terminal-app/add-control/revision/146 adds CTRL and makes the implementation of ALT easy too, it seems

Revision history for this message
Niklas Wenzel (nikwen) wrote :

Looks like Alan is working on this now. Reassigning it. :)

I somehow didn't find time to do this earlier ...

Changed in ubuntu-terminal-app:
assignee: Niklas Wenzel (nikwen) → Alan Pope ξƒΏ (popey)
Revision history for this message
lgd (lgd) wrote :

Incidental remark: My overlay for CTRL and so on was missing at all since about two updates of the terminal app. If somebody run into this problem and finds this report, the removing of the config file by renaming it helped:
mv /home/phablet/.config/com.ubuntu.terminal/com.ubuntu.terminal.conf /home/phablet/.config/com.ubuntu.terminal/com.ubuntu.terminal.conf-backup

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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