keymanapp / keyman

Keyman cross platform input methods system running on Android, iOS, Linux, macOS, Windows and mobile and desktop web
https://keyman.com/
Other
391 stars 107 forks source link

[developer] Improve defaults for on screen keyboard graphic export #879

Open mcdurdin opened 6 years ago

mcdurdin commented 6 years ago

I think this should be documented somewhere:

I wasn't satisfied with the image of the keyboard layout that I had in a PDF file. (Low quality, created many years ago, and needed some minor corrections.) So I decided to create a new version in html format. In Keyman Developer, I went to the On-Screen keyboard tab, and clicked on Export. After exporting the layout, I edited the resulting html file and turned it into my new welcome file. However, I ran into two snags along the way.

The first snag was easily fixed. During the export process, the file name defaulted to a .html extension. I didn't catch that, and named it "welcome.html". But when building the keyboard package, I needed "welcome.htm".

The second snag was a little more involved. After specifying the name of the export file, a dialogue came up that asked

image

Again, I chose the default settings. This resulted in the creation of a "welcome_files" folder containing a bunch of gif background images of various keys, which were referenced by the html file. I added these to the keyboard package, and built the package. However, Developer flattened the folder structure in the package, and when I installed keyboard, the welcome file could not find any of the background images. The characters for the layout were shown hanging in space. I had to move all of the gif files from the welcome_files folder into the welcome folder, and then edit the welcome.htm file to point to files in the local folder.

In both of these cases, the default settings of the export process did not serve my purpose well. I had to spend quite a bit of time fixing the second problem. I did not want to redo the export process, since by the time I discovered the problem I had already done a lot of editing to the welcome.htm file. So I had to do more manual editing. Most important, anyone using this strategy for the first time could easily fall into the same trap.

(via email)

MattGyverLee commented 6 years ago

I don't know if it helps, but you may be able to piggyback off of http://www.keyboard-layout-editor.com/ when you look back at generating keyboard layouts. They have templates for various world keyboards. Of course, most won't need the colors I have, but it can be used to generate the Linux-style 2-column, 2 row (see second image) or possibly a more complex layout. From Keyboard-Layout-Editor: ( http://www.keyboard-layout-editor.com/#/gists/f9da72593c2ee70e8af84a72af104d93 ) image

This is the Linux/XKB generated layout style (for my keyboard) image