Julow / Unexpected-Keyboard

A lightweight virtual keyboard for developers.
GNU General Public License v3.0
1.27k stars 168 forks source link

English (UK) language forces pound sign in custom layout #683

Open P9NS5YVB851J50G opened 1 week ago

P9NS5YVB851J50G commented 1 week ago

Hello!

If I use English (UK) language in Android, pound sign appears under "q" key in my custom layout. Deleting that language removes pound symbol immediately. I don't know how to remove it in other way. I recorded short video to show this situation.

https://github.com/Julow/Unexpected-Keyboard/assets/173573458/e6cb9717-c7fd-4d64-b48d-aab9614af62d

I don't know if it's problem with my custom layout. Just in case here is my layout.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<keyboard bottom_row="false" name="Custom layout" script="latin">
<modmap>
    <fn a="!" b=""/>
    <fn a="@" b=""/>
    <fn a="#" b=""/>
    <fn a="$" b=""/>
    <fn a="%" b=""/>
    <fn a="^" b=""/>
    <fn a="&amp;" b=""/>
    <fn a="*" b=""/>
    <fn a="(" b=""/>
    <fn a=")" b=""/>
    <fn a="1" b="!"/>
    <fn a="2" b="@"/>
    <fn a="3" b="#"/>
    <fn a="4" b="$"/>
    <fn a="5" b="%"/>
    <fn a="6" b="^"/>
    <fn a="7" b="&amp;"/>
    <fn a="8" b="*"/>
    <fn a="9" b="("/>
    <fn a="0" b=")"/>

    <fn a="selectAll" b="`"/>
    <fn a="cut" b="£"/>
    <fn a="copy" b="∞"/>
    <fn a="paste" b="●"/>
    <fn a="undo" b="■"/>
    <fn a="redo" b="√"/>

    <fn a="q" b="~"/>
    <fn a="w" b="€"/>
    <fn a="e" b="°"/>
    <fn a="r" b="•"/>
    <fn a="t" b="▪"/>
    <fn a="y" b="▶"/>
    <fn a="u" b="_"/>
    <fn a="i" b="+"/>
    <fn a="o" b="-"/>
    <fn a="p" b="="/>
    <fn a="a" b="|"/>
    <fn a="s" b="["/>
    <fn a="d" b="]"/>
    <fn a="f" b="{"/>
    <fn a="g" b="}"/>
    <fn a="h" b=";"/>
    <fn a="j" b=":"/>
    <fn a="k" b="&quot;"/>
    <fn a="l" b="'"/>
    <fn a="z" b="✔"/>
    <fn a="x" b="✖"/>
    <fn a="c" b="&lt;"/>
    <fn a="v" b=">"/>
    <fn a="b" b="/"/>
    <fn a="n" b="\"/>
    <fn a="m" b="?"/>

    <fn a="&quot;" b=""/>
    <fn a="?" b=""/>
    <fn a="'" b=""/>
    <fn a="/" b=""/>
    <fn a=":" b=""/>

    <fn a="ę" b=""/>
    <fn a="ó" b=""/>
    <fn a="ą" b=""/>
    <fn a="ś" b=""/>
    <fn a="ł" b=""/>
    <fn a="ż" b=""/>
    <fn a="ź" b=""/>
    <fn a="ć" b=""/>
    <fn a="ń" b=""/>

    <fn a="," b=","/>
    <fn a="left" b="left"/>
    <fn a="home" b="home"/>
    <fn a="up" b="up"/>
    <fn a="space" b="space"/>
    <fn a="down" b="down"/>
    <fn a="right" b="right"/>
    <fn a="end" b="end"/> 
    <fn a="." b="."/>
</modmap>
  <row>
    <key key0="1" key7="!"/>
    <key key0="2" key7="\@"/>
    <key key0="3" key7="\#"/>
    <key key0="4" key7="$"/>
    <key key0="5" key7="%"/>
    <key key0="6" key7="^"/>
    <key key0="7" key7="&amp;"/>
    <key key0="8" key7="*"/>
    <key key0="9" key7="("/>
    <key key0="0" key7=")"/>
  </row>
  <row>
    <key key0="q" key7="selectAll"/>
    <key key0="w" key7="cut"/>
    <key key0="e" key8="ę" key7="copy"/>
    <key key0="r" key7="paste"/>
    <key key0="t" key7="undo"/>
    <key key0="y" key7="redo"/>
    <key key0="u"/>
    <key key0="i"/>
    <key key0="o" key8="ó"/>
    <key key0="p"/>
  </row>
  <row>
    <key key0="capslock"/>
    <key key0="a" key8="ą"/>
    <key key0="s" key8="ś"/>
    <key key0="d"/>
    <key key0="f"/>
    <key key0="g"/>
    <key key0="h"/>
    <key key0="j" key7=":"/>
    <key key0="k" key7="&quot;"/>
    <key key0="l" key8="ł" key7="'"/>
  </row>
  <row>
    <key key0="shift"/>
    <key key0="ctrl"/>
    <key key0="z" key8="ż"/>
    <key key0="x" key8="ź"/>
    <key key0="c" key8="ć"/>
    <key key0="v"/>
    <key key0="b"/>
    <key key0="n" key8="ń" key7="/"/>
    <key key0="m" key7="?"/>
    <key key0="backspace"/>
  </row>
  <row>
    <key key0="fn" key8="config"/>
    <key key0=","/>
    <key key0="left" key8="home"/>
    <key width="3.5" key0="space" key7="up" key8="down"/>
    <key key0="right" key8="end"/>
    <key key0="." key8="switch_emoji"/>
    <key width="1.5" key0="enter" key8="shareText"/>
  </row>
</keyboard>
Spike-from-NH commented 6 days ago

Appears "under" q? If it is a swipe from q, you should be able to override that in your layout file to make that swipe do something else.

It may also work to go into Settings and, under "Add keys to the keyboard", uncheck £.

P9NS5YVB851J50G commented 6 days ago

Pound sign appears under "q" key as key4.

2

I overwrote key4 then "£" appeared under "w" key.

3

I tried to do as you said but "£" was default unchecked under "Add keys to the keyboard" section. I checked it and unchecked again but it didn't work.

Julow commented 6 days ago

This is due to the extra_keys system: https://github.com/Julow/Unexpected-Keyboard/blob/master/res/xml/method.xml#L14 There's currently no way to override that, but that would make sense.

P9NS5YVB851J50G commented 5 days ago

I understand. Thank you for your answers.

alotbsol555 commented 5 days ago

yes, it would be good, if you could supress the extra keys.

there is a workaround to get rid of the automatic extra keys (which is not nice): define every empty key as "", eg key4="" in your example above. there won't be any place left to put extra keys…

since your layout uses the same keys on most buttons, you could paste the same empty definitions to the end of most lines.

Julow commented 1 day ago

I just added the locale_extra_keys attribute in 3164215. You can disable this behavior by defining your layout with

<keyboard name="..." script="..." locale_extra_keys="false">
P9NS5YVB851J50G commented 14 hours ago

I just added the locale_extra_keys attribute in 3164215. You can disable this behavior by defining your layout with

<keyboard name="..." script="..." locale_extra_keys="false">

Thank you very much!