We have moved to a new Sailfish OS Forum. Please start new discussions there.
54

HowTo: Adapt Sailfish virtual keyboard (vkb) layout

asked 2014-01-31 02:24:37 +0200

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

updated 2016-08-17 16:38:05 +0200

jiit gravatar image

It is quite easy to adapt the virtual keyboard of Sailfish OS in such a way, that you do not spoil any of the original layouts and that it also should survive a system update. While you can do it all on the Jolla handset itself, I personally prefer using a PC for it.

See also answers

If you want to get capital letters in the lower case keyboard level by long-tapping, you might be interested in the post https://together.jolla.com/question/28819/howto-long-press-character-keyboard-for-capitalization/.
 

Newer Sailfish versions

  • With Sailfish OS 1.0.4.20 the keyboard code in directory /usr/share/maliit/plugins/com/jolla/ has been changed, including Popper.qml and InputHandler.qml. Check Wiki: Changes from Sailfish OS 1.0.3.8 to 1.0.4.20 to see what this means for your particular code amendments.
    The procedure below works also for Sailfish OS 1.0.4.20.

1 What you need

  • Developer mode activated (including ssh access when using the PC; see below).
  • An Unicode capable editor (UTF-8), I prefer SciTE (http://www.scintilla.org). (Alternatively you may use vi directly on the Jolla handset -- but if you can use this, you do not need the following instructions ;-)
  • USB access from your PC to your Jolla handset
  • FileBrowser app on your Jolla handset (get it from the Jolla Store)
  • Optional: An ssh client, I prefer Cygwin Terminal. (Alternatively you may use Terminal on the Jolla handset.)
  • Optional, only when using an ssh client: WiFi access from your PC to your Jolla handset

2 Procedure

See answer vkb layout file available from internet if you have found a layout file on the internet that suits you.

2.1 Developer mode

  1. Go to |- Settings | System Settings | Developer Mode -|. ( Because your Jolla device can access the Jolla apps shop, a Terminal app is installed now.)
  2. Activate „Developer mode“.
  3. Activate „Remote connection” (either enter and [Save] a password or [Generate] it; if you generate it, you have to edit it slightly before the [Save] button becomes available).
  4. Note the WiFi IP address shown under ""Networking".

2.2 Getting the layout template

  1. Open FileBrowser.
  2. From the pulley menu select "Go to home".
  3. Using the 3 dots in the top left, go to the root of the file system (no dot being shown any longer).
  4. Go down in the file system to (tapping each of the directory icons): /usr/share/maliit/plugins/com/jolla/layouts/
  5. Look for the qml file of the language you want to use as a template, e.g. de.qml for German.
  6. Tap-and-hold that file.
  7. From the context menu opening select "Copy".
  8. From the pulley menu select "Home".
  9. Go down to directory "Downloads".
  10. From the pulley menu select "Paste".
  11. Connect Jolla handset and PC via USB.
  12. When requested, select "PC connection".
  13. Using your PC file browser (e.g. Windows Explorer) go to the "Sailfish" device, directory "Downloads" (in Windows, the address line should show: "Computer\Sailfish\Phone Memory\Downloads").
  14. Copy the previous qml file onto your PC.
  15. Rename the qml file suitably, e.g. de.qml into dex.qml (x = extended)

2.3 Editing the template

  1. Open the renamed qml file in the text editor of your choice.
  2. Make sure, the character coding is set to UTF-8 (in SciTE: |- File | Encoding | UTF-8 -|.

Study the file contents. You have

  • 3 entries "KeyboardLayout" corresponding to the 3 rows of keys (except the lowest one with the space bar).
  • 7 or 11 "CharacterKeys" in each row corresponding to the actual keys.
  • For each CharacterKey a
    • "caption": lower case letter
    • "captionShifted": upper case letter
    • "symView": 1st level figure/symbol character
    • "symView2": 2nd level figure/symbol character
    • "accents": The list of characters appearing when you tap-and-hold a key in the lower case letter level
    • "accentsShifted": The list of characters appearing when you tap-and-hold a key in the upper case letter level
  • 1 entry "SpacebarRow": A reference for the space bar row definitions. (You may change even this row, check file http://bundyo.org/jolla/layouts/bg.qml.)

Most interesting probably are changes to the "accents" and "accentsShifted" entries, you may add such entries for any key not yet having such entry. For example, I created a keyboard layout where each key of the upper row includes a number from 1 to 9 and 0 in the accents and accentsShifted and the most right key holding some special characters such as @.

You may even add or remove keys (add/remove a "CharacterKey" statement). However, 11 keys in the upper rows seems to be a natural maximum, thereafter the key space gets too small to be usable (at least for me).

When finished with editing, save the file.

2.4 Creating a config file

In order that Sailfish recognizes your newly created layout, you need a config file. This should have the same name as the layout file, except for the extension being "conf", i.e. dex.conf. The contents should be:

[dex.qml]

name=DeutschX

languageCode=DE

With:

  • 1st line: file name of layout file
  • 2nd line: indicating the language as shown when tap-and-holding the space bar of the vkb
  • 3rd line: international language code as shown on the space bar

Create such file on your computer, e.g. using SciTE.

2.5 Copying the layout and config file back onto the Jolla handset

Because the Sailfish FileBrowser cannot copy files into the system directories, you need command line access to the handset.

  1. Using the file browser of your computer copy the 2 files back to the Download directory of the Jolla device.
  2. If you want to use an ssh client (instead of typing on the command prompt of the Sailfish Terminal):
    • On the PC start the ssh client (e.g. Cygwin Terminal).
    • Connect to the Jolla device: On the command line enter: xxx.xxx.xxx.xxx -l nemo and [Enter]. (xxx.xxx.xxx.xxx being the WiFi IP address you noted earlier; "-l" = hyphen + lower case L).
      (The ssh client connects to the handset and asks for the password. If it should not connect, somehow the PC does not find the way to the Jolla. Check your firewall. On my system for example, I can only connect when the PC is connected to the router via cable. If it still does not work: Use the Sailfish Terminal.)
    • When prompted for the password, enter the "Remote connection" password you created earlier and [Enter].
      (The command line prompt of Sailfish appears, the prompt will be "$". You are logged in as user.)
  3. If you want to use the Sailfish Terminal app (as installed when activating the developer mode):
    • Start Terminal.
      (The command line prompt of Sailfish appears, the prompt will be "$". You are logged in as user.)

    From now on be careful, what you are doing. As administrator you may break your handset!

    Continue with either, ssh client or Terminal as follows:
  4. On the command line enter devel-su and [Enter]. (You are asked for a password.)
  5. When prompted for the password, enter the "Remote connection" password you created earlier and [Enter].
    (The command line prompt changes to "#". You are logged in as administrator.)
  6. Copy the files created to the layout directory: Enter cd /home/nemo/Downloads and [Enter]
    (Observe the upper case "D" in Downloads -- you are talking Linux where file/directory names are case sensitive).
  7. Check that you are in the right directory and your files are there: Enter dir and [Enter].
    (In the list shown, your files should be included.)
  8. Copy the layout file: Enter cp dex.qml /usr/share/maliit/plugins/com/jolla/layouts/ and [Enter]
    (Instead of dex.qml note your own file).
  9. Copy the layout file: Enter cp dex.conf /usr/share/maliit/plugins/com/jolla/layouts/ and [Enter]
    (Instead of dex.conf note your own file).
  10. Reset the keyboard service: Enter killall maliit-server and [Enter].

NOTE: Disable "Remote access" again before connecting to networks you cannot trust (e.g. public WiFi networks, mobile providers that do not allocate private IP 4 addresses and block inter-user IP communication – assume, they do not, as long as you do not know they do). Otherwise, strangers could try to enter your phone via ssh and try passwords using an automated procedure until they have been successfully entering your phone.

2.6 Selecting the new keyboard layout

  1. Open any application that shows the keyboard.
  2. Tap-and-hold the space bar. (The languages available are displayed.)
  3. From the languages list select your language (as stated in the your conf file).

Enjoy.

PS: Helpful was http://talk.maemo.org/showthread.php?t=91917 found by @ssahla, see https://together.jolla.com/question/19999/cant-type-en-dash-on-virtual-keyboard/.

Initially created by: @jgr

edit retag flag offensive close delete

Comments

Nice writeup! It would be perfect to have cursor keys for the keyboard, as scrollback is problematic with some text input fields (e.g. this comment/reply field with the Jolla native browser). I have however no clue how to place those four keys without losing otherwise important keys. Ideas welcome.

marsch ( 2014-01-31 03:11:49 +0200 )edit

@marsch: check that talk.maemo.org link above. That thread has keyboards with cursors keys (2 or 4 way as well), you can proceed from there :-) Ps: It is not only the placement on the vbk, you have to slightly modify the input handler as well, but don't worry, not difficult... :)

CsTom ( 2014-01-31 13:31:33 +0200 )edit

As far as I understand it: You can code cursor keys (all 4) -- but for each one you code, you loose one key position (all four levels, i.e. lower case, upper case, symbol 1 and symbol 2 and including tap-and-hold option). For a German keyboard a hard decision ...

jgr ( 2014-01-31 23:42:54 +0200 )edit

Why would you loose any key position? o.O The key positions are not fixed. True, if you have more keys, it gets more cramped, but you don't loose positions -- as there are no positions. Check again that maemo.org link above, there are a few vbk pictures there, so you can see many more keys can fit there than just the english letters...

CsTom ( 2014-02-01 00:59:52 +0200 )edit

well, need it on jolla store keyboard-language CH-fr without developer mode.

redge73 ( 2014-02-02 02:11:15 +0200 )edit

7 Answers

Sort by » oldest newest most voted
7

answered 2014-02-02 19:40:20 +0200

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

updated 2014-02-03 01:49:42 +0200

jgr gravatar image

HowTo: Shorten the delay until accented characters appear

By default, the accented characters appear after a tap-and-hold time of 800 ms. This is set in file /usr/share/maliit/plugins/com/jolla/Popper.qml. You may shorten this time. Original code sequence:

    Timer {
        id: popperExpandTimer
        interval: 800
        onTriggered: {
            if (popper.accents.length > 1) {
                keyboard.inputHandler._handleKeyRelease()
                popper.expanded = true
            }
        }
    }

Adapt the 800 to anything what suits you. I reduced it to 100 ms, i.e. almost immediately.

Note: This edit may get lost with a Sailfish OS update (depending on whether Popper.qml is replaced thereby).

edit flag offensive delete publish link more

Comments

Much better to type this way if accented characters are frequently used.

marsch ( 2014-02-13 01:32:34 +0200 )edit
6

answered 2014-02-02 21:06:33 +0200

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

updated 2014-02-18 00:08:04 +0200

jgr gravatar image

HowTo: Add cursor (arrow) keys to your keyboard

You may add cursor keys wherever you want to within your layout. A natural position may be the lowest key line. Cursor keys are function key, i.e. are not shifted and "symboled", you cannot have any additional letter/function on the same place. However, you may reduce the width of keys to add the cursor keys without loosing other keys.

There are several solutions around that change existing files. The following solution reduces these changes to a single file only (if anyone knows how to eliminate this change as well: please amend). For other languages you may want to adapt the layout of the lowest key line to your countries preferences.

There are 2 changes to the original keyboard layout files (e.g. /usr/share/maliit/plugins/com/jolla/layouts/de.qml):

  • Some more inclusions at the begin
  • A replacement for the call of file ../SpacebarRow.qml

Add inclusions to the original keyboard layout file

At the begin, the Sailfish layout file reads something like

// Copyright (C) 2013 Jolla Ltd.
// Contact: Pekka Vuorela <pekka.vuorela@jollamobile.com>

import QtQuick 2.0
import ".."
Extend this by some more inclusion statements to read:
// Copyright (C) 2013 Jolla Ltd.
// Contact: Pekka Vuorela <pekka.vuorela@jollamobile.com>

import QtQuick 2.0
import com.jolla.keyboard 1.0
import Sailfish.Silica 1.0
import com.meego.maliitquick 1.0
import ".."

In the original keybaord layout file replace the call of file ../SpacebarRow.qml
Towards their end, the original Sailfish keyboard layout files contain the line
SpacebarRow {}
Replace this line with the following code:
KeyboardRow {

    // Symbol Key with shortened length
    FunctionKey {
        id: symbolKey
        property int _charactersWhenPressed
        property bool _quickPicking
        caption: attributes.inSymView ? "ABC" : "?123"
        width: functionKeyWidth-20
        keyType: KeyType.SymbolKey
        onPressedChanged: {
        if (pressed && !keyboard.inSymView && keyboard.lastInitialKey === symbolKey) {
            keyboard.deadKeyAccent = ""
            keyboard.toggleSymbolMode()
            _quickPicking = true
        } else {
            _quickPicking = false
        }
        _charactersWhenPressed = keyboard.characterKeyCounter
        }
        onClicked: {
        if (!_quickPicking || keyboard.characterKeyCounter > _charactersWhenPressed) {
            keyboard.toggleSymbolMode()
        }
        }
        Rectangle {
        color: parent.pressed ? Theme.highlightBackgroundColor : Theme.primaryColor
        opacity: parent.pressed ? 0.6 : 0.17
        radius: geometry.keyRadius
        anchors.fill: parent
        anchors.margins: Theme.paddingMedium
        }
    }

    // ContextAwareCommaKey {}
    CharacterKey {
        caption: MInputMethodQuick.contentType === Maliit.UrlContentType
             ? "/"
             : MInputMethodQuick.contentType === Maliit.EmailContentType
               ? "@"
               : ","
        captionShifted: caption
        symView: ","
        symView2: ","
        width: punctuationKeyWidth-10
        fixedWidth: true
        separator: false
    }

    // Left arrow key
    FunctionKey {
        icon.source: "image://theme/icon-l-left" + (pressed ? ("?" + Theme.highlightColor) : "")
        repeat: true
        key: Qt.Key_Left
        //width: punctuationKeyWidth
        width: 42
    }

    SpacebarKey {
        fixedWidth: true
    }

    // Right arrow key 
    FunctionKey {
        icon.source: "image://theme/icon-l-right" + (pressed ? ("?" + Theme.highlightColor) : "")
        repeat: true
        key: Qt.Key_Right
        width: 42
    }

             // Comma/semicolon key
    CharacterKey {
        caption: "."
        captionShifted: ";"
        width: punctuationKeyWidth-10
        fixedWidth: true
        separator: false
    }

    // Enter key with shortened length
    FunctionKey {
        property bool chineseOverride: keyboard.chineseOverrideForEnter
        icon.source: !chineseOverride ? MInputMethodQuick.actionKeyOverride.icon : ""
        caption: !chineseOverride ? MInputMethodQuick.actionKeyOverride.label : "输入" // = "enter"
        key: Qt.Key_Return
        enabled: !chineseOverride ? MInputMethodQuick.actionKeyOverride.enabled : true
        width: functionKeyWidth-30
        Rectangle {
        color: parent.pressed ? Theme.highlightBackgroundColor : Theme.primaryColor
        opacity: parent.pressed ? 0.6
                    : MInputMethodQuick.actionKeyOverride.highlighted ? 0.4 : 0.17
        radius: geometry.keyRadius
        anchors.fill: parent
        anchors.margins: Theme.paddingMedium
        }
    }
    }
Use the original layout file and make a copy of this (e.g. dex.qml), also create the conf file (e.g. dex.conf) as shown in the main answer) and copy the file to directory `/usr/share/maliit/plugins/com/jolla/layout/`.

Amendments to ../InputHandler.qml
In file `/usr/share/maliit/plugins/com/jolla/InputHandler.qml` (the one existing, original Sailfish file that needs an amendment in the original file) replace the code section:
            MInputMethodQuick.sendKey(Qt.Key_Backspace, 0, "\b", Maliit.KeyClick)
        } else if (pressedKey.key === Qt.Key_Paste) {
            MInputMethodQuick.sendCommit(Silica.Clipboard.text)
        } else  {
            resetShift = false
        }
by
            // Code amended, to provide for arrow/cursor keys left/right/up/down:
        MInputMethodQuick.sendKey(Qt.Key_Backspace, 0, "\b", Maliit.KeyClick)
        } else if (pressedKey.key === Qt.Key_Up) {
            MInputMethodQuick.sendKey(Qt.Key_Up, 0, "", Maliit.KeyClick)
        } else if (pressedKey.key === Qt.Key_Down) {
            MInputMethodQuick.sendKey(Qt.Key_Down, 0, "", Maliit.KeyClick)
        } else if (pressedKey.key === Qt.Key_Left) {
            MInputMethodQuick.sendKey(Qt.Key_Left, 0, "", Maliit.KeyClick)
        } else if (pressedKey.key === Qt.Key_Right) {
            MInputMethodQuick.sendKey(Qt.Key_Right, 0, "", Maliit.KeyClick)
        } else if (pressedKey.key === Qt.Key_Paste) {
            MInputMethodQuick.sendCommit(Silica.Clipboard.text)
        } else  {
            resetShift = false
        }

This code above caters for up/down arrow keys as well, although these are not included in the keyboard layout file as above.
Overwrite the original InputHandler.qml file with the edited file.

Notes

  • Test the result.
  • It does not work in Android apps.
  • The functionality of the cursor keys may get lost with a Sailfish OS update (depending on whether InputHandler.qml is replaced thereby; the keys themselves remain visible, because they are defined in the keyboard layout file).

Sources/copyrights

  • Above code partly provided by @CsTom.
  • Above code partly copyrighted as:
/*
 * 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.
 *
 */
edit flag offensive delete publish link more

Comments

To keep things neat and maybe use the same SpacebarRow in other layouts too, you can change the call in the layout file to for example SpacebarRowPlus {} (instead of replacing it with the new chunk of code) and then create a SpacebarRowPlus.qml with the new code in /usr/share/maliit/plugins/com/jolla.

If you do this, you need to add the inclusion statements (import [...]) in the beginning of that file also. I don't know if all of them are required, if someone can clarify on that then this can be added to the answer.

ssahla ( 2014-02-17 22:47:13 +0200 )edit

Yes, you may leave the inclusion statements in the keyboard layout file as they are, refer to the new file SpacebarRowPlus.qml (or whatever you want to name it), create a correct header for this file, add all inclusion statements and the spacebar code to it. Of course, for all such changes you have to observe the directory structure, i.e. code correctly according to the location of the files relative to your "calling file". Also, I would save the SpacebarRowPlus.qml to the layouts directory, to keep the custom specific changes to the upper directories to a minimum.

However, all this is more complex for non-coders than changing/adding as few files as possible. And coders will easily realize how to amend the code provided to their best coding policy themselves. So: It is sensible, to comment accordingly (maybe even a short statement within the answer itself, designated specifically to more advanced people), but I would not break up the code samples into more files. (More important would be, to eliminate the need to change existing files, i.e. the InputHandler.qml.)

@ssahla: Thank you for noting that a comment line has lost its slashes during some editing on the answer.

jgr ( 2014-02-18 00:24:20 +0200 )edit

@jgr, I see you are right – it's obvious for coders and unnecessarily complex for non-. :) So maybe not necessary to edit into the answer.

ssahla ( 2014-02-18 01:00:50 +0200 )edit

The arrow keys have a strange behavior related to auto-correct: Pressing the spacebar or tapping an auto-corrected word in the top row of the keyboard will insert the word where the cursor is, even if I've moved the cursor using the arrow keys.

Also, auto-correct goes nuts when scrolling with the arrow keys. Do you know of a way to disable auto-correct when using the arrows keys?

drcouzelis ( 2014-08-15 20:31:50 +0200 )edit

How to add to "dotkey" a ".com" ".net" ".org" like in comma....

// ContextAwareCommaKey {} CharacterKey { caption: MInputMethodQuick.contentType === Maliit.UrlContentType ? "/"

...I didn't try "".com"".net"".org"" jet

McCloud ( 2014-11-15 02:35:31 +0200 )edit
4

answered 2014-02-10 01:35:55 +0200

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

updated 2014-02-10 02:31:48 +0200

jgr gravatar image

HowTo: Remove unwanted keyboard layouts from the long-tap space selection

If you think, the list of keyboard layouts presented when you tap-and-hold the space key is too long, remove individual entries from the list. The entries are generated from all .conf files in directory /usr/share/maliit/plugins/com/jolla/layouts/, i.e. all files conforming to /usr/share/maliit/plugins/com/jolla/layouts/*.conf. Ex factory, there is the file

/usr/share/maliit/plugins/com/jolla/layouts/layouts.conf

containing the list of all layouts ex factory. In addition there are the .conf files you created yourself (or inherited from any installation you have done).

Procedure to limit the number of keyboard layouts listed:

  1. Make sure, you have developer mode activated on your Jolla handset.
    See section 2.1 "Developer mode" of the question above.
  2. On your PC, create .conf files for the languages you would like to be listed.
    The necessary entries you can retrieve from file /usr/share/maliit/plugins/com/jolla/layouts/layouts.conf (to get that file onto your PC, see section 2.2 "Getting the layout template" of the question above).
    For more information on the contents of .conf files see section 2.4 "Creating a config file" in the question above.
  3. Copy the .conf files into directory /usr/share/maliit/plugins/com/jolla/layouts/ of the Jolla handset.
    See section 2.5 "Copying the layout and config file back onto the Jolla handset" of the question above.
  4. Go to layouts directory: cd /usr/share/maliit/plugins/com/jolla/layouts/ and [Enter].
  5. Rename file layouts.conf to e.g. layouts.conf.tmp: mv layouts.conf layouts.conf.tmp and [Enter].
    This will exclude all entries in that file from being listed.
  6. Reset the keyboard service: killall maliit-server and [Enter].
  7. Exit root access: exit and [Enter].

This procedure has been derived from the answers to https://together.jolla.com/question/1204/limit-the-number-of-keyboards-to-be-selected-from-space-bar/. However, because you do not edit the layouts.conf. file but simply rename it, you loose less of your changes during a system update that reinstalls the layouts.conf file.

Procedure when after a system update, all keyboard entries reappear:

  1. Carry out steps 1, 3 (up to having root access to the Jolla handset) and 4 of the procedure above.
  2. Delete the current file layouts.conf.tmp: rm layouts.conf.tmp, [Enter] and confirm with [y].
  3. Rename the new file layouts.conf to e.g. layouts.conf.tmp: mv layouts.conf layouts.conf.tmp and [Enter].
    This will exclude all entries in that file from being listed.
  4. Reset the keyboard service: Enter killall maliit-server and [Enter].
  5. Exit root access: exit and [Enter].
edit flag offensive delete publish link more
2

answered 2014-11-14 14:26:56 +0200

silta gravatar image

updated 2014-11-24 11:51:20 +0200

Useful guide, thanks a lot.

I had only one problem (running Sailfish OS 1.0.8.21): in my new keyboard layout (dex.qml) I´ve got no input word suggestions.

The solution is to add a 4th line to the config file:

handler=Xt9InputHandler.qml

as you can see in the original layout.conf

edit flag offensive delete publish link more

Comments

I just found out the same. No idea why I didn't see your comment earlier. Now I have my perfect german virtual keyboard.

th80 ( 2014-12-03 21:32:46 +0200 )edit
1

answered 2015-03-14 00:15:04 +0200

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

updated 2015-06-10 21:57:01 +0200

ssahla gravatar image

HowTo: Make the spacebar wider

I feel that the spacebar key is a bit too narrow in portrait mode – I often hit the period key by accident – and I have a hunch I'm not the only one. Here's how you can make it wider by editing /usr/share/maliit/plugins/com/jolla/SpacebarRow.qml.

Note: These instructions are now updated for 1.1.4 / 1.1.6. The difference is that implicitWidth must be used instead of width and that you don't need to change the space bar width, because it automatically fills the space available.

Here is the definition of the spacebar row in the original file:

KeyboardRow {
    splitIndex: 3

    SymbolKey {}
    ContextAwareCommaKey {}
    SpacebarKey {}
    SpacebarKey {
        active: splitActive
        languageLabel: ""
    }
    CharacterKey {
        caption: "."
        captionShifted: "."
        implicitWidth: punctuationKeyWidth * 0.8
        fixedWidth: !splitActive
        separator: SeparatorState.HiddenSeparator
    }
    EnterKey {}
}

Change it to this:

KeyboardRow {
    splitIndex: 3

    SymbolKey {
        implicitWidth: functionKeyWidth * 0.8
    }
    ContextAwareCommaKey {
        implicitWidth: punctuationKeyWidth * 0.8
    }
    SpacebarKey {}
    SpacebarKey {
        active: splitActive
        languageLabel: ""
    }
    CharacterKey {
        caption: "."
        captionShifted: "."
        implicitWidth: punctuationKeyWidth * 0.8
        fixedWidth: !splitActive
        separator: SeparatorState.HiddenSeparator
    }
    EnterKey {
        implicitWidth: functionKeyWidth * 0.8
    }
}

As you can see, there are factors of 0.8 added to the width of all keys on the spacebar row (except the spacebar itself), so they will be 20 % narrower. The spacebar will be correspondingly wider. Of course, you can tweak these factors to your liking.

Make a backup of SpacebarRow.qml before doing this! And also keep a copy of the modified file, because these changed may be overridden the next time you update your OS.

edit flag offensive delete publish link more

Comments

1

I cannot wait till the simple, user-friendly HTML user-editable front-end appears. For now I'll live without a Del (English vkbd remove next character, not previous aka. Backspace). I suppose I can wait, after all.

rdmo ( 2015-04-28 22:08:05 +0200 )edit
0

answered 2014-01-31 12:04:36 +0200

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

updated 2014-02-17 01:00:21 +0200

jgr gravatar image

HowTo: vkb layout file available from internet

When you find a template and config file in the Internet, you can shorten the procedure as given above:

  1. Get the URLs of both files.
  2. Get a command line prompt and log in as administrator , see sections:
    • 2.1 "Developer mode"
    • 2.5 "Copying the layout and config file back onto the Jolla handset" of above procedure, steps 2 to 5.
  3. Download the layout file: Enter curl http://url.to/your/new/layout.qml > /usr/share/maliit/plugins/com/jolla/layouts/layout.qml and [Enter].
    (Replace "http://url.to/your/new/layout.qml" with the correct URL to the layout file and "layout.qml" with the file name).
  4. Download the config file: Enter curl http://url.to/your/new/layout.conf > /usr/share/maliit/plugins/com/jolla/layouts/layout.conf and [Enter].
    (Replace "http://url.to/your/new/layout.conf" with the correct URL to the config file and "layout.conf" with the file name).
  5. Reset the keyboard service: Enter killall maliit-server and [Enter].
  6. Follow section 2.6 "Selecting the new keyboard layout" of above procedure.

NOTE: Disable "Remote access" again before connecting to networks you cannot trust (e.g. public WiFi networks, mobile providers that do not allocate private IP 4 addresses and block inter-user IP communication – assume, they do not, as long as you do not know they do). Otherwise, strangers could try to enter your phone via ssh and try passwords using an automated procedure until they have been successfully entering your phone.

edit flag offensive delete publish link more
0

answered 2014-03-18 12:43:16 +0200

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

updated 2014-03-18 12:53:50 +0200

jgr gravatar image

Wiki: Changes from Sailfish OS 1.0.3.8 to 1.0.4.20

Popper.qml

File /usr/share/maliit/plugins/com/jolla/Popper.qml, code of 1.0.4.20:

    Timer {
        id: popperExpandTimer
        interval: 500
        onTriggered: {
            if (popper.accents.length > 1) {
                keyboard.inputHandler._handleKeyRelease()
                popper.expanded = true
            }
        }
    }

This is the code for giving access to accented characters, see HowTo: Shorten the delay until accented characters appear. The delay time has been reduced from 800 to 500 ms.

Comment: It is save to overwrite the Popper.qml of 1.0.4.20 with a file that worked with 1.0.3.8.

InputHandler.qml

File /usr/share/maliit/plugins/com/jolla/InputHandler.qml, code of 1.0.4.20:

        if (pressedKey.repeat) {
            autorepeatTimer.interval = 500
            autorepeatTimer.start()
        }
    }

This code seems to handle long-tap of keys and auto-repetition of the corresponding character (I have not yet seen any auto-repetition). The auto-repeat time has been reduced from 800 to 500 ms.

Comment: It seems to be save to overwrite the InputHandler.qml of 1.0.4.20 with a file that worked with 1.0.3.8.

Keyboard layout files

Files in directory /usr/share/maliit/plugins/com/jolla/layouts/, e.g. de.qml for German keyboard layout, have been added a license allowing amendment and redistribution.

Comment: It generally is not a good idea, to overwrite the original files in this directory, you rather should create new files based on the original ones. Your amended layouts should work. If they require amendments to files in directory /usr/share/maliit/plugins/com/jolla/layouts/, you will have to amend these files again.

edit flag offensive delete publish link more
Login/Signup to Answer

Question tools

Follow
26 followers

Stats

Asked: 2014-01-31 02:24:37 +0200

Seen: 19,050 times

Last updated: Jun 10 '15