From 67b80787ef7ef20f17aae77fba68a931b72219f6 Mon Sep 17 00:00:00 2001 From: vojtapl Date: Fri, 6 Sep 2024 16:30:44 +0200 Subject: [PATCH 1/6] Add support for more keys --- qml/keys/CapsLockKey.qml | 57 +++++++++++++++++++++++++++++++++ qml/keys/DownKey.qml | 23 +++++++++++++ qml/keys/EndKey.qml | 23 +++++++++++++ qml/keys/EscapeKey.qml | 23 +++++++++++++ qml/keys/HomeKey.qml | 23 +++++++++++++ qml/keys/LeftKey.qml | 23 +++++++++++++ qml/keys/PageDownKey.qml | 23 +++++++++++++ qml/keys/PageUpKey.qml | 23 +++++++++++++ qml/keys/RightKey.qml | 23 +++++++++++++ qml/keys/TabKey.qml | 23 +++++++++++++ qml/keys/UpKey.qml | 23 +++++++++++++ qml/keys/qmldir | 11 +++++++ src/lib/models/key.h | 3 ++ src/view/abstracttexteditor.cpp | 20 ++++++++++-- 14 files changed, 319 insertions(+), 2 deletions(-) create mode 100644 qml/keys/CapsLockKey.qml create mode 100644 qml/keys/DownKey.qml create mode 100644 qml/keys/EndKey.qml create mode 100644 qml/keys/EscapeKey.qml create mode 100644 qml/keys/HomeKey.qml create mode 100644 qml/keys/LeftKey.qml create mode 100644 qml/keys/PageDownKey.qml create mode 100644 qml/keys/PageUpKey.qml create mode 100644 qml/keys/RightKey.qml create mode 100644 qml/keys/TabKey.qml create mode 100644 qml/keys/UpKey.qml diff --git a/qml/keys/CapsLockKey.qml b/qml/keys/CapsLockKey.qml new file mode 100644 index 00000000..fe5a3218 --- /dev/null +++ b/qml/keys/CapsLockKey.qml @@ -0,0 +1,57 @@ +/* + * Copyright 2024 Vojtěch Pluskal + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.4 + +import QtQuick.Controls 2.12 +import QtQuick.Window 2.12 +import MaliitKeyboard 2.0 + +ActionKey { + overridePressArea: true + + Rectangle { + anchors.margins: 8 + anchors.fill: parent + color: "#888888" + radius: 8 / Screen.devicePixelRatio + opacity: panel.activeKeypadState == "CAPSLOCK" ? 0.0 : 0.25 + } + + Label { + anchors.centerIn: parent + font.weight: Font.Light + opacity: 0.6 + font.pixelSize: parent.fontSize * 0.6 + text: "caps lock" + horizontalAlignment: Text.AlignHCenter + } + + MouseArea { + anchors.fill: parent + + onPressed: { + Feedback.keyPressed(); + + if (panel.activeKeypadState == "NORMAL") + panel.activeKeypadState = "CAPSLOCK"; + else if (panel.activeKeypadState == "SHIFTED") + panel.activeKeypadState = "CAPSLOCK" + else if (panel.activeKeypadState == "CAPSLOCK") + panel.activeKeypadState = "NORMAL" + } + } +} diff --git a/qml/keys/DownKey.qml b/qml/keys/DownKey.qml new file mode 100644 index 00000000..2b942b04 --- /dev/null +++ b/qml/keys/DownKey.qml @@ -0,0 +1,23 @@ +/* + * Copyright 2024 Vojtěch Pluskal + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.4 + +ActionKey { + label: "↓" + shifted: "↓" + action: "down"; +} diff --git a/qml/keys/EndKey.qml b/qml/keys/EndKey.qml new file mode 100644 index 00000000..e8c10ce5 --- /dev/null +++ b/qml/keys/EndKey.qml @@ -0,0 +1,23 @@ +/* + * Copyright 2024 Vojtěch Pluskal + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.4 + +ActionKey { + label: "end" + shifted: "end" + action: "end"; +} diff --git a/qml/keys/EscapeKey.qml b/qml/keys/EscapeKey.qml new file mode 100644 index 00000000..311c192b --- /dev/null +++ b/qml/keys/EscapeKey.qml @@ -0,0 +1,23 @@ +/* + * Copyright 2024 Vojtěch Pluskal + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.4 + +ActionKey { + label: "esc" + shifted: "esc" + action: "escape"; +} diff --git a/qml/keys/HomeKey.qml b/qml/keys/HomeKey.qml new file mode 100644 index 00000000..44288017 --- /dev/null +++ b/qml/keys/HomeKey.qml @@ -0,0 +1,23 @@ +/* + * Copyright 2024 Vojtěch Pluskal + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.4 + +ActionKey { + label: "home" + shifted: "home" + action: "home"; +} diff --git a/qml/keys/LeftKey.qml b/qml/keys/LeftKey.qml new file mode 100644 index 00000000..3140b4d2 --- /dev/null +++ b/qml/keys/LeftKey.qml @@ -0,0 +1,23 @@ +/* + * Copyright 2024 Vojtěch Pluskal + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.4 + +ActionKey { + label: "←" + shifted: "←" + action: "left"; +} diff --git a/qml/keys/PageDownKey.qml b/qml/keys/PageDownKey.qml new file mode 100644 index 00000000..4f7c665a --- /dev/null +++ b/qml/keys/PageDownKey.qml @@ -0,0 +1,23 @@ +/* + * Copyright 2024 Vojtěch Pluskal + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.4 + +ActionKey { + label: "page down" + shifted: "page down" + action: "pagedown"; +} diff --git a/qml/keys/PageUpKey.qml b/qml/keys/PageUpKey.qml new file mode 100644 index 00000000..189d44c5 --- /dev/null +++ b/qml/keys/PageUpKey.qml @@ -0,0 +1,23 @@ +/* + * Copyright 2024 Vojtěch Pluskal + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.4 + +ActionKey { + label: "page up" + shifted: "page up" + action: "pageup"; +} diff --git a/qml/keys/RightKey.qml b/qml/keys/RightKey.qml new file mode 100644 index 00000000..c1db5145 --- /dev/null +++ b/qml/keys/RightKey.qml @@ -0,0 +1,23 @@ +/* + * Copyright 2024 Vojtěch Pluskal + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.4 + +ActionKey { + label: "→" + shifted: "→" + action: "right"; +} diff --git a/qml/keys/TabKey.qml b/qml/keys/TabKey.qml new file mode 100644 index 00000000..f8fb3674 --- /dev/null +++ b/qml/keys/TabKey.qml @@ -0,0 +1,23 @@ +/* + * Copyright 2024 Vojtěch Pluskal + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.4 + +ActionKey { + label: "↹" + shifted: "↹" + action: "tab"; +} diff --git a/qml/keys/UpKey.qml b/qml/keys/UpKey.qml new file mode 100644 index 00000000..a3d683c6 --- /dev/null +++ b/qml/keys/UpKey.qml @@ -0,0 +1,23 @@ +/* + * Copyright 2024 Vojtěch Pluskal + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.4 + +ActionKey { + label: "↑" + shifted: "↑" + action: "up"; +} diff --git a/qml/keys/qmldir b/qml/keys/qmldir index 97a3beaf..83f5a39e 100644 --- a/qml/keys/qmldir +++ b/qml/keys/qmldir @@ -18,3 +18,14 @@ PressArea 1.0 PressArea.qml SpaceKey 1.0 SpaceKey.qml UrlKey 1.0 UrlKey.qml CategoryKey 1.0 CategoryKey.qml +UpKey 1.0 UpKey.qml +DownKey 1.0 DownKey.qml +LeftKey 1.0 LeftKey.qml +RightKey 1.0 RightKey.qml +EscapeKey 1.0 EscapeKey.qml +TabKey 1.0 TabKey.qml +HomeKey 1.0 HomeKey.qml +EndKey 1.0 EndKey.qml +PageUpKey 1.0 PageUpKey.qml +PageDownKey 1.0 PageDownKey.qml +CapsLockKey 1.0 CapsLockKey.qml diff --git a/src/lib/models/key.h b/src/lib/models/key.h index 5695cc1c..ae0cf832 100644 --- a/src/lib/models/key.h +++ b/src/lib/models/key.h @@ -72,6 +72,9 @@ class Key ActionRightLayout, //!< Switch to right/next language layout. ActionHome, //!< Key moves cursor to beginning of text. ActionEnd, //!< Key moves cursor to end of text. + ActionEscape, //!< Key sends Escape + ActionPageUp, //!< Key sends PageUp + ActionPageDown, //!< Key sends PageDown NumActions }; diff --git a/src/view/abstracttexteditor.cpp b/src/view/abstracttexteditor.cpp index bf7a69e1..c549d228 100644 --- a/src/view/abstracttexteditor.cpp +++ b/src/view/abstracttexteditor.cpp @@ -617,11 +617,11 @@ void AbstractTextEditor::onKeyReleased(const Key &key) case Key::ActionDown: event_key = Qt::Key_Down; break; - + case Key::ActionKeySequence: sendKeySequence(text, QKeySequence::fromString(key.commandSequence())); break; - + case Key::ActionCommand: invokeAction(text, QKeySequence::fromString(key.commandSequence())); break; @@ -642,6 +642,22 @@ void AbstractTextEditor::onKeyReleased(const Key &key) event_key = Qt::Key_End; break; + case Key::ActionEscape: + event_key = Qt::Key_Escape; + break; + + case Key::ActionPageUp: + event_key = Qt::Key_PageUp; + break; + + case Key::ActionPageDown: + event_key = Qt::Key_PageDown; + break; + + case Key::ActionTab: + event_key = Qt::Key_Tab; + break; + default: break; } From abd6da3c7741d42b9ce51056a0990a709d4b1a76 Mon Sep 17 00:00:00 2001 From: Alexander Straube Date: Fri, 25 Oct 2024 19:17:44 +0000 Subject: [PATCH 2/6] german terminal layout --- CMakeLists.txt | 1 + .../de@terminal/qml/Keyboard_de@terminal.qml | 99 +++++++++++++++++++ .../qml/Keyboard_de@terminal_email.qml | 98 ++++++++++++++++++ .../qml/Keyboard_de@terminal_url.qml | 97 ++++++++++++++++++ .../qml/Keyboard_de@terminal_url_search.qml | 98 ++++++++++++++++++ .../de@terminal/src/germanterminalplugin.h | 25 +++++ .../de@terminal/src/germanterminalplugin.json | 5 + qml/keys/languages.js | 83 ++++++++-------- qml/keys/qmldir | 1 + src/lib/logic/eventhandler.cpp | 10 ++ src/lib/models/key.h | 2 + src/view/abstracttexteditor.cpp | 8 ++ 12 files changed, 486 insertions(+), 41 deletions(-) create mode 100644 plugins/de@terminal/qml/Keyboard_de@terminal.qml create mode 100644 plugins/de@terminal/qml/Keyboard_de@terminal_email.qml create mode 100644 plugins/de@terminal/qml/Keyboard_de@terminal_url.qml create mode 100644 plugins/de@terminal/qml/Keyboard_de@terminal_url_search.qml create mode 100644 plugins/de@terminal/src/germanterminalplugin.h create mode 100644 plugins/de@terminal/src/germanterminalplugin.json diff --git a/CMakeLists.txt b/CMakeLists.txt index 3aa0516e..7ab90aa3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -285,6 +285,7 @@ language_plugin(ca catalan src/overrides.csv) language_plugin(cs czech) language_plugin(da danish src/overrides.csv) language_plugin(de german) +language_plugin(de@terminal germanterminal) language_plugin(el greek) language_plugin(en english src/overrides.csv) language_plugin(eo esperanto) diff --git a/plugins/de@terminal/qml/Keyboard_de@terminal.qml b/plugins/de@terminal/qml/Keyboard_de@terminal.qml new file mode 100644 index 00000000..ae05d2b3 --- /dev/null +++ b/plugins/de@terminal/qml/Keyboard_de@terminal.qml @@ -0,0 +1,99 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.4 + +import MaliitKeyboard 2.0 + +import keys 1.0 + +KeyPad { + anchors.fill: parent + + content: c1 + symbols: "languages/Keyboard_symbols.qml" + + Column { + id: c1 + anchors.fill: parent + spacing: 0 + + Row { + anchors.horizontalCenter: parent.horizontalCenter; + spacing: 0 + + TabKey { padding: 0 } + CharKey { label: "q"; shifted: "Q"; extended: ["1"]; extendedShifted: ["1"]; leftSide: true; } + CharKey { label: "w"; shifted: "W"; extended: ["2"]; extendedShifted: ["2"] } + CharKey { label: "e"; shifted: "E"; extended: ["3", "è", "é", "ë", "ê", "€"]; extendedShifted: ["3", "È","É", "Ë", "Ê", "€"] } + CharKey { label: "r"; shifted: "R"; extended: ["4"]; extendedShifted: ["4"] } + CharKey { label: "t"; shifted: "T"; extended: ["5", "þ"]; extendedShifted: ["5", "Þ"] } + CharKey { label: "z"; shifted: "Z"; extended: ["6"]; extendedShifted: ["6"] } + CharKey { label: "u"; shifted: "U"; extended: ["7", "ü","ù","ú","û"]; extendedShifted: ["7", "Ü","Ù","Ú","Û"] } + CharKey { label: "i"; shifted: "I"; extended: ["8", "ì","í","î","ï","ı"]; extendedShifted: ["8", "Ì","Í","Î","Ï","İ"] } + CharKey { label: "o"; shifted: "O"; extended: ["9", "ö","ò","ó","ô","õ","ø"]; extendedShifted: ["9", "Ö","Ò","Ó","Ô","Õ","Ø"] } + CharKey { label: "p"; shifted: "P"; extended: ["0"]; extendedShifted: ["0"]; rightSide: true; } + } + + Row { + anchors.horizontalCenter: parent.horizontalCenter; + spacing: 0 + + CapsLockKey { padding: 0 } + CharKey { label: "a"; shifted: "A"; extended: ["ä","à","á","ã","â","å","æ"]; extendedShifted: ["Ä","À","Â","Á","Ã","Å","Æ"] } + CharKey { label: "s"; shifted: "S"; extended: ["ß","ş","$"]; extendedShifted: ["ẞ","Ş","$"] } + CharKey { label: "d"; shifted: "D"; } + CharKey { label: "f"; shifted: "F"; } + CharKey { label: "g"; shifted: "G"; extended: ["ğ"]; extendedShifted: ["Ğ"]; } + CharKey { label: "h"; shifted: "H"; } + CharKey { label: "j"; shifted: "J"; } + CharKey { label: "k"; shifted: "K"; } + CharKey { label: "l"; shifted: "L"; extended: ["ł","£"]; extendedShifted: ["Ł","£"] } + CharKey { label: "ü"; shifted: "Ü"; rightSide: true; } + } + + Row { + anchors.horizontalCenter: parent.horizontalCenter; + spacing: 0 + + ShiftKey { padding: 0 } + CharKey { label: "y"; shifted: "Y"; extended: ["ÿ","¥"]; extendedShifted: ["Ÿ","¥"] } + CharKey { label: "x"; shifted: "X"; } + CharKey { label: "c"; shifted: "C"; extended: ["ç","¢"]; extendedShifted: ["Ç","¢"] } + CharKey { label: "v"; shifted: "V"; } + CharKey { label: "b"; shifted: "B"; } + CharKey { label: "n"; shifted: "N"; extended: ["ñ"]; extendedShifted: ["Ñ"] } + CharKey { label: "m"; shifted: "M"; } + CharKey { label: "ä"; shifted: "Ä"; } + BackspaceKey { padding: 0 } + } + + Item { + anchors.left: parent.left + anchors.right: parent.right + + height: panel.keyHeight + Device.row_margin; + + SymbolShiftKey { id: symShiftKey; anchors.left: parent.left; height: parent.height; } + LanguageKey { id: languageMenuButton; anchors.left: symShiftKey.right; height: parent.height; } + CharKey { id: commaKey; label: ","; shifted: ","; extended: ["'", "\"", ";", ":", "@", "&", "(", ")"]; extendedShifted: ["'", "\"", ";", ":", "@", "&", "(", ")"]; anchors.left: languageMenuButton.right; height: parent.height; } + SpaceKey { id: spaceKey; anchors.left: commaKey.right; anchors.right: dotKey.left; noMagnifier: true; height: parent.height; } + CharKey { id: dotKey; label: "."; shifted: "."; extended: ["?", "-", "_", "!", "+", "%","#","/"]; extendedShifted: ["?", "-", "_", "!", "+", "%","#","/"]; anchors.right: umlaut.left; height: parent.height; } + CharKey { id: umlaut; label: "ö"; shifted: "Ö"; anchors.right: enterKey.left; height: parent.height; } + ReturnKey { id: enterKey; anchors.right: parent.right; height: parent.height; } + } + } // column +} diff --git a/plugins/de@terminal/qml/Keyboard_de@terminal_email.qml b/plugins/de@terminal/qml/Keyboard_de@terminal_email.qml new file mode 100644 index 00000000..8d6a9153 --- /dev/null +++ b/plugins/de@terminal/qml/Keyboard_de@terminal_email.qml @@ -0,0 +1,98 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.4 + +import MaliitKeyboard 2.0 + +import keys 1.0 + +KeyPad { + anchors.fill: parent + + content: c1 + symbols: "languages/Keyboard_symbols.qml" + + Column { + id: c1 + anchors.fill: parent + spacing: 0 + + Row { + anchors.horizontalCenter: parent.horizontalCenter; + spacing: 0 + + CharKey { label: "q"; shifted: "Q"; extended: ["1"]; extendedShifted: ["1"]; leftSide: true; } + CharKey { label: "w"; shifted: "W"; extended: ["2"]; extendedShifted: ["2"] } + CharKey { label: "e"; shifted: "E"; extended: ["3", "è", "é", "ë", "ê", "€"]; extendedShifted: ["3", "È","É", "Ë", "Ê", "€"] } + CharKey { label: "r"; shifted: "R"; extended: ["4"]; extendedShifted: ["4"] } + CharKey { label: "t"; shifted: "T"; extended: ["5", "þ"]; extendedShifted: ["5", "Þ"] } + CharKey { label: "z"; shifted: "Z"; extended: ["6"]; extendedShifted: ["6"] } + CharKey { label: "u"; shifted: "U"; extended: ["7", "ü","ù","ú","û"]; extendedShifted: ["7", "Ü","Ù","Ú","Û"] } + CharKey { label: "i"; shifted: "I"; extended: ["8", "ì","í","î","ï","ı"]; extendedShifted: ["8", "Ì","Í","Î","Ï","İ"] } + CharKey { label: "o"; shifted: "O"; extended: ["9", "ö","ò","ó","ô","õ","ø"]; extendedShifted: ["9", "Ö","Ò","Ó","Ô","Õ","Ø"] } + CharKey { label: "p"; shifted: "P"; extended: ["0"]; extendedShifted: ["0"]; rightSide: true; } + } + + Row { + anchors.horizontalCenter: parent.horizontalCenter; + spacing: 0 + + CharKey { label: "a"; shifted: "A"; extended: ["ä","à","á","ã","â","å","æ"]; extendedShifted: ["Ä","À","Â","Á","Ã","Å","Æ"]; leftSide: true; } + CharKey { label: "s"; shifted: "S"; extended: ["ß","ş","$"]; extendedShifted: ["ẞ","Ş","$"] } + CharKey { label: "d"; shifted: "D"; } + CharKey { label: "f"; shifted: "F"; } + CharKey { label: "g"; shifted: "G"; extended: ["ğ"]; extendedShifted: ["Ğ"]; } + CharKey { label: "h"; shifted: "H"; } + CharKey { label: "j"; shifted: "J"; } + CharKey { label: "k"; shifted: "K"; } + CharKey { label: "l"; shifted: "L"; extended: ["ł","£"]; extendedShifted: ["Ł","£"] } + CharKey { label: "ü"; shifted: "Ü"; rightSide: true; } + } + + Row { + anchors.horizontalCenter: parent.horizontalCenter; + spacing: 0 + + ShiftKey { padding: 0 } + CharKey { label: "y"; shifted: "Y"; extended: ["ÿ","¥"]; extendedShifted: ["Ÿ","¥"] } + CharKey { label: "x"; shifted: "X"; } + CharKey { label: "c"; shifted: "C"; extended: ["ç","¢"]; extendedShifted: ["Ç","¢"] } + CharKey { label: "v"; shifted: "V"; } + CharKey { label: "b"; shifted: "B"; } + CharKey { label: "n"; shifted: "N"; extended: ["ñ"]; extendedShifted: ["Ñ"] } + CharKey { label: "m"; shifted: "M"; } + CharKey { label: "ä"; shifted: "Ä"; } + BackspaceKey { padding: 0 } + } + + Item { + anchors.left: parent.left + anchors.right: parent.right + + height: panel.keyHeight + Device.row_margin; + + SymbolShiftKey { id: symShiftKey; anchors.left: parent.left; height: parent.height; } + LanguageKey { id: languageMenuButton; anchors.left: symShiftKey.right; height: parent.height; } + CharKey { id: atKey; label: "@"; shifted: "@"; anchors.left: languageMenuButton.right; height: parent.height; } + SpaceKey { id: spaceKey; anchors.left: atKey.right; anchors.right: urlKey.left; noMagnifier: true; height: parent.height; } + UrlKey { id: urlKey; label: ".de"; extended: [".com", ".at", ".ch"]; anchors.right: dotKey.left; height: parent.height; } + CharKey { id: dotKey; label: "."; shifted: "."; extended: ["?", "-", "_", "!", "+", "%","#","/"]; extendedShifted: ["?", "-", "_", "!", "+", "%","#","/"]; anchors.right: umlaut.left; height: parent.height; } + CharKey { id: umlaut; label: "ö"; shifted: "Ö"; anchors.right: enterKey.left; height: parent.height; } + ReturnKey { id: enterKey; anchors.right: parent.right; height: parent.height; } + } + } // column +} diff --git a/plugins/de@terminal/qml/Keyboard_de@terminal_url.qml b/plugins/de@terminal/qml/Keyboard_de@terminal_url.qml new file mode 100644 index 00000000..e0211eac --- /dev/null +++ b/plugins/de@terminal/qml/Keyboard_de@terminal_url.qml @@ -0,0 +1,97 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.4 + +import MaliitKeyboard 2.0 + +import keys 1.0 + +KeyPad { + anchors.fill: parent + + content: c1 + symbols: "languages/Keyboard_symbols.qml" + + Column { + id: c1 + anchors.fill: parent + spacing: 0 + + Row { + anchors.horizontalCenter: parent.horizontalCenter; + spacing: 0 + + CharKey { label: "q"; shifted: "Q"; extended: ["1"]; extendedShifted: ["1"]; leftSide: true; } + CharKey { label: "w"; shifted: "W"; extended: ["2"]; extendedShifted: ["2"] } + CharKey { label: "e"; shifted: "E"; extended: ["3", "è", "é", "ë", "ê", "€"]; extendedShifted: ["3", "È","É", "Ë", "Ê", "€"] } + CharKey { label: "r"; shifted: "R"; extended: ["4"]; extendedShifted: ["4"] } + CharKey { label: "t"; shifted: "T"; extended: ["5", "þ"]; extendedShifted: ["5", "Þ"] } + CharKey { label: "z"; shifted: "Z"; extended: ["6"]; extendedShifted: ["6"] } + CharKey { label: "u"; shifted: "U"; extended: ["7", "ü","ù","ú","û"]; extendedShifted: ["7", "Ü","Ù","Ú","Û"] } + CharKey { label: "i"; shifted: "I"; extended: ["8", "ì","í","î","ï","ı"]; extendedShifted: ["8", "Ì","Í","Î","Ï","İ"] } + CharKey { label: "o"; shifted: "O"; extended: ["9", "ö","ò","ó","ô","õ","ø"]; extendedShifted: ["9", "Ö","Ò","Ó","Ô","Õ","Ø"] } + CharKey { label: "p"; shifted: "P"; extended: ["0"]; extendedShifted: ["0"]; rightSide: true; } + } + + Row { + anchors.horizontalCenter: parent.horizontalCenter; + spacing: 0 + + CharKey { label: "a"; shifted: "A"; extended: ["ä","à","á","ã","â","å","æ"]; extendedShifted: ["Ä","À","Â","Á","Ã","Å","Æ"]; leftSide: true; } + CharKey { label: "s"; shifted: "S"; extended: ["ß","ş","$"]; extendedShifted: ["ẞ","Ş","$"] } + CharKey { label: "d"; shifted: "D"; } + CharKey { label: "f"; shifted: "F"; } + CharKey { label: "g"; shifted: "G"; extended: ["ğ"]; extendedShifted: ["Ğ"]; } + CharKey { label: "h"; shifted: "H"; } + CharKey { label: "j"; shifted: "J"; } + CharKey { label: "k"; shifted: "K"; } + CharKey { label: "l"; shifted: "L"; extended: ["ł","£"]; extendedShifted: ["Ł","£"] } + CharKey { label: "ü"; shifted: "Ü"; rightSide: true; } + } + + Row { + anchors.horizontalCenter: parent.horizontalCenter; + spacing: 0 + + ShiftKey { padding: 0 } + CharKey { label: "y"; shifted: "Y"; extended: ["ÿ","¥"]; extendedShifted: ["Ÿ","¥"] } + CharKey { label: "x"; shifted: "X"; } + CharKey { label: "c"; shifted: "C"; extended: ["ç","¢"]; extendedShifted: ["Ç","¢"] } + CharKey { label: "v"; shifted: "V"; } + CharKey { label: "b"; shifted: "B"; } + CharKey { label: "n"; shifted: "N"; extended: ["ñ"]; extendedShifted: ["Ñ"] } + CharKey { label: "m"; shifted: "M"; } + CharKey { label: "ä"; shifted: "Ä"; } + BackspaceKey { padding: 0 } + } + + Item { + anchors.left: parent.left + anchors.right: parent.right + + height: panel.keyHeight + Device.row_margin; + + SymbolShiftKey { id: symShiftKey; anchors.left: parent.left; height: parent.height; } + LanguageKey { id: languageMenuButton; anchors.left: symShiftKey.right; height: parent.height; } + CharKey { id: slashKey; label: "/"; shifted: "/"; anchors.left: languageMenuButton.right; height: parent.height; } + UrlKey { id: urlKey; label: ".de"; extended: [".com", ".at", ".ch"]; anchors.right: dotKey.left; height: parent.height; } + CharKey { id: dotKey; label: "."; shifted: "."; extended: ["?", "-", "_", "!", "+", "%","#","/"]; extendedShifted: ["?", "-", "_", "!", "+", "%","#","/"]; anchors.right: umlaut.left; height: parent.height; } + CharKey { id: umlaut; label: "ö"; shifted: "Ö"; anchors.right: enterKey.left; height: parent.height; } + ReturnKey { id: enterKey; anchors.right: parent.right; height: parent.height; } + } + } // column +} diff --git a/plugins/de@terminal/qml/Keyboard_de@terminal_url_search.qml b/plugins/de@terminal/qml/Keyboard_de@terminal_url_search.qml new file mode 100644 index 00000000..f7c2672e --- /dev/null +++ b/plugins/de@terminal/qml/Keyboard_de@terminal_url_search.qml @@ -0,0 +1,98 @@ +/* + * Copyright 2013 Canonical Ltd. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.4 + +import MaliitKeyboard 2.0 + +import keys 1.0 + +KeyPad { + anchors.fill: parent + + content: c1 + symbols: "languages/Keyboard_symbols.qml" + + Column { + id: c1 + anchors.fill: parent + spacing: 0 + + Row { + anchors.horizontalCenter: parent.horizontalCenter; + spacing: 0 + + CharKey { label: "q"; shifted: "Q"; extended: ["1"]; extendedShifted: ["1"]; leftSide: true; } + CharKey { label: "w"; shifted: "W"; extended: ["2"]; extendedShifted: ["2"] } + CharKey { label: "e"; shifted: "E"; extended: ["3", "è", "é", "ë", "ê", "€"]; extendedShifted: ["3", "È","É", "Ë", "Ê", "€"] } + CharKey { label: "r"; shifted: "R"; extended: ["4"]; extendedShifted: ["4"] } + CharKey { label: "t"; shifted: "T"; extended: ["5", "þ"]; extendedShifted: ["5", "Þ"] } + CharKey { label: "z"; shifted: "Z"; extended: ["6"]; extendedShifted: ["6"] } + CharKey { label: "u"; shifted: "U"; extended: ["7", "ü","ù","ú","û"]; extendedShifted: ["7", "Ü","Ù","Ú","Û"] } + CharKey { label: "i"; shifted: "I"; extended: ["8", "ì","í","î","ï","ı"]; extendedShifted: ["8", "Ì","Í","Î","Ï","İ"] } + CharKey { label: "o"; shifted: "O"; extended: ["9", "ö","ò","ó","ô","õ","ø"]; extendedShifted: ["9", "Ö","Ò","Ó","Ô","Õ","Ø"] } + CharKey { label: "p"; shifted: "P"; extended: ["0"]; extendedShifted: ["0"]; rightSide: true; } + } + + Row { + anchors.horizontalCenter: parent.horizontalCenter; + spacing: 0 + + CharKey { label: "a"; shifted: "A"; extended: ["ä","à","á","ã","â","å","æ"]; extendedShifted: ["Ä","À","Â","Á","Ã","Å","Æ"]; leftSide: true; } + CharKey { label: "s"; shifted: "S"; extended: ["ß","ş","$"]; extendedShifted: ["ẞ","Ş","$"] } + CharKey { label: "d"; shifted: "D"; } + CharKey { label: "f"; shifted: "F"; } + CharKey { label: "g"; shifted: "G"; extended: ["ğ"]; extendedShifted: ["Ğ"]; } + CharKey { label: "h"; shifted: "H"; } + CharKey { label: "j"; shifted: "J"; } + CharKey { label: "k"; shifted: "K"; } + CharKey { label: "l"; shifted: "L"; extended: ["ł","£"]; extendedShifted: ["Ł","£"] } + CharKey { label: "ü"; shifted: "Ü"; rightSide: true; } + } + + Row { + anchors.horizontalCenter: parent.horizontalCenter; + spacing: 0 + + ShiftKey { padding: 0 } + CharKey { label: "y"; shifted: "Y"; extended: ["ÿ","¥"]; extendedShifted: ["Ÿ","¥"] } + CharKey { label: "x"; shifted: "X"; } + CharKey { label: "c"; shifted: "C"; extended: ["ç","¢"]; extendedShifted: ["Ç","¢"] } + CharKey { label: "v"; shifted: "V"; } + CharKey { label: "b"; shifted: "B"; } + CharKey { label: "n"; shifted: "N"; extended: ["ñ"]; extendedShifted: ["Ñ"] } + CharKey { label: "m"; shifted: "M"; } + CharKey { label: "ä"; shifted: "Ä"; } + BackspaceKey { padding: 0 } + } + + Item { + anchors.left: parent.left + anchors.right: parent.right + + height: panel.keyHeight + Device.row_margin; + + SymbolShiftKey { id: symShiftKey; anchors.left: parent.left; height: parent.height; } + LanguageKey { id: languageMenuButton; anchors.left: symShiftKey.right; height: parent.height; } + CharKey { id: slashKey; label: "/"; shifted: "/"; anchors.left: languageMenuButton.right; height: parent.height; } + SpaceKey { id: spaceKey; anchors.left: slashKey.right; anchors.right: urlKey.left; noMagnifier: true; height: parent.height; } + UrlKey { id: urlKey; label: ".de"; extended: [".com", ".at", ".ch"]; anchors.right: dotKey.left; height: parent.height; } + CharKey { id: dotKey; label: "."; shifted: "."; extended: ["?", "-", "_", "!", "+", "%","#","/"]; extendedShifted: ["?", "-", "_", "!", "+", "%","#","/"]; anchors.right: umlaut.left; height: parent.height; } + CharKey { id: umlaut; label: "ö"; shifted: "Ö"; anchors.right: enterKey.left; height: parent.height; } + ReturnKey { id: enterKey; anchors.right: parent.right; height: parent.height; } + } + } // column +} diff --git a/plugins/de@terminal/src/germanterminalplugin.h b/plugins/de@terminal/src/germanterminalplugin.h new file mode 100644 index 00000000..4bac9968 --- /dev/null +++ b/plugins/de@terminal/src/germanterminalplugin.h @@ -0,0 +1,25 @@ +#ifndef GERMANTERMINALPLUGIN_H +#define GERMANTERMINALPLUGIN_H + +#include +#include "languageplugininterface.h" +#include "westernlanguagesplugin.h" + +class GermanTerminalPlugin : public WesternLanguagesPlugin +{ + Q_OBJECT + Q_INTERFACES(LanguagePluginInterface) + Q_PLUGIN_METADATA(IID "io.maliit.keyboard.LanguagePlugin.1" FILE "germanterminalplugin.json") + +public: + explicit GermanTerminalPlugin(QObject* parent = 0) + : WesternLanguagesPlugin(parent) + { + } + + virtual ~GermanTerminalPlugin() + { + } +}; + +#endif // GERMANTERMINALPLUGIN_H diff --git a/plugins/de@terminal/src/germanterminalplugin.json b/plugins/de@terminal/src/germanterminalplugin.json new file mode 100644 index 00000000..258ea63b --- /dev/null +++ b/plugins/de@terminal/src/germanterminalplugin.json @@ -0,0 +1,5 @@ +{ + "IID": "io.maliit.keyboard.LanguagePlugin.1", + "LanguageId": "de@terminal", + "Language": "German (Terminal)" +} diff --git a/qml/keys/languages.js b/qml/keys/languages.js index 89fcc0cd..d45a09d7 100644 --- a/qml/keys/languages.js +++ b/qml/keys/languages.js @@ -16,47 +16,48 @@ function languageIdToName(languageId) { - if (languageId == "ar") return Gettext.qsTr("Arabic"); - if (languageId == "az") return Gettext.qsTr("Azerbaijani"); - if (languageId == "be") return Gettext.qsTr("Belarusian"); - if (languageId == "bg") return Gettext.qsTr("Bulgarian"); - if (languageId == "bs") return Gettext.qsTr("Bosnian"); - if (languageId == "ca") return Gettext.qsTr("Catalan"); - if (languageId == "cs") return Gettext.qsTr("Czech"); - if (languageId == "da") return Gettext.qsTr("Danish"); - if (languageId == "de") return Gettext.qsTr("German"); - if (languageId == "el") return Gettext.qsTr("Greek"); - if (languageId == "en") return Gettext.qsTr("English"); - if (languageId == "en@dv") return Gettext.qsTr("English\n(Dvorak)"); - if (languageId == "eo") return Gettext.qsTr("Esperanto"); - if (languageId == "es") return Gettext.qsTr("Spanish"); - if (languageId == "fa") return Gettext.qsTr("Persian"); - if (languageId == "fi") return Gettext.qsTr("Finnish"); - if (languageId == "fr") return Gettext.qsTr("French"); - if (languageId == "fr-ch") return Gettext.qsTr("French\n(Swiss)"); - if (languageId == "gd") return Gettext.qsTr("Scottish Gaelic"); - if (languageId == "he") return Gettext.qsTr("Hebrew"); - if (languageId == "hr") return Gettext.qsTr("Croatian"); - if (languageId == "hu") return Gettext.qsTr("Hungarian"); - if (languageId == "is") return Gettext.qsTr("Icelandic"); - if (languageId == "it") return Gettext.qsTr("Italian"); - if (languageId == "ja") return Gettext.qsTr("Japanese"); - if (languageId == "lt") return Gettext.qsTr("Lithuanian"); - if (languageId == "lv") return Gettext.qsTr("Latvian"); - if (languageId == "mk") return Gettext.qsTr("Macedonian"); - if (languageId == "ko") return Gettext.qsTr("Korean"); - if (languageId == "nl") return Gettext.qsTr("Dutch"); - if (languageId == "nb") return Gettext.qsTr("Norwegian"); - if (languageId == "pl") return Gettext.qsTr("Polish"); - if (languageId == "pt") return Gettext.qsTr("Portuguese"); - if (languageId == "ro") return Gettext.qsTr("Romanian"); - if (languageId == "ru") return Gettext.qsTr("Russian"); - if (languageId == "sl") return Gettext.qsTr("Slovenian"); - if (languageId == "sr") return Gettext.qsTr("Serbian"); - if (languageId == "sv") return Gettext.qsTr("Swedish"); - if (languageId == "th") return Gettext.qsTr("Thai"); - if (languageId == "tr") return Gettext.qsTr("Turkish"); - if (languageId == "uk") return Gettext.qsTr("Ukrainian"); + if (languageId == "ar") return Gettext.qsTr("Arabic"); + if (languageId == "az") return Gettext.qsTr("Azerbaijani"); + if (languageId == "be") return Gettext.qsTr("Belarusian"); + if (languageId == "bg") return Gettext.qsTr("Bulgarian"); + if (languageId == "bs") return Gettext.qsTr("Bosnian"); + if (languageId == "ca") return Gettext.qsTr("Catalan"); + if (languageId == "cs") return Gettext.qsTr("Czech"); + if (languageId == "da") return Gettext.qsTr("Danish"); + if (languageId == "de") return Gettext.qsTr("German"); + if (languageId == "de@terminal") return Gettext.qsTr("German\n(Terminal)"); + if (languageId == "el") return Gettext.qsTr("Greek"); + if (languageId == "en") return Gettext.qsTr("English"); + if (languageId == "en@dv") return Gettext.qsTr("English\n(Dvorak)"); + if (languageId == "eo") return Gettext.qsTr("Esperanto"); + if (languageId == "es") return Gettext.qsTr("Spanish"); + if (languageId == "fa") return Gettext.qsTr("Persian"); + if (languageId == "fi") return Gettext.qsTr("Finnish"); + if (languageId == "fr") return Gettext.qsTr("French"); + if (languageId == "fr-ch") return Gettext.qsTr("French\n(Swiss)"); + if (languageId == "gd") return Gettext.qsTr("Scottish Gaelic"); + if (languageId == "he") return Gettext.qsTr("Hebrew"); + if (languageId == "hr") return Gettext.qsTr("Croatian"); + if (languageId == "hu") return Gettext.qsTr("Hungarian"); + if (languageId == "is") return Gettext.qsTr("Icelandic"); + if (languageId == "it") return Gettext.qsTr("Italian"); + if (languageId == "ja") return Gettext.qsTr("Japanese"); + if (languageId == "lt") return Gettext.qsTr("Lithuanian"); + if (languageId == "lv") return Gettext.qsTr("Latvian"); + if (languageId == "mk") return Gettext.qsTr("Macedonian"); + if (languageId == "ko") return Gettext.qsTr("Korean"); + if (languageId == "nl") return Gettext.qsTr("Dutch"); + if (languageId == "nb") return Gettext.qsTr("Norwegian"); + if (languageId == "pl") return Gettext.qsTr("Polish"); + if (languageId == "pt") return Gettext.qsTr("Portuguese"); + if (languageId == "ro") return Gettext.qsTr("Romanian"); + if (languageId == "ru") return Gettext.qsTr("Russian"); + if (languageId == "sl") return Gettext.qsTr("Slovenian"); + if (languageId == "sr") return Gettext.qsTr("Serbian"); + if (languageId == "sv") return Gettext.qsTr("Swedish"); + if (languageId == "th") return Gettext.qsTr("Thai"); + if (languageId == "tr") return Gettext.qsTr("Turkish"); + if (languageId == "uk") return Gettext.qsTr("Ukrainian"); if (languageId == "zh-hans") return Gettext.qsTr("Chinese\n(Pinyin)"); if (languageId == "zh-hant") return Gettext.qsTr("Chinese\n(Chewing)"); diff --git a/qml/keys/qmldir b/qml/keys/qmldir index 83f5a39e..19701e00 100644 --- a/qml/keys/qmldir +++ b/qml/keys/qmldir @@ -29,3 +29,4 @@ EndKey 1.0 EndKey.qml PageUpKey 1.0 PageUpKey.qml PageDownKey 1.0 PageDownKey.qml CapsLockKey 1.0 CapsLockKey.qml +ControlKey 1.0 ControlKey.qml diff --git a/src/lib/logic/eventhandler.cpp b/src/lib/logic/eventhandler.cpp index 63f3a645..b6dc413e 100644 --- a/src/lib/logic/eventhandler.cpp +++ b/src/lib/logic/eventhandler.cpp @@ -101,6 +101,16 @@ void EventHandler::onKeyReleased(QString label, QString action) key.setAction(Key::ActionHome); else if (action == QLatin1String("end")) key.setAction(Key::ActionEnd); + else if (action == QLatin1String("tab")) + key.setAction(Key::ActionTab); + else if (action == QLatin1String("ctrl")) + key.setAction(Key::ActionControl); + else if (action == QLatin1String("escape")) + key.setAction(Key::ActionEscape); + else if (action == QLatin1String("pageeup")) + key.setAction(Key::ActionPageUp); + else if (action == QLatin1String("pageeup")) + key.setAction(Key::ActionPageDown); else if (action == "keysequence") { key.setCommandSequence(label); key.setAction(Key::ActionKeySequence); diff --git a/src/lib/models/key.h b/src/lib/models/key.h index ae0cf832..48229069 100644 --- a/src/lib/models/key.h +++ b/src/lib/models/key.h @@ -75,6 +75,8 @@ class Key ActionEscape, //!< Key sends Escape ActionPageUp, //!< Key sends PageUp ActionPageDown, //!< Key sends PageDown + ActionControl, //!< Key sends Control + ActionCapsLock, //!< Key sends CapsLock NumActions }; diff --git a/src/view/abstracttexteditor.cpp b/src/view/abstracttexteditor.cpp index c549d228..2153b2ed 100644 --- a/src/view/abstracttexteditor.cpp +++ b/src/view/abstracttexteditor.cpp @@ -658,6 +658,14 @@ void AbstractTextEditor::onKeyReleased(const Key &key) event_key = Qt::Key_Tab; break; + case Key::ActionControl: + event_key = Qt::Key_Control; + break; + + case Key::ActionCapsLock: + event_key = Qt::Key_CapsLock; + break; + default: break; } From 1c9f5f4e7312e533ddde968a919cabd291501dae Mon Sep 17 00:00:00 2001 From: Alexander Straube Date: Fri, 25 Oct 2024 20:13:35 +0000 Subject: [PATCH 3/6] changed layout --- .../de@terminal/qml/Keyboard_de@terminal.qml | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/plugins/de@terminal/qml/Keyboard_de@terminal.qml b/plugins/de@terminal/qml/Keyboard_de@terminal.qml index ae05d2b3..bb6a73a1 100644 --- a/plugins/de@terminal/qml/Keyboard_de@terminal.qml +++ b/plugins/de@terminal/qml/Keyboard_de@terminal.qml @@ -35,8 +35,8 @@ KeyPad { anchors.horizontalCenter: parent.horizontalCenter; spacing: 0 - TabKey { padding: 0 } - CharKey { label: "q"; shifted: "Q"; extended: ["1"]; extendedShifted: ["1"]; leftSide: true; } + EscapeKey { padding: 0 } + CharKey { label: "q"; shifted: "Q"; extended: ["1"]; extendedShifted: ["1"] } CharKey { label: "w"; shifted: "W"; extended: ["2"]; extendedShifted: ["2"] } CharKey { label: "e"; shifted: "E"; extended: ["3", "è", "é", "ë", "ê", "€"]; extendedShifted: ["3", "È","É", "Ë", "Ê", "€"] } CharKey { label: "r"; shifted: "R"; extended: ["4"]; extendedShifted: ["4"] } @@ -45,14 +45,15 @@ KeyPad { CharKey { label: "u"; shifted: "U"; extended: ["7", "ü","ù","ú","û"]; extendedShifted: ["7", "Ü","Ù","Ú","Û"] } CharKey { label: "i"; shifted: "I"; extended: ["8", "ì","í","î","ï","ı"]; extendedShifted: ["8", "Ì","Í","Î","Ï","İ"] } CharKey { label: "o"; shifted: "O"; extended: ["9", "ö","ò","ó","ô","õ","ø"]; extendedShifted: ["9", "Ö","Ò","Ó","Ô","Õ","Ø"] } - CharKey { label: "p"; shifted: "P"; extended: ["0"]; extendedShifted: ["0"]; rightSide: true; } + CharKey { label: "p"; shifted: "P"; extended: ["0"]; extendedShifted: ["0"] } + CharKey { label: "ü"; shifted: "Ü"; } } Row { anchors.horizontalCenter: parent.horizontalCenter; spacing: 0 - CapsLockKey { padding: 0 } + TabKey { padding: 0 } CharKey { label: "a"; shifted: "A"; extended: ["ä","à","á","ã","â","å","æ"]; extendedShifted: ["Ä","À","Â","Á","Ã","Å","Æ"] } CharKey { label: "s"; shifted: "S"; extended: ["ß","ş","$"]; extendedShifted: ["ẞ","Ş","$"] } CharKey { label: "d"; shifted: "D"; } @@ -62,7 +63,8 @@ KeyPad { CharKey { label: "j"; shifted: "J"; } CharKey { label: "k"; shifted: "K"; } CharKey { label: "l"; shifted: "L"; extended: ["ł","£"]; extendedShifted: ["Ł","£"] } - CharKey { label: "ü"; shifted: "Ü"; rightSide: true; } + CharKey { label: "ö"; shifted: "Ö"; } + CharKey { label: "ä"; shifted: "Ä"; } } Row { @@ -77,7 +79,8 @@ KeyPad { CharKey { label: "b"; shifted: "B"; } CharKey { label: "n"; shifted: "N"; extended: ["ñ"]; extendedShifted: ["Ñ"] } CharKey { label: "m"; shifted: "M"; } - CharKey { label: "ä"; shifted: "Ä"; } + CharKey { label: ","; shifted: ","; extended: ["'", "\"", ";", ":", "@", "&", "(", ")"]; extendedShifted: ["'", "\"", ";", ":", "@", "&", "(", ")"]; } + CharKey { label: "."; shifted: "."; extended: ["?", "-", "_", "!", "+", "%","#","/"]; extendedShifted: ["?", "-", "_", "!", "+", "%","#","/"]; } BackspaceKey { padding: 0 } } @@ -89,10 +92,7 @@ KeyPad { SymbolShiftKey { id: symShiftKey; anchors.left: parent.left; height: parent.height; } LanguageKey { id: languageMenuButton; anchors.left: symShiftKey.right; height: parent.height; } - CharKey { id: commaKey; label: ","; shifted: ","; extended: ["'", "\"", ";", ":", "@", "&", "(", ")"]; extendedShifted: ["'", "\"", ";", ":", "@", "&", "(", ")"]; anchors.left: languageMenuButton.right; height: parent.height; } - SpaceKey { id: spaceKey; anchors.left: commaKey.right; anchors.right: dotKey.left; noMagnifier: true; height: parent.height; } - CharKey { id: dotKey; label: "."; shifted: "."; extended: ["?", "-", "_", "!", "+", "%","#","/"]; extendedShifted: ["?", "-", "_", "!", "+", "%","#","/"]; anchors.right: umlaut.left; height: parent.height; } - CharKey { id: umlaut; label: "ö"; shifted: "Ö"; anchors.right: enterKey.left; height: parent.height; } + SpaceKey { id: spaceKey; anchors.left: languageMenuButton.right; anchors.right: enterKey.left; noMagnifier: true; height: parent.height; } ReturnKey { id: enterKey; anchors.right: parent.right; height: parent.height; } } } // column From 4f9eca31ed1b75b2378225c21742fcd45d225804 Mon Sep 17 00:00:00 2001 From: Alexander Straube Date: Fri, 25 Oct 2024 20:35:31 +0000 Subject: [PATCH 4/6] changed layout --- .../de@terminal/qml/Keyboard_de@terminal.qml | 12 ++++++---- qml/keys/ControlKey.qml | 23 +++++++++++++++++++ 2 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 qml/keys/ControlKey.qml diff --git a/plugins/de@terminal/qml/Keyboard_de@terminal.qml b/plugins/de@terminal/qml/Keyboard_de@terminal.qml index bb6a73a1..0a22bf11 100644 --- a/plugins/de@terminal/qml/Keyboard_de@terminal.qml +++ b/plugins/de@terminal/qml/Keyboard_de@terminal.qml @@ -80,7 +80,8 @@ KeyPad { CharKey { label: "n"; shifted: "N"; extended: ["ñ"]; extendedShifted: ["Ñ"] } CharKey { label: "m"; shifted: "M"; } CharKey { label: ","; shifted: ","; extended: ["'", "\"", ";", ":", "@", "&", "(", ")"]; extendedShifted: ["'", "\"", ";", ":", "@", "&", "(", ")"]; } - CharKey { label: "."; shifted: "."; extended: ["?", "-", "_", "!", "+", "%","#","/"]; extendedShifted: ["?", "-", "_", "!", "+", "%","#","/"]; } + CharKey { label: "."; shifted: "."; extended: ["?", "-", "_", "!", "+", "%","#","/"]; extendedShifted: ["?", "-", "_", "!", "+", "%","#","/"]; } + CharKey { label: "-"; shifted: "-"; extended: ["_"]; extendedShifted: ["_"]; } BackspaceKey { padding: 0 } } @@ -90,10 +91,11 @@ KeyPad { height: panel.keyHeight + Device.row_margin; - SymbolShiftKey { id: symShiftKey; anchors.left: parent.left; height: parent.height; } - LanguageKey { id: languageMenuButton; anchors.left: symShiftKey.right; height: parent.height; } - SpaceKey { id: spaceKey; anchors.left: languageMenuButton.right; anchors.right: enterKey.left; noMagnifier: true; height: parent.height; } - ReturnKey { id: enterKey; anchors.right: parent.right; height: parent.height; } + ControlKey { id: controlKey; label: "strg"; shifted: "ctrl"; anchors.left: parent.left; height: parent.height; } + SymbolShiftKey { id: symShiftKey; anchors.left: controlKey.right; height: parent.height; } + LanguageKey { id: languageMenuButton; anchors.left: symShiftKey.right; height: parent.height; } + SpaceKey { id: spaceKey; anchors.left: languageMenuButton.right; anchors.right: enterKey.left; noMagnifier: true; height: parent.height; } + ReturnKey { id: enterKey; anchors.right: parent.right; height: parent.height; } } } // column } diff --git a/qml/keys/ControlKey.qml b/qml/keys/ControlKey.qml new file mode 100644 index 00000000..c91c30ee --- /dev/null +++ b/qml/keys/ControlKey.qml @@ -0,0 +1,23 @@ +/* + * Copyright 2024 Vojtěch Pluskal + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation; version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +import QtQuick 2.4 + +ActionKey { + label: "ctrl" + shifted: "ctrl" + action: "ctrl"; +} From 98543537340ab628b01a1eac99ec6183d9a5afbb Mon Sep 17 00:00:00 2001 From: Alexander Straube Date: Tue, 5 Nov 2024 20:07:10 +0100 Subject: [PATCH 5/6] Reworked ctrl key --- .../de@terminal/qml/Keyboard_de@terminal.qml | 2 +- qml/keys/ControlKey.qml | 35 ++++++++++++++++++- src/view/abstracttexteditor.cpp | 2 +- 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/plugins/de@terminal/qml/Keyboard_de@terminal.qml b/plugins/de@terminal/qml/Keyboard_de@terminal.qml index 0a22bf11..1b2346e5 100644 --- a/plugins/de@terminal/qml/Keyboard_de@terminal.qml +++ b/plugins/de@terminal/qml/Keyboard_de@terminal.qml @@ -91,7 +91,7 @@ KeyPad { height: panel.keyHeight + Device.row_margin; - ControlKey { id: controlKey; label: "strg"; shifted: "ctrl"; anchors.left: parent.left; height: parent.height; } + ControlKey { id: controlKey; label: "strg"; shifted: "strg"; anchors.left: parent.left; height: parent.height; } SymbolShiftKey { id: symShiftKey; anchors.left: controlKey.right; height: parent.height; } LanguageKey { id: languageMenuButton; anchors.left: symShiftKey.right; height: parent.height; } SpaceKey { id: spaceKey; anchors.left: languageMenuButton.right; anchors.right: enterKey.left; noMagnifier: true; height: parent.height; } diff --git a/qml/keys/ControlKey.qml b/qml/keys/ControlKey.qml index c91c30ee..3fa73e50 100644 --- a/qml/keys/ControlKey.qml +++ b/qml/keys/ControlKey.qml @@ -16,8 +16,41 @@ import QtQuick 2.4 +import QtQuick.Controls 2.12 +import QtQuick.Window 2.12 +import MaliitKeyboard 2.0 + ActionKey { + label: "ctrl" shifted: "ctrl" - action: "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.25 : 0.0 + } + + Label { + anchors.centerIn: parent + font.weight: Font.Light + opacity: 0.6 + font.pixelSize: parent.fontSize * 0.6 + horizontalAlignment: Text.AlignHCenter + } + + MouseArea { + anchors.fill: parent + + onPressed: { + Feedback.keyPressed(); + panel.activeKeypadState = "CONTROL"; + } + } } diff --git a/src/view/abstracttexteditor.cpp b/src/view/abstracttexteditor.cpp index 2153b2ed..fba52685 100644 --- a/src/view/abstracttexteditor.cpp +++ b/src/view/abstracttexteditor.cpp @@ -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(modifiers), text); From a74f4e56c770bb947ba22b74d99fe0e07de1cd30 Mon Sep 17 00:00:00 2001 From: Alexander Straube Date: Tue, 5 Nov 2024 20:13:03 +0100 Subject: [PATCH 6/6] Reworked ctrl key --- qml/keys/CharKey.qml | 2 ++ qml/keys/ExtendedKeysSelector.qml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/qml/keys/CharKey.qml b/qml/keys/CharKey.qml index ccfb0002..9256e6a7 100644 --- a/qml/keys/CharKey.qml +++ b/qml/keys/CharKey.qml @@ -290,6 +290,8 @@ Item { else if (!skipAutoCaps) { if (panel.activeKeypadState === "SHIFTED" && panel.state === "CHARACTERS") panel.activeKeypadState = "NORMAL"; + if (panel.activeKeypadState === "CONTROL" && panel.state === "CHARACTERS") + panel.activeKeypadState = "NORMAL"; } if (switchBackFromSymbols && panel.state === "SYMBOLS") { panel.state = "CHARACTERS"; diff --git a/qml/keys/ExtendedKeysSelector.qml b/qml/keys/ExtendedKeysSelector.qml index e26298b1..d9262711 100644 --- a/qml/keys/ExtendedKeysSelector.qml +++ b/qml/keys/ExtendedKeysSelector.qml @@ -165,6 +165,8 @@ KeyPopover { } else if (!skipAutoCaps) { if (popover.parent.activeKeypadState === "SHIFTED" && popover.parent.state === "CHARACTERS") popover.parent.activeKeypadState = "NORMAL" + if (popover.parent.activeKeypadState === "CONTROL" && popover.parent.state === "CHARACTERS") + popover.parent.activeKeypadState = "NORMAL" } popover.closePopover(); }