Commit de2ec7b1 by Jimmy Huguet

Using menu and submenu, loopen now support almost all ascii character (only missing 5)

parent 815366fd
......@@ -31,12 +31,21 @@ Item {
property bool is8Pen: true
property var subMenu: {
"⌂": ["´", "^", "é", "ê", "á", "â", "ó", "ô", "í", "î", "ú", "û",
"¨", "`", "ë", "è", "ä", "à", "ö", "ò", "ï", "ì", "ü", "ù",
"°", "¸", "ñ", "ç", "å", "ã", "õ", "" , "ý", "ÿ"],
"☺": ["☺", "☻", "♥", "♦", "♣", "♠", "•", "◘", "♂", "♀", "♪", "♫",
"☼", "►", "◄", "▲", "▼", "↕", "▬", "↨", "↑", "↓", "→", "←",
"∟", "↔", "○", "◙", "", "", "", "", "", "", "", ""],
"╬": ["│", "┤", "╣", "║", "╗", "╝", "┐", "└", "═", "┴", "┬", "├",
"─", "┼", "╚", "╔", "╩", "╦", "╠", "╬", "┘", "┌", "█", "▄",
"¦", "▀", "░", "▒", "▓", "", "", "", "", "", "", ""],
"´": ["é", "É", "á", "Á", "ó", "Ó", "í", "Í", "ú", "Ú", "ý", "Ý"],
"^": ["ê", "Ê", "â", "Â", "ô", "Ô", "î", "Î", "û", "Û"],
"¨": ["ë", "Ë", "ä", "Ä", "ö", "Ö", "ï", "Ï", "ü", "Ü", "ÿ", "Ϋ"],
"`": ["è", "È", "à", "À", "ò", "Ò", "ì", "Ì", "ù", "Ù"],
"°": ["å", "Å"],
"~": ["ã", "Ã", "õ", "Õ", "ñ", "Ñ"],
"°": [ "å", "Å"],
"~": [ "ã", "Ã", "õ", "Õ", "ñ", "Ñ"],
"¸": ["ç", "Ç"]
}
property var accentMap: {
......@@ -62,8 +71,8 @@ Item {
property var moveSerie: []
property var fullMoveSerie: []
property string lowercase: "abcdefghijklmnopqrstuvwxyz"
property string uppercase: "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
property string lowercase: "abcdefghijklmnopqrstuvwxyzéêëèáâäàåãóôöòõúûüùíîïìýÿçñæø"
property string uppercase: "ABCDEFGHIJKLMNOPQRSTUVWXYZÉÊËÈÁÂÄÀÅÃÓÔÖÒÕÚÛÜÙÍÎÏÌÝΫÇÑÆØ"
property bool numActive: false
property bool specialActive: false
......@@ -133,7 +142,7 @@ Item {
onTriggered: {
var previousChar = MInputMethodQuick.surroundingText.charAt(MInputMethodQuick.surroundingText.length - 1)
subMenuCaption = {}
var list = [previousChar].concat(subMenu[previousChar])
var list = subMenu[previousChar]
var keys = Object.keys(centerLetterMove)
for (var i = 0; i < keys.length; i++) {
subMenuCaption[keys[i]] = []
......@@ -142,6 +151,7 @@ Item {
}
}
subMenuActive = true
MInputMethodQuick.sendKey(Qt.Key_Backspace, 0, "\b", Maliit.KeyClick)
}
}
......@@ -201,7 +211,7 @@ Item {
id: charText
anchors.verticalCenter: parent.top
anchors.horizontalCenter: parent.left
text: attributes.isShifted !== capitalMove && lowercase.indexOf(modelData) !== -1 ? uppercase.charAt(lowercase.indexOf(modelData)) : modelData
text: attributes.isShifted !== capitalMove && modelData !== "" && lowercase.indexOf(modelData) !== -1 ? uppercase.charAt(lowercase.indexOf(modelData)) : modelData
font.family: Theme.fontFamily
font.bold: branch.selected && selectionNumber === index ? true : false
font.pixelSize: Theme.fontSizeMedium
......@@ -250,6 +260,7 @@ Item {
} else {
if (pos === -1) {
processInput()
subMenuActive = false
var previousChar = MInputMethodQuick.surroundingText.charAt(MInputMethodQuick.surroundingText.length - 1)
if (Object.keys(subMenu).indexOf(previousChar) !== -1) {
subMenuTimer.start()
......@@ -302,15 +313,12 @@ Item {
if (lowercase.indexOf(letter) !== -1 && attributes.isShifted !== capitalMove) {
letter = uppercase.charAt(lowercase.indexOf(letter))
}
if (subMenuActive){
MInputMethodQuick.sendKey(Qt.Key_Backspace, 0, "\b", Maliit.KeyClick)
}
commitText(letter)
} else if (moveSerie.length === 1 && moveSerie[0] === -1) {
commitText(" ")
subMenuActive = false
}
moveSerie = []
subMenuActive = false
}
function commitText(text) {
......
......@@ -43,38 +43,38 @@ KeyboardLoopenLayout {
"180-left": ["s", "k", "q"],
"180-right": ["t", "a", "x"],
"240-left": ["n", "l", "£"],
"240-right": ["m", "y", "´"],
"240-right": ["m", "y", ""],
"300-left": ["r", "b", "'"],
"300-right": ["d", "w", "&"]
}
numCaption:
{
"0-left": ["4", "^", "],
"0-right": ["5", "é", ""],
"60-left": ["6", "/", "],
"60-right": ["7", "$", "],
"120-left": ["8", "=", "%"],
"120-right": ["9", "*", "&"],
"180-left": [">", "}", "]"],
"180-right": ["<", "{", "["],
"240-left": ["0", "+", "<"],
"240-right": ["1", "-", "_"],
"300-left": ["2", "*", "#"],
"300-right": ["3", "/", "\\"]
"0-left": ["0", "2", "4"],
"0-right": ["1", "3", ","],
"60-left": ["£", "$", "€"],
"60-right": ["©", "®", "],
"120-left": ["%", "@", "*"],
"120-right": ["=", "~", "^"],
"180-left": ["6", "8", "."],
"180-right": ["5", "7", "9"],
"240-left": ["+", ", "<"],
"240-right": ["(", "{", "["],
"300-left": [")", "}", "]"],
"300-right": ["-", "×", ">"],
}
specialCaption:
{
"0-left": ["a", "m", "y"],
"0-right": ["b", "n", "z"],
"60-left": ["c", "o", "."],
"60-right": ["d", "p", "?"],
"120-left": ["e", "q", "!"],
"120-right": ["f", "r", ","],
"180-left": ["g", "s", ";"],
"180-right": ["h", "t", ":"],
"240-left": ["i", "u", "'"],
"240-right": ["j", "v", "("],
"300-left": ["k", "w", ")"],
"300-right": ["l", "x", "$"]
"0-left": ["☺", "#", "|"],
"0-right": ["\"", "\\", "/"],
"60-left": ["¼", "½", "¾"],
"60-right": ["¹", "²", "³"],
"120-left": ["¥", "¢", ""],
"120-right": ["_", "ø", "þ"],
"180-left": ["ß", "ƒ", "Þ"],
"180-right": ["µ", "", "_"],
"240-left": ["Ð", "§", "¯"],
"240-right": ["«", "", ""],
"300-left": ["»", "¿", "¬"],
"300-right": ["æ", "¡", "ð"]
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment