adding Fn alternative keys for new Persian layout
Hi. I tried to add a Persian (Farsi) layout. So far it went well kudos to the smooth CONTRIBUTING.md.
My main issue is that I don't know how to set Fn alternative keys. The default behavior is Fn toggles F1 to F10 with the number keys. There are 12 keys on the first row of the Persian QWERTY layout. So I wanted to toggle '-' with F11 and '=' with F12.
Another question, should I make any changes to the method.xml file?
Any advice and recommendation on the layout are appreciated. Thank you.

some other issues that I noticed on my device (and scenarios I tested):
-
changing shift and backspace width make the keyboard disappear
- by changing backspace width to 2.
- by changing backspace width to 2 and shift to 1.
-
arrow keys make the keyboard disappear. (also happens with google play build)
- arrow keys to move the cursor in the telegram.
- left arrow key in Vivaldi browser when URL box is empty.
I checked the apply_fn function and it seems like they are hardcoded. is it possible to have separate apply_fn for each layout?
for now, I used the f11_placeholder and f12_placeholder keys.
another breaking change is that If I replace numeral keys with Persian numerals Fn toggle won't work on F# keys. adding the following cases to apply_fn_char would fix it though.
case '۱': return "f1";
case '۲': return "f2";
case '۳': return "f3";
case '۴': return "f4";
case '۵': return "f5";
case '۶': return "f6";
case '۷': return "f7";
case '۸': return "f8";
case '۹': return "f9";
case '۰': return "f10";
cheers
one thing that I noticed with the width and height values in the xml, that may be tge cause of your issues, is that a float value is expected. So if I type width="1.0" it works, if I type width="1" it won't. See if that helps.
One last thing, the telegram cursor not working is a telegram bug. (#170 and https://bugs.telegram.org/c/16674)
This looks promising ! Feel free to add more cases to apply_fn.
Unfortunately, it is not possible to make - and + turn into F11 and F12 without altering the other layouts. At the moment, the only solution is to add the f11_placeholder and f12_placeholder keys.
The method.xml file is mainly used to switch between languages using Android's persistent notification. You need to add an entry like this: (change layout_name to the name of the layout)
<subtype android:label="%s" android:languageTag="fa" android:imeSubtypeLocale="fa_IR" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=layout_name"/>
Thanks @sdrapha for answering. It is indeed related to the format of numbers, when the keyboard don't show up, it is actually crashing.
Does anyone have a patch for this ?
Fixed in dcbb4c4 and 6054c2e