missing key in custom layout

Bug #1259371 reported by Demon on 2013-12-10
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

i have created a custom layout, to match the usual danish layout, where i have moved the BKSL key next to the apostrophe key also called AC11, then i shaped the new return key in inkscape. i got the backslash key to show up, but no matter what i try, i cant get the return key to show, and it is called RTRN in inkscape, not sure if it just cannot handle this special non square shape, or what else could be wrong.

Demon (demon1986) wrote :
marmuta (marmuta) wrote :

Yes, currently only 'rect' tags are loaded from the svg files. Everything else is ignored. There used to be ancient code to represent arbitrary polygons, but that was never fully implemented.
It would make sense, though, if only for the common return key shape.
No promise, but I'd like to try and add polyline support. Would you attach an archive of your layout, please? This would save me some time.

Changed in onboard:
status: New → Confirmed
importance: Undecided → Wishlist
Demon (demon1986) wrote :

here's the svg file. really hope you would add odd shapes in the near future

marmuta (marmuta) wrote :

I've pushed initial support for for SVG path tags today. You can create arbitrarily shaped keys with some caveats. Pasting from the commit message:

"Only straight line-loops/polygons are supported, i.e. no arcs or splines. Paths have to run in clockwise direction for correct dish key normals, else the lighting will be inverted."

The return key is a special beast though. I've added a preliminarily one to Full Keyboard layout in trunk, but it doesn't really fit in under all conditions. We'll probably need something more dynamic than the static SVG paths. I'll leave this bug open for now.

marmuta (marmuta) wrote :

Fixed in trunk. Should work now, even with 'Return'.

This is how to to solve alignment issues: add a second path to the SVG file that shows the key at 50% key_size (key_size from the theme). The paths at 100% and at 50% are grouped together, the group given the key's id, and then Onboard should be able to take it from there. Both paths must have the same number and type of segments. Best clone the first path and just modify vertices.

There is a chance that we can keep the new 'Return' in the shipped layout, so you might not even need to bother with updating yours.

Changed in onboard:
status: Confirmed → Fix Committed
Demon (demon1986) wrote :

erm, okay? no clue about all this extra stuff you wrote, but you said it would work? im not into all this graphical stuff, i'm more of a hardware expert sorta guy :)

marmuta (marmuta) wrote :

It should be clearer when you look at the new return key in inkscape.

Notice it is made of two shapes that are grouped together. Right-click on the return key for "Object Properties" to see that the whole group has now the id "RTRN", not the individual shapes. Onboard will now consider the whole group to be the return key. To edit the group's contents (without destroying the group), you can "enter" it by right clicking and selecting "Enter group ...".

The outer shape is similar to the key from your layout. It tells Onboard how the key looks when the key size in Preferences->Themes->"Customize Theme" is set to 100 (%).

The second inner shape is new and it is optional. It tells Onboard how the key looks when you set the key size to 50 (%). The shape for all other key sizes is then interpolated between these two shapes.

Hope that helps a bit. If non-rectangular keys ever become popular we may still need a tutorial somewhere.

Demon (demon1986) wrote :

mkay, so first i tried adding the svg directly, didnt work, and the settings dialog still tends to crash after opening the folder, anyway, afterwards i took a look at the changed file, downloaded it, and pasted it into the onboard folder, now onboard doesnt work. so i thought, hell i'll try building the source, now either it compains about the python-distutils-extra (wich i have just installed) or i get this error: Traceback (most recent call last):
  File "./setup.py", line 14, in <module>
    from subprocess import getstatusoutput
ImportError: cannot import name getstatusoutput

any suggestions are appreciated

Francesco Fumanti (frafu) wrote :

I am just uploading revision 1673 of trunk for saucy and trusty into our Snapshots PPA:

I hope it will be useful.

Demon (demon1986) wrote :

got it, but the key still isnt showing up, with your little "fix" still got that old blank spot where it should be.

did you test before releasing this fix?

Francesco Fumanti (frafu) wrote :

I tested it on trusty, but not on saucy. I uploaded it rapidly for your convenience.

Are you using the Full Keyboard layout shipping with the package? The Full Keyboard layout does not anymore have a rectangular key.

Demon (demon1986) wrote :

maybe thats the problem, i'm using saucy atm, and i dont really plan to upgrade to a beta, since i don't use the linux much.

marmuta (marmuta) wrote :

I haven't tested it on Saucy either, but me thinks it should be fine, the changes where all internal to Onboard. Let me download a live cd.

Meanwhile, try switching the layout in preferences away, then back to "Full Keyboard" and please post:
$ apt-cache policy onboard

Francesco Fumanti (frafu) wrote :

Are you sure to be running revision 1673 from the PPA (if you performed the installation before launchpad had finished building it, in that case, you are running an older version of Onboard)?

I just switched to my saucy partition and installed Onboard from the PPA. The polygonial Return key of the Full Keyboard layout shipping with the package in the PPA is visible and Onboard seems to be working correctly.

Demon (demon1986) wrote :

well, i'm sure its upgraded, cause i added the ppa like i normally do, then did sudo apt-get update and then i did sudo apt-get upgrade, it asked to use more space, for a few apps, and onboard was listed. i did also try to switch between layouts here i also replaced my own with the new one you edited and either full or my own works, but the compact wit the old style works, i'll try a reboot and see if that can help it, otherwise, i'm puzzled

Francesco Fumanti (frafu) wrote :

Please, give us the output of:
apt-cache policy onboard

Demon (demon1986) wrote :

okay, problem solved after the reboot, even though the layout i replaced my own one with looks silly (the return arrow is misplaced) the full layout works and looks brilliant

Francesco Fumanti (frafu) wrote :

Great, that it is working now.

marmuta (marmuta) wrote :

Yes, good to hear it works. You shouldn't have to reboot, though. The old Onboard was probably still running. Next time after updating try
$ killall onboard; onboard

The arrow can be moved with the label_x_align attribute. See here

That chamfer_size setting there is to get the size of the rounded corners down to the size of the other keys. I may still remove this when I find a better way before the release.

Demon (demon1986) wrote :

yeah, i'll try that next time lol, anyway cheers for the ppa and stuff, next step is to add the numpad :D, shouldnt be hard tho it'll just be a tad wider :>

Francesco Fumanti (frafu) wrote :

This bug should be fixed with the 1.0.0 release. If you still encounter problems, please feel free to reopen this bug or file a new one.

Changed in onboard:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers