Commit ecb4bc22 authored by Jimmy HUGUET's avatar Jimmy HUGUET

Initial Commit

parents
/*
* Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
* Copyright (C) 2012-2013 Jolla Ltd.
*
* Contact: Pekka Vuorela <pekka.vuorela@jollamobile.com>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this list
* of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
* Neither the name of Nokia Corporation nor the names of its contributors may be
* used to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
import QtQuick 2.0
import com.jolla.keyboard 1.0
import Sailfish.Silica 1.0
KeyBase {
id: aCharKey
height: width
property string captionShifted
property string symView
property string symView2
property int separator: SeparatorState.AutomaticSeparator
property bool implicitSeparator: true // set by layouting
property bool showHighlight: true
property string accents
property string accentsShifted
property string nativeAccents // accents considered native to the written language. not rendered.
property string nativeAccentsShifted
property bool fixedWidth
property alias useBoldFont: textItem.font.bold
property alias pixelSize: textItem.font.pixelSize
property alias fontSizeMode: textItem.fontSizeMode
property alias textAnchors: textItem.anchors
property var swipeCaption: ["", "", "", "", "", "", "", ""]
property var swipeCaptionShifted: ["", "", "", "", "", "", "", ""]
property var swipeSpecial: ["", "", "", "", "", "", "", ""]
property int swipeValue: -1
property point tempPoint: Qt.point(0,0)
property point startPoint:Qt.point(0,0)
property point currentPoint:Qt.point(0,0)
property var swipeArray: attributes.isShifted ? swipeCaptionShifted : swipeCaption
keyType: KeyType.CharacterKey
text: keyText
keyText: swipeValue >= 0 ? (swipeArray[swipeValue] === "" ? swipeSpecial[swipeValue] : swipeArray[swipeValue])
: (attributes.inSymView && symView.length > 0 ? symView
: (attributes.isShifted ? captionShifted : caption))
Text {
id: textItem
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.family: Theme.fontFamily
font.pixelSize: Theme.fontSizeExtraLarge
color: pressed ? Theme.highlightColor : Theme.primaryColor
text: aCharKey.keyText
}
Repeater {
model: swipeArray
delegate: Text {
anchors.centerIn: textItem
anchors.verticalCenterOffset: index < 3 ? -aCharKey.height * 0.4
: index > 4 ? aCharKey.height * 0.4
: 0
anchors.horizontalCenterOffset: index == 0 || index == 3 || index == 5 ? -aCharKey.width * 0.3
: index == 2 || index == 4 || index == 7 ? aCharKey.width * 0.3
: 0
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.family: Theme.fontFamily
font.pixelSize: Theme.fontSizeSmall
color: Theme.primaryColor
text: modelData === "" ? swipeSpecial[index] : !attributes.inSymView ? modelData : ""
opacity: modelData !== "" ? 0.8 : attributes.inSymView2 ? 0.5 : 0
}
}
Rectangle {
anchors.centerIn: parent
width: Math.max(textItem.implicitWidth, textItem.implicitHeight)
height: width
radius: width / 2
z: -1
color: Theme.highlightBackgroundColor
opacity: 0.5
visible: pressed && showHighlight
}
Rectangle {
x: startPoint.x
y: startPoint.y
width: Math.sqrt(Math.pow(xDist, 2) + Math.pow(yDist, 2) )
height: Math.max(textItem.implicitWidth, textItem.implicitHeight) * 0.4
radius: height / 2
z: -1
color: Theme.highlightBackgroundColor
opacity: 0.3
transformOrigin: Item.Left
property real xDist: startPoint.x - currentPoint.x
property real yDist: startPoint.y - currentPoint.y
property real rotValue: Math.atan(Math.abs(yDist) / Math.abs(xDist)) * 180 / Math.PI
rotation: xDist > 0 && yDist > 0 ? 180 + rotValue
: xDist < 0 && yDist < 0 ? rotValue
: xDist < 0 && yDist > 0 ? - rotValue
: 180 - rotValue
}
}
This diff is collapsed.
// Copyright (C) 2013 Jolla Ltd.
// Contact: Pekka Vuorela <pekka.vuorela@jollamobile.com>
import QtQuick 2.0
Column {
width: parent ? parent.width : 0
property string type
property bool portraitMode
property int keyHeight
property int punctuationKeyWidth
property int punctuationKeyWidthNarrow
property int shiftKeyWidth
property int functionKeyWidth
property int shiftKeyWidthNarrow
property int symbolKeyWidthNarrow
property QtObject attributes: visible ? keyboard : keyboard.emptyAttributes
property string languageCode
property string inputMode
property int avoidanceWidth
property bool splitActive
property bool splitSupported
property bool useTopItem: !splitActive
property bool capsLockSupported: true
property bool isEase: true
Component.onCompleted: updateSizes()
onWidthChanged: updateSizes()
onPortraitModeChanged: updateSizes()
Connections {
target: keyboard
onSplitEnabledChanged: updateSizes()
}
Binding on portraitMode {
when: visible
value: keyboard.portraitMode
}
function updateSizes () {
if (width === 0) {
return
}
if (portraitMode) {
keyHeight = geometry.keyHeightPortrait
punctuationKeyWidth = geometry.punctuationKeyPortait
punctuationKeyWidthNarrow = geometry.punctuationKeyPortraitNarrow
shiftKeyWidth = geometry.shiftKeyWidthPortrait
functionKeyWidth = geometry.functionKeyWidthPortrait
shiftKeyWidthNarrow = geometry.shiftKeyWidthPortraitNarrow
symbolKeyWidthNarrow = geometry.symbolKeyWidthPortraitNarrow
avoidanceWidth = 0
splitActive = false
} else {
keyHeight = geometry.keyHeightLandscape
punctuationKeyWidth = geometry.punctuationKeyLandscape
punctuationKeyWidthNarrow = geometry.punctuationKeyLandscapeNarrow
functionKeyWidth = geometry.functionKeyWidthLandscape
var shouldSplit = keyboard.splitEnabled && splitSupported
if (shouldSplit) {
avoidanceWidth = geometry.middleBarWidth
shiftKeyWidth = geometry.shiftKeyWidthLandscapeSplit
shiftKeyWidthNarrow = geometry.shiftKeyWidthLandscapeSplit
symbolKeyWidthNarrow = geometry.symbolKeyWidthLandscapeNarrowSplit
} else {
avoidanceWidth = 0
shiftKeyWidth = geometry.shiftKeyWidthLandscape
shiftKeyWidthNarrow = geometry.shiftKeyWidthLandscapeNarrow
symbolKeyWidthNarrow = geometry.symbolKeyWidthLandscapeNarrow
}
splitActive = shouldSplit
}
var i
var child
var maxButton = width
for (i = 0; i < children.length; ++i) {
child = children[i]
child.width = width
if (child.hasOwnProperty("followRowHeight") && child.followRowHeight) {
child.height = width / 5
}
if (child.maximumBasicButtonWidth !== undefined) {
maxButton = Math.min(child.maximumBasicButtonWidth(width), maxButton)
}
}
for (i = 0; i < children.length; ++i) {
child = children[i]
if (child.relayout !== undefined) {
child.relayout(maxButton)
}
}
}
}
You should probably make a backup of your keyboard before installing, just in case :
<from your computer>
$ ssh nemo@<device ip address>
<type password (configured in settings/developper mode)>
$ devel-su
<type password (configured in settings/developper mode)>
# cp -R /usr/share/maliit/plugins/com/jolla /usr/share/maliit/plugins/com/jolla_BACK
To install the keyboard on your device :
<from your computer>
$ ssh nemo@<device ip address>
$ devel-su
# cp -RT /path/to/keyboard/ /usr/share/maliit/plugins/com/jolla/
# systemctl --user restart maliit-server
* Then from the device, go to settings, Text Input, Keyboard, select Ease
* From your keyboard, long press on the spacebar, select Ease layout
\ No newline at end of file
/*
* Copyright (C) 2013 Jolla ltd and/or its subsidiary(-ies). All rights reserved.
*
* Contact: Pekka Vuorela <pekka.vuorela@jollamobile.com>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this list
* of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
* Neither the name of Nokia Corporation nor the names of its contributors may be
* used to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
import QtQuick 2.0
import com.jolla.keyboard 1.0
KeyboardRow {
splitIndex: 3
SpecialEaseKey {}
SpacebarKey {}
SpacebarKey {
active: splitActive
languageLabel: ""
}
SpacebarKey {
active: splitActive
languageLabel: ""
}
EnterKey {}
}
/*
* Copyright (C) 2013 Jolla ltd. and/or its subsidiary(-ies). All rights reserved.
*
* Contact: Pekka Vuorela <pekka.vuorela@jollamobile.com>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this list
* of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
* Neither the name of Jolla ltd nor the names of its contributors may be
* used to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
import QtQuick 2.0
import com.jolla.keyboard 1.0
import Sailfish.Silica 1.0
FunctionKey {
id: symbolKey
property int _charactersWhenPressed
property bool _quickPicking
property string symbolCaption: "*.$"
caption: !attributes.inSymView2 ? symbolCaption : " "
implicitWidth: functionKeyWidth
keyType: KeyType.SymbolKey
onPressedChanged: {
}
onClicked: {
keyboard.inSymView2 = !keyboard.inSymView2
}
}
/*
* Copyright (C) 2012-2013 Jolla ltd and/or its subsidiary(-ies). All rights reserved.
*
* Contact: Pekka Vuorela <pekka.vuorela@jollamobile.com>
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* Redistributions of source code must retain the above copyright notice, this list
* of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
* Neither the name of Jolla Ltd nor the names of its contributors may be
* used to endorse or promote products derived from this software without specific
* prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
import QtQuick 2.0
import ".."
import Sailfish.Silica 1.0
KeyboardEaseLayout {
KeyboardRow {
CharacterEaseKey {
caption: "a"; swipeCaption: ["", "", "", "", "", "", "", "v"]; swipeSpecial: ["", "", "", "", "-", "", "", ""];
captionShifted: "A"; swipeCaptionShifted: ["", "", "", "", "", "", "", "V"]; symView: "1"; symView2: caption }
CharacterEaseKey {
caption: "n"; swipeCaption: ["", "", "", "", "", "", "l", ""]; swipeSpecial: ["`", "^", "", "+", "!", "/", "", "\\"];
captionShifted: "N"; swipeCaptionShifted: ["", "", "", "", "", "", "L", ""]; symView: "2"; symView2: caption }
CharacterEaseKey {
caption: "i"; swipeCaption: ["", "", "", "", "", "x", "", ""]; swipeSpecial: ["", "", "", "?", "", "", "=", "£"];
captionShifted: "I"; swipeCaptionShifted: ["", "", "", "", "", "X", "", ""]; symView: "3"; symView2: caption }
BackspaceKey {implicitWidth: symbol.width}
}
KeyboardRow {
CharacterEaseKey {
caption: "h"; swipeCaption: ["", "", "", "", "k", "", "", ""]; swipeSpecial: ["{", "", "%", "(", "", "[", "", "_"];
captionShifted: "H"; swipeCaptionShifted: ["", "", "", "", "K", "", "", ""]; symView: "4"; symView2: caption }
CharacterEaseKey {
caption: "o"; swipeCaption: ["q", "u", "p", "c", "b", "g", "d", "j"]; swipeSpecial: ["", "", "", "", "", "", "", ""];
captionShifted: "O"; swipeCaptionShifted: ["Q", "U", "P", "C", "B", "G", "D", "J"]; symView: "5"; symView2: caption }
CharacterEaseKey {
caption: "r"; swipeCaption: ["", "", "", "m", "", "", "", ""]; swipeSpecial: ["|", "", "}", "", ")", "@", "", "]"];
captionShifted: "R"; swipeCaptionShifted: ["", "", "", "M", "", "", "", ""]; symView: "6"; symView2: caption }
ShiftKey {implicitWidth: symbol.width}
}
KeyboardRow {
CharacterEaseKey {
caption: "t"; swipeCaption: ["", "", "y", "", "", "", "", ""]; swipeSpecial: ["~", "", "", "<", "*", "", "", ""];
captionShifted: "T"; swipeCaptionShifted: ["", "", "Y", "", "", "", "", ""]; symView: "7"; symView2: caption }
CharacterEaseKey {
caption: "e"; swipeCaption: ["", "w", "", "", "z", "", "", ""]; swipeSpecial: ["\"", "", "'", "", "", ",", ".", ":"];
captionShifted: "E"; swipeCaptionShifted: ["", "W", "", "", "Z", "", "", ""]; symView: "8"; symView2: caption }
CharacterEaseKey {
caption: "s"; swipeCaption: ["f", "", "", "", "", "", "", ""]; swipeSpecial: ["", "&", "", "#", ">", ";", "", ""];
captionShifted: "S"; swipeCaptionShifted: ["F", "", "", "", "", "", "", ""]; symView: "9"; symView2: caption }
SymbolKey {id: symbol}
}
SpacebarEaseRow {}
}
[da.qml]
name=Dansk
languageCode=DA
handler=Xt9InputHandler.qml
[de.qml]
name=Deutsch
languageCode=DE
handler=Xt9InputHandler.qml
[en.qml]
name=English
languageCode=EN
handler=Xt9InputHandler.qml
[ease_en.qml]
name=English (Ease)
languageCode=EN
handler=Xt9InputHandler.qml
[es.qml]
name=Español
languageCode=ES
handler=Xt9InputHandler.qml
[fi.qml]
name=Suomi
languageCode=FI
handler=Xt9InputHandler.qml
[fr.qml]
name=Français
languageCode=FR
handler=Xt9InputHandler.qml
[it.qml]
name=Italiano
languageCode=IT
handler=Xt9InputHandler.qml
[nl.qml]
name=Nederlands
languageCode=NL
handler=Xt9InputHandler.qml
[no.qml]
name=Norsk
languageCode=NO
handler=Xt9InputHandler.qml
[pl.qml]
name=Polski
languageCode=PL
handler=Xt9InputHandler.qml
[pt.qml]
name=Português
languageCode=PT
handler=Xt9InputHandler.qml
[ru.qml]
name=Русский
languageCode=RU
handler=Xt9InputHandler.qml
[bg.qml]
name=български
languageCode=BG
[sv.qml]
name=Svenska
languageCode=SV
handler=Xt9InputHandler.qml
[tr.qml]
name=Türkçe
languageCode=TR
handler=Xt9InputHandler.qml
[zh_cn_pinyin.qml]
name=中文(拼音)
languageCode=中文
type=china_pinyin
handler=Xt9CpInputHandler.qml
[zh_cn_stroke_simplified.qml]
name=中文(笔画)
languageCode=中文
handler=Xt9CpInputHandler.qml
[el.qml]
name=Ελληνικά
languageCode=EL
[et.qml]
name=Eesti
languageCode=ET
[cs.qml]
nameeština
languageCode=CS
[kk.qml]
name=Қазақ
languageCode=KK
[hi.qml]
name=हिन्दी
languageCode=हिन्दी
[mr.qml]
name=मराठी
languageCode=मराठी
[ml.qml]
name=മലയാളം
languageCode=മലയാളം
[pa.qml]
name=ਪੰਜਾਬੀ
languageCode=ਪੰਜਾਬੀ
[bn.qml]
name=বাংলা
languageCode=বাংলা
[ta.qml]
name=தமிழ்
languageCode=தமிழ்
[te.qml]
name=తెలుగు
languageCode=తెలుగు
[kn.qml]
name=ಕನ್ನಡ
languageCode=ಕನ್ನಡ
[gu.qml]
name=ગુજરાતી
languageCode=ગુજરાતી
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