Merge lp:~popey/ubuntu-terminal-app/add-control into lp:~ubuntu-terminal-dev/ubuntu-terminal-app/reboot

Status: Needs review
Proposed branch: lp:~popey/ubuntu-terminal-app/add-control
Merge into: lp:~ubuntu-terminal-dev/ubuntu-terminal-app/reboot
Diff against target: 306 lines (+68/-7)
14 files modified
AUTHORS (+1/-0)
po/com.ubuntu.terminal.pot (+4/-4)
src/app/qml/KeyboardBar.qml (+4/-0)
src/app/qml/KeyboardRows/KeyboardLayout.qml (+6/-0)
src/app/qml/KeyboardRows/KeyboardRow.qml (+1/-0)
src/app/qml/KeyboardRows/Layouts/ControlKeys.json (+7/-0)
src/app/qml/KeyboardRows/Layouts/FunctionKeys.json (+7/-0)
src/app/qml/KeyboardRows/jsonParser.js (+12/-2)
src/app/qml/TerminalPage.qml (+1/-0)
src/plugin/qmltermwidget/lib/Emulation.cpp (+7/-1)
src/plugin/qmltermwidget/lib/Emulation.h (+3/-0)
src/plugin/qmltermwidget/lib/Vt102Emulation.cpp (+8/-0)
src/plugin/qmltermwidget/src/ksession.cpp (+6/-0)
src/plugin/qmltermwidget/src/ksession.h (+1/-0)
To merge this branch: bzr merge lp:~popey/ubuntu-terminal-app/add-control
Reviewer Review Type Date Requested Status
Stefano Verzegnassi Needs Fixing
Niklas Wenzel (community) Needs Fixing
Evan McIntire Needs Fixing
Victor Thompson (community) Needs Information
Jenkins Bot continuous-integration Needs Fixing
Review via email: mp+282280@code.launchpad.net

Commit message

Adds a toggle-able general purpose control key to the functions keys overlay.

Description of the change

Adds a toggle-able general purpose control key to the functions keys overlay.

To post a comment you must log in.
147. By Alan Pope 🍺🐧🐱 πŸ¦„

Add author of control key patch

Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :

FAILED: Continuous integration, rev:147
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/~popey/ubuntu-terminal-app/add-control/+merge/282280/+edit-commit-message

https://core-apps-jenkins.ubuntu.com/job/run-ap-tests-ci/87/
Executed test runs:
    None: https://core-apps-jenkins.ubuntu.com/job/generic-update-mp/353/console

Click here to trigger a rebuild:
https://core-apps-jenkins.ubuntu.com/job/run-ap-tests-ci/87/rebuild

review: Needs Fixing (continuous-integration)
148. By Alan Pope 🍺🐧🐱 πŸ¦„

Add control key to more layouts

Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :

FAILED: Continuous integration, rev:148
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/~popey/ubuntu-terminal-app/add-control/+merge/282280/+edit-commit-message

https://core-apps-jenkins.ubuntu.com/job/run-ap-tests-ci/88/
Executed test runs:
    None: https://core-apps-jenkins.ubuntu.com/job/generic-update-mp/354/console

Click here to trigger a rebuild:
https://core-apps-jenkins.ubuntu.com/job/run-ap-tests-ci/88/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Evan McIntire (mcintire-evan) wrote :

I was asked in IRC to look over this, and it does all look good to me, and it does work as intended (as far as I can tell from my testing)

review: Approve
Revision history for this message
Victor Thompson (vthompson) wrote :

I'm not sure this "toggleable" key is as usable as it should be. So far as I can tell the other keys are more or less complete actions. Since just executing "CTRL" is a partial action, maybe it should stay highlighted until another key is selected?

Also, why wasn't this added to the control keys? Is there some use case I'm not aware of?

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

Actually, changing my review based on what Victor said, there should be some sort of visible indicator that CTRL is toggled, it might be confusing otherwise

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

Thank you for looking into this, Alan! :)

I haven't looked at the code myself yet, but please change the commit message to something that you would want to see in the bazaar history. "Adding commit message as required by fussy jenkins bot" probably won't tell you two years down the road what you implemented in this MP. ;)

The text you put into the description looks fine for me for example. ;)

Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

I agree that it should be in the CTRL bar too, and that it should be clear it's toggled on.

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

I just skimmed through the code and one thing I noticed is that we would probably want the CTRL key to be translatable, so please remove the "text" attributes from the keyboard layouts and use the "id" attribute instead. Furthermore, I'm not sure whether we would want to set the "modifier" attribute. That is used to turn the press of one exact button to be modifier + key and that probably isn't needed here.

(Just to be clear: I haven't reviewed the whole code yet.)

review: Needs Fixing
Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

To be clear, this patch was originally created by @bartbes who asked me to manage the bzr mangling for him.

Neither of us is currently skilled enough in qml to implement the ctrl lock right now. Hints / tips / forks welcome :)

Revision history for this message
Bart van Strien (bartbes) wrote :

Let me preface this by saying I'm the original author of the patch:

I definitely agree it should be highlighted or something similar to indicate it's active. As the patch might show, this was my first foray into QML, and.. I simply wouldn't know how to even implement that.

As for the translation, once again, I blame my lack of experience. I did try, but I couldn't quite figure out how to get it to pass the validation code if there wasn't a text attribute.

Lastly, I'd like to draw your attention to Vt102Emulation.cpp, where at the moment it only supports adding the Control modifier. Perhaps it would make sense to expand this to alt and/or shift too?

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

Hi Bart,

In my opinion the patch looks way better than a lot of first-time QML patches. Congrats on that!
Regarding your questions: I guess we can give you a helping hand here. ;)

I'll try to answer the translation question right now.

Translations are handled by JsonTranslator.qml. It contains a getTranslatedNamyById() method which is already capable of translating the string "CTRL". You can find an example call to that method in line 84 of KeyboardLayout.qml. You only need to tell it that you are trying to translate a modifier (arg #1) and then pass the modifier string from the json file (arg #2) and it will provide you with the translated string.

To become more specific, I would suggest to modify the json file to contain the following code:

"main_action" : {
    "type": "modifier",
    "mod": "Control"
}

(The shorter form "mod" to keep it in line with the rest of the syntax if it doesn't break anything else.)

Then add another case to the createKeyText() method of KeyboardLayout.qml to enable translations of modifier keys and use that method in createNextModifierActionString() to determine the text of the action.

That should do the trick. ;)

By the way, while we're at it, would you mind adjusting the error message in line 36 of jsonParser.js to include the new modifier keyword? :)

If you have any further questions, feel free to ask. I agree that the highlighting thing is not easy and it will require some time for me to look into it as well. I'll try to do that when I have some spare time but maybe someone else is capable of doing that earlier.

Thanks again for the great patch!

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

Niklas asked me to have a look at this review, since he'll be away for a few days.

> Let me preface this by saying I'm the original author
> of the patch:

I love this merge proposal, so thank you very much! :D

> I definitely agree it should be highlighted or something similar
> to indicate it's active. As the patch might show, this was my
> first foray into QML, and.. I simply wouldn't know how to even
> implement that.

I would never say this was your first iteration with QML. Code looks good, well done!.

Given the fact we necessarily have to deal with our keyboard bar, I'd say we need to add a Q_PROPERTY in KSession, which expose a Qt::KeyboardModifiers QFlags[1], instead of adding an "addNextModifiers" slot.
That property should have a getter, a setter and a signal.

I have to admit that I don't really like it as solution, but I can't see any other solid solution for providing a CTRL switch in the terminal-app GUI, unless we rewrite a new OSK keyboard - but we can't.

Anyway, at that point we should be able to check if the button needs to be highlighted or not. But then we would have another problem. :/

Currently "KeyboardButton.qml" requires to specify an Ubuntu.Components.Action (which is automatically generated by "KeyboardLayout.qml").
But UCAction has no useful property for binding the currently active keyboard modifier[2].

Fortunately that could be done by adding a property during the UCAction creation:
e.g. http://paste.ubuntu.com/15019832/

Then we should be finally able to update "KeyboardButton.qml" so that it can read the value of the property if it's defined.

I'd like to know what Niklas thinks of this.

> As for the translation, once again, I blame my lack of experience.
> I did try, but I couldn't quite figure out how to get it to pass
> the validation code if there wasn't a text attribute.

I guess Niklas already answered on this.

> Lastly, I'd like to draw your attention to Vt102Emulation.cpp,
> where at the moment it only supports adding the Control
> modifier. Perhaps it would make sense to expand this to alt
> and/or shift too?

I would say that we can add all the modifiers, since they all seem to be supported according to the comments in the file you mentioned.

PS: Sorry for the long comment. :)

======

[1] http://doc.qt.io/qt-4.8/qt.html#KeyboardModifier-enum
[2] QtQuick.Controls does it instead, see the "checked" property
    ref. http://doc.qt.io/qt-5/qml-qtquick-controls-action.html

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

@Alan, any progress on this? Does it make sense to change the ownership of this branch, so that the team can finish the QML implementation?

Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

Sorry, no. If you (or someone else) has some time to look at it and either use or re-work it, that would be great.

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

@Stefano: If that is what works, it is what works. ;)
I don't think there is an ideal solution here, but this is what I also came to my mind when I initially had a look at the issue. So I would support that.

Anyway, the reason why we haven't got any reply might be that Bart doesn't see when a new reply is posted. He hasn't subscribed to the branch and only people who do a non-"Comment only" review are subscribed automatically to an MP. It would be great if someone could drop him an email regarding this. :)

Unmerged revisions

148. By Alan Pope 🍺🐧🐱 πŸ¦„

Add control key to more layouts

147. By Alan Pope 🍺🐧🐱 πŸ¦„

Add author of control key patch

146. By Alan Pope 🍺🐧🐱 πŸ¦„

Add toggleable control key

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'AUTHORS'
--- AUTHORS 2015-07-06 16:02:18 +0000
+++ AUTHORS 2016-01-12 10:43:25 +0000
@@ -10,3 +10,4 @@
10Michael Terry <michael.terry@canonical.com>10Michael Terry <michael.terry@canonical.com>
11Niklas Wenzel <nikwen.developer@gmail.com>11Niklas Wenzel <nikwen.developer@gmail.com>
12Timo Jyrinki <timo.jyrinki@canonical.com>12Timo Jyrinki <timo.jyrinki@canonical.com>
13Bart van Strien <bart.bes@gmail.com>
1314
=== modified file 'po/com.ubuntu.terminal.pot'
--- po/com.ubuntu.terminal.pot 2015-08-09 14:03:25 +0000
+++ po/com.ubuntu.terminal.pot 2016-01-12 10:43:25 +0000
@@ -8,7 +8,7 @@
8msgstr ""8msgstr ""
9"Project-Id-Version: \n"9"Project-Id-Version: \n"
10"Report-Msgid-Bugs-To: \n"10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2015-08-09 16:01+0200\n"11"POT-Creation-Date: 2016-01-10 19:21+0100\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"14"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -53,7 +53,7 @@
53msgid "Authentication failed"53msgid "Authentication failed"
54msgstr ""54msgstr ""
5555
56#: ../src/app/qml/KeyboardBar.qml:17456#: ../src/app/qml/KeyboardBar.qml:178
57msgid "Change Keyboard"57msgid "Change Keyboard"
58msgstr ""58msgstr ""
5959
@@ -177,7 +177,7 @@
177msgid "New tab"177msgid "New tab"
178msgstr ""178msgstr ""
179179
180#: ../src/app/qml/TerminalPage.qml:164180#: ../src/app/qml/TerminalPage.qml:165
181msgid "Selection Mode"181msgid "Selection Mode"
182msgstr ""182msgstr ""
183183
@@ -214,7 +214,7 @@
214msgstr ""214msgstr ""
215215
216#: ../src/plugin/konsole/Vt102Emulation.cpp:961216#: ../src/plugin/konsole/Vt102Emulation.cpp:961
217#: ../src/plugin/qmltermwidget/lib/Vt102Emulation.cpp:977217#: ../src/plugin/qmltermwidget/lib/Vt102Emulation.cpp:985
218msgid ""218msgid ""
219"No keyboard translator available. The information needed to convert key "219"No keyboard translator available. The information needed to convert key "
220"presses into characters to send to the terminal is missing."220"presses into characters to send to the terminal is missing."
221221
=== modified file 'src/app/qml/KeyboardBar.qml'
--- src/app/qml/KeyboardBar.qml 2015-07-13 20:25:21 +0000
+++ src/app/qml/KeyboardBar.qml 2016-01-12 10:43:25 +0000
@@ -12,6 +12,7 @@
1212
13 signal simulateCommand(string command);13 signal simulateCommand(string command);
14 signal simulateKey(int key, int mod);14 signal simulateKey(int key, int mod);
15 signal simulateModifier(int modifiers);
1516
16 ListModel {17 ListModel {
17 id: layoutsList18 id: layoutsList
@@ -56,6 +57,7 @@
56 layoutObject.z = rootItem.z;57 layoutObject.z = rootItem.z;
57 layoutObject.simulateKey.disconnect(simulateKey);58 layoutObject.simulateKey.disconnect(simulateKey);
58 layoutObject.simulateCommand.disconnect(simulateCommand);59 layoutObject.simulateCommand.disconnect(simulateCommand);
60 layoutObject.simulateModifier.disconnect(simulateModifier);
59 }61 }
6062
61 function enableLayout(index) {63 function enableLayout(index) {
@@ -68,6 +70,7 @@
68 layoutObject.z = rootItem.z + 0.01;70 layoutObject.z = rootItem.z + 0.01;
69 layoutObject.simulateKey.connect(simulateKey);71 layoutObject.simulateKey.connect(simulateKey);
70 layoutObject.simulateCommand.connect(simulateCommand);72 layoutObject.simulateCommand.connect(simulateCommand);
73 layoutObject.simulateModifier.connect(simulateModifier);
71 }74 }
7275
73 function isIndexLayoutValid(index) {76 function isIndexLayoutValid(index) {
@@ -161,6 +164,7 @@
161164
162 onSimulateKey: pressFeedbackEffect.start();165 onSimulateKey: pressFeedbackEffect.start();
163 onSimulateCommand: pressFeedbackEffect.start();166 onSimulateCommand: pressFeedbackEffect.start();
167 onSimulateModifier: pressFeedbackEffect.start();
164168
165 Item {169 Item {
166 id: keyboardContainer170 id: keyboardContainer
167171
=== modified file 'src/app/qml/KeyboardRows/KeyboardLayout.qml'
--- src/app/qml/KeyboardRows/KeyboardLayout.qml 2015-08-09 14:25:36 +0000
+++ src/app/qml/KeyboardRows/KeyboardLayout.qml 2016-01-12 10:43:25 +0000
@@ -28,6 +28,8 @@
28 return createKeyActionString(action.key, action.mod, action.text, action.id);28 return createKeyActionString(action.key, action.mod, action.text, action.id);
29 case "string":29 case "string":
30 return createStringActionString(action.string, action.text);30 return createStringActionString(action.string, action.text);
31 case "modifier":
32 return createNextModifierActionString(action.modifier);
31 }33 }
32 }34 }
3335
@@ -56,6 +58,10 @@
56 return "Action { " + textString + " onTriggered: simulateCommand(\"" + string + "\"); }";58 return "Action { " + textString + " onTriggered: simulateCommand(\"" + string + "\"); }";
57 }59 }
5860
61 function createNextModifierActionString(modifier) {
62 return "Action { text: \"" + modifier + "\"; onTriggered: simulateModifier(Qt." + modifier + "Modifier); }";
63 }
64
59 function createEntryString(text, actionString, otherActionsString) {65 function createEntryString(text, actionString, otherActionsString) {
60 var objectString = "66 var objectString = "
61 import QtQuick 2.467 import QtQuick 2.4
6268
=== modified file 'src/app/qml/KeyboardRows/KeyboardRow.qml'
--- src/app/qml/KeyboardRows/KeyboardRow.qml 2015-07-13 20:25:21 +0000
+++ src/app/qml/KeyboardRows/KeyboardRow.qml 2016-01-12 10:43:25 +0000
@@ -14,6 +14,7 @@
14 // External signals.14 // External signals.
15 signal simulateKey(int key, int mod);15 signal simulateKey(int key, int mod);
16 signal simulateCommand(string command);16 signal simulateCommand(string command);
17 signal simulateModifier(int modifiers);
1718
18 // Internal variables19 // Internal variables
19 property int _firstVisibleIndex: gridView.contentX / keyWidth20 property int _firstVisibleIndex: gridView.contentX / keyWidth
2021
=== modified file 'src/app/qml/KeyboardRows/Layouts/ControlKeys.json'
--- src/app/qml/KeyboardRows/Layouts/ControlKeys.json 2015-07-10 14:34:00 +0000
+++ src/app/qml/KeyboardRows/Layouts/ControlKeys.json 2016-01-12 10:43:25 +0000
@@ -4,6 +4,13 @@
4 "buttons": [4 "buttons": [
5 {5 {
6 "main_action" : {6 "main_action" : {
7 "type": "modifier",
8 "modifier": "Control",
9 "text": "CTRL"
10 }
11 },
12 {
13 "main_action" : {
7 "type": "key",14 "type": "key",
8 "key" : "R",15 "key" : "R",
9 "mod" : "Control"16 "mod" : "Control"
1017
=== modified file 'src/app/qml/KeyboardRows/Layouts/FunctionKeys.json'
--- src/app/qml/KeyboardRows/Layouts/FunctionKeys.json 2015-07-10 14:34:00 +0000
+++ src/app/qml/KeyboardRows/Layouts/FunctionKeys.json 2016-01-12 10:43:25 +0000
@@ -11,6 +11,13 @@
11 },11 },
12 {12 {
13 "main_action" : {13 "main_action" : {
14 "type": "modifier",
15 "modifier": "Control",
16 "text": "CTRL"
17 }
18 },
19 {
20 "main_action" : {
14 "type": "key",21 "type": "key",
15 "key" : "F1"22 "key" : "F1"
16 }23 }
1724
=== modified file 'src/app/qml/KeyboardRows/jsonParser.js'
--- src/app/qml/KeyboardRows/jsonParser.js 2015-07-13 17:36:57 +0000
+++ src/app/qml/KeyboardRows/jsonParser.js 2016-01-12 10:43:25 +0000
@@ -22,12 +22,19 @@
22 raiseException("string is missing in", stringObject);22 raiseException("string is missing in", stringObject);
23}23}
2424
25function validateModifierAction(modifierObject) {
26 if (!modifierObject.modifier)
27 return raiseException("modifier is missing");
28 if (!isAllowed(modifierObject.modifier, ["Control", "Shift", "Alt"]))
29 return raiseException("modifier is invalid in", modifierObject);
30}
31
25function validateAction(actionObject) {32function validateAction(actionObject) {
26 if (!actionObject.type)33 if (!actionObject.type)
27 raiseException("type is missing in", actionObject);34 raiseException("type is missing in", actionObject);
28 if (!isAllowed(actionObject.type, ["key", "string"]))35 if (!isAllowed(actionObject.type, ["key", "string", "modifier"]))
29 raiseException("type must be either key or string in", actionObject);36 raiseException("type must be either key or string in", actionObject);
30 if (!(actionObject.type === "key" ? actionObject.key : actionObject.string))37 if (!actionObject[actionObject.type])
31 raiseException(actionObject.type + " is missing in", actionObject);38 raiseException(actionObject.type + " is missing in", actionObject);
32 if (actionObject.id && actionObject.text)39 if (actionObject.id && actionObject.text)
33 raiseException("Should not define id and text together in", actionObject);40 raiseException("Should not define id and text together in", actionObject);
@@ -45,6 +52,9 @@
45 case "string":52 case "string":
46 validateStringAction(actionObject);53 validateStringAction(actionObject);
47 break;54 break;
55 case "modifier":
56 validateModifierAction(actionObject);
57 break;
48 }58 }
49}59}
5060
5161
=== modified file 'src/app/qml/TerminalPage.qml'
--- src/app/qml/TerminalPage.qml 2015-07-13 20:25:21 +0000
+++ src/app/qml/TerminalPage.qml 2016-01-12 10:43:25 +0000
@@ -140,6 +140,7 @@
140 height: units.gu(5)140 height: units.gu(5)
141 onSimulateKey: terminal.simulateKeyPress(key, mod, true, 0, "");141 onSimulateKey: terminal.simulateKeyPress(key, mod, true, 0, "");
142 onSimulateCommand: terminal.session.sendText(command);142 onSimulateCommand: terminal.session.sendText(command);
143 onSimulateModifier: terminal.session.addNextModifiers(modifiers);
143 }144 }
144 }145 }
145146
146147
=== modified file 'src/plugin/qmltermwidget/lib/Emulation.cpp'
--- src/plugin/qmltermwidget/lib/Emulation.cpp 2014-11-12 00:10:12 +0000
+++ src/plugin/qmltermwidget/lib/Emulation.cpp 2016-01-12 10:43:25 +0000
@@ -55,7 +55,8 @@
55 _codec(0),55 _codec(0),
56 _decoder(0),56 _decoder(0),
57 _keyTranslator(0),57 _keyTranslator(0),
58 _usesMouse(false)58 _usesMouse(false),
59 _nextModifiers(0)
59{60{
60 // create screens with a default size61 // create screens with a default size
61 _screen[0] = new Screen(40,80);62 _screen[0] = new Screen(40,80);
@@ -359,6 +360,11 @@
359 return QSize(_currentScreen->getColumns(), _currentScreen->getLines());360 return QSize(_currentScreen->getColumns(), _currentScreen->getLines());
360}361}
361362
363void Emulation::addNextModifiers(int modifiers)
364{
365 _nextModifiers ^= modifiers;
366}
367
362ushort ExtendedCharTable::extendedCharHash(ushort* unicodePoints , ushort length) const368ushort ExtendedCharTable::extendedCharHash(ushort* unicodePoints , ushort length) const
363{369{
364 ushort hash = 0;370 ushort hash = 0;
365371
=== modified file 'src/plugin/qmltermwidget/lib/Emulation.h'
--- src/plugin/qmltermwidget/lib/Emulation.h 2014-11-12 00:10:12 +0000
+++ src/plugin/qmltermwidget/lib/Emulation.h 2016-01-12 10:43:25 +0000
@@ -218,6 +218,8 @@
218 */218 */
219 bool programUsesMouse() const;219 bool programUsesMouse() const;
220220
221 void addNextModifiers(int modifiers);
222
221public slots: 223public slots:
222224
223 /** Change the size of the emulation's image */225 /** Change the size of the emulation's image */
@@ -442,6 +444,7 @@
442 const QTextCodec* _codec;444 const QTextCodec* _codec;
443 QTextDecoder* _decoder;445 QTextDecoder* _decoder;
444 const KeyboardTranslator* _keyTranslator; // the keyboard layout446 const KeyboardTranslator* _keyTranslator; // the keyboard layout
447 int _nextModifiers;
445448
446protected slots:449protected slots:
447 /** 450 /**
448451
=== modified file 'src/plugin/qmltermwidget/lib/Vt102Emulation.cpp'
--- src/plugin/qmltermwidget/lib/Vt102Emulation.cpp 2014-11-12 00:10:12 +0000
+++ src/plugin/qmltermwidget/lib/Vt102Emulation.cpp 2016-01-12 10:43:25 +0000
@@ -968,6 +968,14 @@
968 textToSend += _codec->fromUnicode(event->text());968 textToSend += _codec->fromUnicode(event->text());
969 }969 }
970970
971 if (textToSend.length() == 1 && _nextModifiers)
972 {
973 char first = textToSend[0];
974 if ((_nextModifiers & Qt::ControlModifier) && first >= 0x4f && first < 0x7f)
975 textToSend[0] = first & 0x1f;
976 _nextModifiers = 0;
977 }
978
971 sendData( textToSend.constData() , textToSend.length() );979 sendData( textToSend.constData() , textToSend.length() );
972 }980 }
973 else981 else
974982
=== modified file 'src/plugin/qmltermwidget/src/ksession.cpp'
--- src/plugin/qmltermwidget/src/ksession.cpp 2014-11-12 00:10:12 +0000
+++ src/plugin/qmltermwidget/src/ksession.cpp 2016-01-12 10:43:25 +0000
@@ -22,6 +22,7 @@
2222
23// Own23// Own
24#include "ksession.h"24#include "ksession.h"
25#include "Emulation.h"
2526
26// Qt27// Qt
27#include <QTextCodec>28#include <QTextCodec>
@@ -211,6 +212,11 @@
211// }212// }
212}213}
213214
215void KSession::addNextModifiers(int modifiers)
216{
217 m_session->emulation()->addNextModifiers(modifiers);
218}
219
214void KSession::setFlowControlEnabled(bool enabled)220void KSession::setFlowControlEnabled(bool enabled)
215{221{
216 m_session->setFlowControlEnabled(enabled);222 m_session->setFlowControlEnabled(enabled);
217223
=== modified file 'src/plugin/qmltermwidget/src/ksession.h'
--- src/plugin/qmltermwidget/src/ksession.h 2014-11-12 00:10:12 +0000
+++ src/plugin/qmltermwidget/src/ksession.h 2016-01-12 10:43:25 +0000
@@ -122,6 +122,7 @@
122 void sendText(QString text);122 void sendText(QString text);
123 // Send some text to terminal123 // Send some text to terminal
124 void sendKey(int rep, int key, int mod) const;124 void sendKey(int rep, int key, int mod) const;
125 void addNextModifiers(int modifiers);
125126
126127
127protected slots:128protected slots:

Subscribers

People subscribed via source and target branches