Compare commits

..

8 Commits

Author SHA1 Message Date
Jules Aguillon
d787d982cf Release 1.10.0 (13) 2021-12-12 23:36:19 +01:00
Jules Aguillon
573c13fb82 Add Swedish
First add the 'ring' accent.
The swedish language uses the qwerty layout and three accents (aigu,
trema, ring)
2021-12-11 17:05:49 +01:00
Jules Aguillon
58e37b484c Fix Android's builtin shortcut not working
The 'repeat' field of generated key events was incorrectly set to '1'.
2021-12-11 01:03:36 +01:00
Jules Aguillon
cca832954e Increase the maximum value of the key height option 2021-12-05 21:00:38 +01:00
Jules Aguillon
0727ea38e9 Fix swapped page_up/page_down 2021-12-05 20:55:52 +01:00
Jules Aguillon
5e5c7ef86a Add the euro and pound symbols
Fn+$ and Fn+# respectively.
2021-12-05 20:16:01 +01:00
Jules Aguillon
d8d3cf85e5 Avoid using getWidth() from onMeasure() 2021-12-05 19:38:46 +01:00
Poussinou
7775213504 Update README.md 2021-12-05 18:22:20 +01:00
13 changed files with 43 additions and 15 deletions

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="juloo.keyboard2" package="juloo.keyboard2"
android:versionCode="12" android:versionCode="13"
android:versionName="1.9.2" android:versionName="1.10.0"
android:hardwareAccelerated="false"> android:hardwareAccelerated="false">
<uses-sdk android:minSdkVersion="4" <uses-sdk android:minSdkVersion="4"

View File

@@ -10,3 +10,7 @@ Several characters are displayed on each key. Get the one in the middle with a p
Like any other keyboard app, you will need to activate it in the system settings to be able to use it. Like any other keyboard app, you will need to activate it in the system settings to be able to use it.
This can be found in the System Settings > System > Languages & Input > Virtual keyboard > Manage keyboards. This can be found in the System Settings > System > Languages & Input > Virtual keyboard > Manage keyboards.
[<img src="https://fdroid.gitlab.io/artwork/badge/get-it-on.png"
alt="Get it on F-Droid"
height="80">](https://f-droid.org/packages/juloo.keyboard2/)

View File

@@ -0,0 +1,3 @@
- Add support for Swedish
- Fix keyboard shortcuts not working in some applications
- Fix a graphical bug and add some tweaks

View File

@@ -0,0 +1,3 @@
- Nouvelle langue: Suédois
- Les raccourcis clavier fonctionnent dans toutes les applications
- Correction d'un bug graphique et quelques ajustements

View File

@@ -14,7 +14,7 @@
</row> </row>
<row> <row>
<key key0="q" key1="tab" /> <key key0="q" key1="tab" />
<key key0="s" /> <key key0="s" key1="accent_ring" />
<key key0="d" key1="accent_grave" key3="accent_aigu" /> <key key0="d" key1="accent_grave" key3="accent_aigu" />
<key key0="f" key3="{" key4="}" /> <key key0="f" key3="{" key4="}" />
<key key0="g" key3="[" key4="]" /> <key key0="g" key3="[" key4="]" />

View File

@@ -30,4 +30,11 @@
android:isAsciiCapable="true" android:isAsciiCapable="true"
android:imeSubtypeExtraValue="default_layout=qwerty,accents=grave|aigu" android:imeSubtypeExtraValue="default_layout=qwerty,accents=grave|aigu"
/> />
<subtype android:label="@string/subtype_label"
android:languageTag="sv"
android:imeSubtypeLocale="sv_SE"
android:imeSubtypeMode="keyboard"
android:isAsciiCapable="true"
android:imeSubtypeExtraValue="default_layout=qwerty,accents=aigu|trema|ring"
/>
</input-method> </input-method>

View File

@@ -14,7 +14,7 @@
</row> </row>
<row> <row>
<key shift="0.5" key0="a" key1="tab" key2="`" /> <key shift="0.5" key0="a" key1="tab" key2="`" />
<key key0="s" /> <key key0="s" key1="accent_ring" />
<key key0="d" key1="accent_grave" key3="accent_aigu" /> <key key0="d" key1="accent_grave" key3="accent_aigu" />
<key key0="f" /> <key key0="f" />
<key key0="g" key2="-" key3="_" /> <key key0="g" key2="-" key3="_" />

View File

@@ -80,7 +80,7 @@
android:summary="@string/pref_key_height_summary" android:summary="@string/pref_key_height_summary"
android:defaultValue="50" android:defaultValue="50"
min="30" min="30"
max="60" max="90"
/> />
<juloo.common.IntSlideBarPreference <juloo.common.IntSlideBarPreference
android:key="horizontal_margin" android:key="horizontal_margin"

View File

@@ -118,6 +118,7 @@ class Config
case "tilde": return KeyValue.FLAG_ACCENT4; case "tilde": return KeyValue.FLAG_ACCENT4;
case "cedille": return KeyValue.FLAG_ACCENT5; case "cedille": return KeyValue.FLAG_ACCENT5;
case "trema": return KeyValue.FLAG_ACCENT6; case "trema": return KeyValue.FLAG_ACCENT6;
case "ring": return KeyValue.FLAG_ACCENT_RING;
default: throw new RuntimeException(name); default: throw new RuntimeException(name);
} }
} }

View File

@@ -102,6 +102,11 @@ class KeyModifier
case '-': return '÷'; case '-': return '÷';
default: return (char)KeyCharacterMap.getDeadChar('\u00A8', c); default: return (char)KeyCharacterMap.getDeadChar('\u00A8', c);
} }
case KeyValue.FLAG_ACCENT_RING:
switch (c)
{
default: return (char)KeyCharacterMap.getDeadChar('\u02DA', c);
}
case KeyValue.FLAG_ACCENT_SUPERSCRIPT: case KeyValue.FLAG_ACCENT_SUPERSCRIPT:
switch (c) switch (c)
{ {
@@ -179,6 +184,8 @@ class KeyModifier
case "-": name = ""; break; case "-": name = ""; break;
case "_": name = ""; break; case "_": name = ""; break;
case "esc": name = "insert"; break; case "esc": name = "insert"; break;
case "$": name = ""; break;
case "#": name = "£"; break;
default: return k; default: return k;
} }
return KeyValue.getKeyByName(name); return KeyValue.getKeyByName(name);

View File

@@ -41,10 +41,11 @@ class KeyValue
public static final int FLAG_ACCENT6 = (1 << 21); // Tréma public static final int FLAG_ACCENT6 = (1 << 21); // Tréma
public static final int FLAG_ACCENT_SUPERSCRIPT = (1 << 22); public static final int FLAG_ACCENT_SUPERSCRIPT = (1 << 22);
public static final int FLAG_ACCENT_SUBSCRIPT = (1 << 23); public static final int FLAG_ACCENT_SUBSCRIPT = (1 << 23);
public static final int FLAG_ACCENT_RING = (1 << 24);
public static final int FLAGS_ACCENTS = FLAG_ACCENT1 | FLAG_ACCENT2 | public static final int FLAGS_ACCENTS = FLAG_ACCENT1 | FLAG_ACCENT2 |
FLAG_ACCENT3 | FLAG_ACCENT4 | FLAG_ACCENT5 | FLAG_ACCENT6 | FLAG_ACCENT3 | FLAG_ACCENT4 | FLAG_ACCENT5 | FLAG_ACCENT6 |
FLAG_ACCENT_SUPERSCRIPT | FLAG_ACCENT_SUBSCRIPT; FLAG_ACCENT_SUPERSCRIPT | FLAG_ACCENT_SUBSCRIPT | FLAG_ACCENT_RING;
public final String name; public final String name;
public final String symbol; public final String symbol;
@@ -131,6 +132,7 @@ class KeyValue
addModifierKey("accent_tilde", "◌̃", FLAG_ACCENT4); addModifierKey("accent_tilde", "◌̃", FLAG_ACCENT4);
addModifierKey("accent_cedille", "◌̧", FLAG_ACCENT5); addModifierKey("accent_cedille", "◌̧", FLAG_ACCENT5);
addModifierKey("accent_trema", "◌̈", FLAG_ACCENT6); addModifierKey("accent_trema", "◌̈", FLAG_ACCENT6);
addModifierKey("accent_ring", "◌̊", FLAG_ACCENT_RING);
addModifierKey("superscript", "◌͆", FLAG_ACCENT_SUPERSCRIPT); addModifierKey("superscript", "◌͆", FLAG_ACCENT_SUPERSCRIPT);
addModifierKey("subscript", "◌̺", FLAG_ACCENT_SUBSCRIPT); addModifierKey("subscript", "◌̺", FLAG_ACCENT_SUBSCRIPT);
addModifierKey("fn", "Fn", FLAG_FN); addModifierKey("fn", "Fn", FLAG_FN);
@@ -202,8 +204,8 @@ class KeyValue
addEventKey("right", "\uE80C", KeyEvent.KEYCODE_DPAD_RIGHT, FLAG_KEY_FONT | FLAG_PRECISE_REPEAT); addEventKey("right", "\uE80C", KeyEvent.KEYCODE_DPAD_RIGHT, FLAG_KEY_FONT | FLAG_PRECISE_REPEAT);
addEventKey("down", "\uE809", KeyEvent.KEYCODE_DPAD_DOWN, FLAG_KEY_FONT | FLAG_PRECISE_REPEAT); addEventKey("down", "\uE809", KeyEvent.KEYCODE_DPAD_DOWN, FLAG_KEY_FONT | FLAG_PRECISE_REPEAT);
addEventKey("left", "\uE80A", KeyEvent.KEYCODE_DPAD_LEFT, FLAG_KEY_FONT | FLAG_PRECISE_REPEAT); addEventKey("left", "\uE80A", KeyEvent.KEYCODE_DPAD_LEFT, FLAG_KEY_FONT | FLAG_PRECISE_REPEAT);
addEventKey("page_up", "", KeyEvent.KEYCODE_PAGE_DOWN); addEventKey("page_up", "", KeyEvent.KEYCODE_PAGE_UP);
addEventKey("page_down", "", KeyEvent.KEYCODE_PAGE_UP); addEventKey("page_down", "", KeyEvent.KEYCODE_PAGE_DOWN);
addEventKey("home", "", KeyEvent.KEYCODE_HOME); addEventKey("home", "", KeyEvent.KEYCODE_HOME);
addEventKey("end", "", KeyEvent.KEYCODE_MOVE_END); addEventKey("end", "", KeyEvent.KEYCODE_MOVE_END);
addEventKey("backspace", "", KeyEvent.KEYCODE_DEL, FLAG_PRECISE_REPEAT); addEventKey("backspace", "", KeyEvent.KEYCODE_DEL, FLAG_PRECISE_REPEAT);

View File

@@ -265,7 +265,7 @@ public class Keyboard2 extends InputMethodService
metaState |= KeyEvent.META_ALT_LEFT_ON | KeyEvent.META_ALT_ON; metaState |= KeyEvent.META_ALT_LEFT_ON | KeyEvent.META_ALT_ON;
if ((flags & KeyValue.FLAG_SHIFT) != 0) if ((flags & KeyValue.FLAG_SHIFT) != 0)
metaState |= KeyEvent.META_SHIFT_LEFT_ON | KeyEvent.META_SHIFT_ON; metaState |= KeyEvent.META_SHIFT_LEFT_ON | KeyEvent.META_SHIFT_ON;
event = new KeyEvent(1, 1, KeyEvent.ACTION_DOWN, key.eventCode, 1, metaState); event = new KeyEvent(1, 1, KeyEvent.ACTION_DOWN, key.eventCode, 0, metaState);
getCurrentInputConnection().sendKeyEvent(event); getCurrentInputConnection().sendKeyEvent(event);
getCurrentInputConnection().sendKeyEvent(KeyEvent.changeAction(event, KeyEvent.ACTION_UP)); getCurrentInputConnection().sendKeyEvent(KeyEvent.changeAction(event, KeyEvent.ACTION_UP));
} }

View File

@@ -363,12 +363,13 @@ public class Keyboard2View extends View
public void onMeasure(int wSpec, int hSpec) public void onMeasure(int wSpec, int hSpec)
{ {
DisplayMetrics dm = getContext().getResources().getDisplayMetrics(); DisplayMetrics dm = getContext().getResources().getDisplayMetrics();
int height; int width = dm.widthPixels;
height = (int)(_config.keyHeight * _keyboard.keysHeight int height =
+ _keyboard.rows.size() * _config.keyVerticalInterval (int)(_config.keyHeight * _keyboard.keysHeight
+ _config.marginTop + _config.marginBottom); + _keyboard.rows.size() * _config.keyVerticalInterval
setMeasuredDimension(dm.widthPixels, height); + _config.marginTop + _config.marginBottom);
_keyWidth = (getWidth() - (_config.horizontalMargin * 2)) / _keyboard.keysWidth; setMeasuredDimension(width, height);
_keyWidth = (width - (_config.horizontalMargin * 2)) / _keyboard.keysWidth;
} }
@Override @Override