Skip to content

Commit

Permalink
Reworked ctrl key
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Nov 5, 2024
1 parent 5106a55 commit 1c50e6d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions qml/keys/ControlKey.qml
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,27 @@ import QtQuick.Window 2.12
import MaliitKeyboard 2.0

ActionKey {

label: "ctrl"
shifted: "ctrl"
action: "ctrl"

switchBackFromSymbols: true
overridePressArea: true

Rectangle {
anchors.margins: 8
anchors.fill: parent
color: "#888888"
radius: 8 / Screen.devicePixelRatio
opacity: panel.activeKeypadState == "CONTROL" ? 0.0 : 0.25
opacity: panel.activeKeypadState == "CONTROL" ? 0.25 : 0.0
}

Label {
anchors.centerIn: parent
font.weight: Font.Light
opacity: 0.6
font.pixelSize: parent.fontSize * 0.6
text: "ctrl"
horizontalAlignment: Text.AlignHCenter
}

Expand Down
2 changes: 1 addition & 1 deletion src/view/abstracttexteditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,7 @@ void AbstractTextEditor::sendKeySequence(const QString &action, const QKeySequen
const int key = actionSequence[i] & ~AllModifiers;
const int modifiers = actionSequence[i] & AllModifiers;
QString text("");
if (modifiers == Qt::NoModifier || modifiers == Qt::ShiftModifier) {
if (modifiers == Qt::NoModifier || modifiers == Qt::ShiftModifier || modifiers == Qt::ControlModifier) {
text = QString(key);
}
sendKeyPressAndReleaseEvents(key, static_cast<Qt::KeyboardModifiers>(modifiers), text);
Expand Down

0 comments on commit 1c50e6d

Please sign in to comment.