Ability to change [left and right] margins row by row (with exclusion of some keys) OR
Goals:
- stretching the middle row ("asdfghjkl") to the width of the screen (in other words: horizontal starting position of letter "a" would be the same as starting position of the letter "q" and at the same time horizontal ending position of the letter "l" would be the same as ending position of "p". And all of the letters from this row would be stretched to fill unused space). [It is done that way in Fleksy keyboard].
- changing horizontal size of "shift" and "enter" keys, and then adjusting (stretching or squizing) all the other keys inside this row ("zxcvbnm") to fill all the possible space.
Implementation proposals:
- Instead of (or in addition to) currently existing way of changing the horizontal margin of whole keyboard, add a way to change margin of every row. Where margin of "zxcvbnm" row would mean position of "z" and "m" keys instead of "shift" and "enter" (and probably there should be distinction between left and right margin).
- other way of solving this problem (and probably more universal) would be to enumerate widths of every key. For example if I would write: 15, 10, 10, 10, 10, 10, 10, 10, 15 for "zxcvbnm" row it would mean that "enter" key would be 15% of total width "z" would be 10% etc.
Unexpected already lets you do whatever you want. By default, keys have width 1.0. The width of the keyboard is defined by the widest row, and this dictates what 1.0 means in terms of screen space. It might be nice to allow width="15%", but there is no need to compute dynamically, as the file defines the entire layout. It might make coding less tedious if <row> could redefine the default width for that row.
Unexpected already lets you do whatever you want. By default, keys have width 1.0. The width of the keyboard is defined by the widest row, and this dictates what 1.0 means in terms of screen space. It might be nice to allow
width="15%", but there is no need to compute dynamically, as the file defines the entire layout. It might make coding less tedious if<row>could redefine the default width for that row.
Oh, thanks, I was thinking more about adding options to change that in keyboard settings but for some reason I didn't realized that It is possible to add my own layout where I can change everything in XML file. So if someone wonders how to do that:
- Go to https://github.com/Julow/Unexpected-Keyboard/tree/master/srcs/layouts
- Download language layout you want to base on
- Edit this part (or rather equivalent in your language):
[...]
<row>
<key shift="0.5" key0="a" key1="tab" key2="`"/>
<key key0="s" key1="loc accent_ring" key2="loc §" key3="loc ß" key4="loc accent_ogonek"/>
<key key0="d" key1="loc accent_grave" key2="loc £" key3="loc accent_aigu"/>
<key key0="f" key1="loc accent_dot_above"/>
<key key0="g" key1="loc accent_caron" key2="-" key3="_"/>
<key key0="h" key2="=" key3="+"/>
<key key0="j" key1="loc accent_trema" key2="loc accent_circonflexe" key4="}" key3="{"/>
<key key0="k" key1="loc accent_double_aigu" key3="[" key4="]"/>
<key key0="l" key2="|" key3="\\"/>
</row>
[...]
To something like this:
[...]
<row>
<key width="1.1111111" key0="a" key1="tab" key2="`"/>
<key width="1.1111111" key0="s" key1="loc accent_ring" key2="loc §" key3="loc ß" key4="loc accent_ogonek"/>
<key width="1.1111111" key0="d" key1="loc accent_grave" key2="loc £" key3="loc accent_aigu"/>
<key width="1.1111111" key0="f" key1="loc accent_dot_above"/>
<key width="1.1111111" key0="g" key1="loc accent_caron" key2="-" key3="_"/>
<key width="1.1111111" key0="h" key2="=" key3="+"/>
<key width="1.1111111" key0="j" key1="loc accent_trema" key2="loc accent_circonflexe" key4="}" key3="{"/>
<key width="1.1111111" key0="k" key1="loc accent_double_aigu" key3="[" key4="]"/>
<key width="1.1111111" key0="l" key2="|" key3="\\"/>
</row>
[...]
And If you also want this:
[...]
<row>
<key width="1.5" key0="shift" key2="loc capslock"/>
<key key0="z"/>
<key key0="x" key2="loc †"/>
<key key0="c" key1="loc accent_cedille" key2="<" key3="."/>
<key key0="v" key2=">" key3=","/>
<key key0="b" key2="\?" key3="/"/>
<key key0="n" key1="loc accent_tilde" key2=":" key3=";"/>
<key key0="m" key2=""" key3="'"/>
<key width="1.5" key0="backspace" key2="delete"/>
</row>
[...]
To this:
[...]
<row>
<key width="1.1111111" key0="shift" key2="loc capslock"/>
<key width="1.1111111" key0="z"/>
<key width="1.1111111" key0="x" key2="loc †"/>
<key width="1.1111111" key0="c" key1="loc accent_cedille" key2="<" key3="."/>
<key width="1.1111111" key0="v" key2=">" key3=","/>
<key width="1.1111111" key0="b" key2="\?" key3="/"/>
<key width="1.1111111" key0="n" key1="loc accent_tilde" key2=":" key3=";"/>
<key width="1.1111111" key0="m" key2=""" key3="'"/>
<key width="1.1111111" key0="backspace" key2="delete"/>
</row>
[...]
- Copy entire text inside file you edited
- Open "Unexpected Keyboard" Settings
- add new layout, scroll down to add your own layout
- Select everything, delete and paste your code instead; and you are done
So I think that it would be cool if this process could be simplified to be able to create my own layout inside app based on some other already existing layout. Maybe also some import/export options would simplify this. Also 1.1111111 is not very clean (and idk what is precision I can set it to) so It would be cool If I would be able to do some division like "10/9" but that is not very important.
The width="15%" idea is not enough to make this work and requires a way to mark the row as to be stretched. This is a big constraint on the implementation: 2 units for the same attribute, two ways to compute widths and an error case (all row cannot be stretched).
Here's my preferred solution: Specify the width to which the row should be stretched to.
For example, if the row width (sum of all the key widths) is 9 and the row specifies stretch="10", then it's stretched to be of width 10, multiplying every key widths by 10/9.
This stretching happens before the row width is compared to the width of the widest row.
This already happens in the keyboard currently: The bottom row and the number row are stretched using a similar mechanism.
Anyone interested in implementing it?