[Community] hyperlinking svg keyboards and Catalan layout

xdrudis at tinet.cat xdrudis at tinet.cat
Mon Jan 19 13:47:29 CET 2015


I've tried to subscribe to openmoko-devel but haven't passed gotchas.

I'm not sure where this should be sent then, sorry if it is off topic

I wanted to add some Catalan layouts to the svg on-screen keyboards in
qtmoko, but found the dead keys too dead and I also wanted to have a
numeric keypad.

So I finally drew some new keyboards with inkscape and change the
qtmoko code to allow for a key to link to another layout (and
optionally return to some layout after one keystroke).

I used that so that dead keys link to a layout with accented
characters or diaeresis. So now it works more similar to a desktop
keyboard. The downside is the combinatorial explosion of layouts,
burdening maintenance. Now I have


And I need to propagate most changes in one to the others.  It'd be
best to deal with dead keys, multikey or similar in C++ code, but I
haven't found out all details.

I also have n12.svg with numbers and symbols.

And I should do the same for qwerty.svg and qwerty_shift.svg.
And landscape/portrait.

The new code can also work with the old layouts, because when it finds
a Shift, CapsLock or Mode_switch key without a link it links it to the
same layout as used before (shift links to the previous or next layout,
mode_switch to the next non-shifted layout, always in alphabetical
order, and in the same directory as the current layout).

I you write in several alphabets you could also keep one directory for
each alphabet and have a layout that works as a layout chooser menu.

In order to link a layout to a key in inkscape just right click on the
key, select create link, then right click again, select link
properties and write the filename of the destination layout in the
href box. If you want the layout to go away after one keystroke, then
add to the filename ?return to bring the current layout back, or
?return=some.svg to go to a different layout after the keystroke.

This will create an svg:a element with the xlink:href you wrote
in the href box and the svg:g element inside it if that's what
you selected. If you do it on a rectangle o text inside the
svg:g it will create an svg:a between it and the svg:g but it
will still work (just don't put 2 svg:a inside the same svg:g).
Theoretically you could have 2 or more svg:g inside an svg:a and
it will work, but I can't imagine why anyone would want that.

Relative urls are resolved from the url of the layout where the svg:a
element is, and relative return urls are resolved from the url the
link points to.  Only file: urls are allowed now.

So the functionality of linking keys to layouts might be useful,
although for my purpose it leads to too many similar svgs,
one should maybe improve the key composing logic (or create
some tool to write the diferent layout variants from one layout to
automate maintenance of svgs).

Some things I have thought but didn't have time to try:

- see why my terminal doesn't like non-ascii characters
(they work in sms composing)

- include in svg a reference to a replacement svg for different
resolution/aspect ratio/orientation

- have the transparency increase gradually after a time of
not typing, so it is easier to see the terminal below

- write a layout editor for X11 desktops, so that you can select, the
layout size (portrait or landscape), a number of lines, a number of
keys for each line, and then just type the keys in a phisical
keyboard and have the editor calculate sizes and positons and capture
keypresses and assign ids (keycodes and unicode points) automatically.
I find inkscape too slow to work with, having to look up the codes
and size/align keys semimanually.

I have the code locally committed to a git clone I made according to
the qtmoko readme. I don't want a github account and might look to
see if I find some better git hosting, or if it is possible to self host
git in a purely static webserver.

But I'm attaching a patch here since it is smallish.

(there's a new scripts/qtmoko-chroot-jessie.sh because I couldn't
compile with scripts/qtmoko-chroot-armhf.sh, mostly because I tried
from an armhf jessie, but I'm not sure if there's any change that
should be propagated to  scripts/qtmoko-chroot-armhf.sh)

If I should send this somewhere else or somehow else, please tell me.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: svgkbd-links.diff
Type: text/x-diff
Size: 39788 bytes
Desc: not available
URL: <http://lists.goldelico.com/pipermail/community/attachments/20150119/58b99854/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CA_ad.tgz
Type: application/x-gtar-compressed
Size: 22164 bytes
Desc: not available
URL: <http://lists.goldelico.com/pipermail/community/attachments/20150119/58b99854/attachment-0001.bin>

More information about the Community mailing list