abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/Keyboard2.java
AgeCommit message (Collapse)AuthorFilesLines
2022-06-24Fix localized key not in predefined positionJules Aguillon1-3/+2
The "loc " prefix for predefining a place for an "extra key" was broken since 31d6a70. The FLAG_LOCALIZED flag cannot be used anymore, as adding it to any key would turn it into a different key that wouldn't be recognized by parts of the code comparing the keys (placing the extra keys). Add an other layer in KeyboardData to store such informations.
2022-06-06Remove the option "Show every accents"Jules Aguillon1-2/+2
This option cannot be implemented easily now that the set of "accents" (localized keys) isn't defined.
2022-06-06Refactor: Remove KeyValue.nameJules Aguillon1-4/+4
This makes KeyValue objects smaller. 'equals' and 'hashCode' are now implemented too. Key names are still used to recognise keys with special meaning, but not for comparing keys anymore.
2022-06-05Refactor: Separate Events and Keyevents and use enumsJules Aguillon1-1/+1
Negative values for internal events are preventing further refactoring. Add a new kind of key and split internal events (now Event) and Android's key events (now Keyevent). Use enums events and modifiers outside of the KeyValue class. Internally, they are converted to and from integer.
2022-06-05Refactor: Abstract KeyValue fieldsJules Aguillon1-1/+3
The meaning of the public fields of KeyValue was quite complicated and not handled consistently accross the app. Make these fields private and add a more abstract API on top. The meaning of these fields changed recently and it wasn't an easy change. I plan on making more changes in the future.
2022-06-05Stop using flags for modifiersJules Aguillon1-1/+1
There was no free bits left to add new modifiers. Instead of increasing the width of the 'flags' field, refactor the way modifiers are represented and used. Modifers are now represented as independent values and stored in the 'code' field. A flag is added to distinguish between modifiers and keys with a key event. The most notable change is that modifiers can no longer be or-ed into a single value but have to be represented as an array.
2022-05-29Automatically place localized keys on the layoutsJules Aguillon1-1/+1
Layouts no longer need to mention every localized keys and dead keys. They are now placed automatically starting from the second row on the bottom-right corner. The "loc " prefix is not removed to still be able to define a more optimal and consistent placement for some extra keys (eg. 'ß' near 's'). Programming layouts no longer need to place every dead keys.
2022-05-01Fix crash when IME not enabledJules Aguillon1-1/+2
This is unexpected but happened to a user. Perhaps because the OS returned bogus or fake results in imm.getEnabledInputMethodList ?
2022-04-16Fix compatibility with Android 6Jules Aguillon1-4/+7
Android 6 uses Java 1.7, the only incompatible feature in use was lambdas.
2022-04-03Add the Programming Layout optionJules Aguillon1-4/+23
Allow specifying a layout for programming and add a key for switching to it easily. The switching key is placed on the top edge of the space bar. The option has no effect by default because the ergonomic isn't ideal, it needs to be enabled explicitly. Users of Latin-script languages certainly prefer to use one layout (for programming or not). This feature might be removed in favor of a better language-switching mechanisms in the future.
2022-03-16Show the switching key if there's several languagesJules Aguillon1-1/+4
Ensure the switching key is shown when there's several subtypes enabled, even if Android says not to show it.
2022-03-15Log editor infos while debuggingJules Aguillon1-0/+19
Useful when debugging why the keyboard doesn't work as expected with a specific app.
2022-03-13Define localized keys as a set instead of flagsJules Aguillon1-14/+18
Using flags for removing keys like € and ß need too many flags and won't scale to more localized keys.
2022-03-05Fix action key not updating when switching fieldJules Aguillon1-1/+2
The keyboard was updated before the action key is.
2022-02-22Send key events for the modifiersJules Aguillon1-4/+2
Before sending a key event while modifiers are active, send events for the modifier keys. Some applications don't look at the "metaState" flags but instead keep track of the up and down events for the modifiers. For example, the basic text views that are in every applications correctly handle the "metaState" flags except for one binding: Selecting text with the arrows while pressing shift.
2022-02-19Localize € and £Jules Aguillon1-0/+2
Show these characters only for users that have the corresponding locale installed (a supported eu language for €, en-GB for £). Add these characters to most layouts.
2022-02-07Define the bottom row separatelyJules Aguillon1-18/+3
Avoid divergences when the bottom row is modified.
2022-01-30Select theme depending on system settingsJules Aguillon1-15/+17
Automatically choose between the Dark and Light themes.
2022-01-30Improve Action key detectionJules Aguillon1-3/+3
There were two problems: - The Action key was swapped when it shouldn't be. The flag 'IME_FLAG_NO_ENTER_ACTION' wasn't interpreted correctly for inputs that specified both an action and this flag. - The value 'IME_ACTION_UNSPECIFIED' should remove the Action key.
2022-01-23Globe key: Open keyboard switching dialogJules Aguillon1-1/+3
instead of immediately switching to the next input method.
2022-01-23Make action key labels translatableJules Aguillon1-6/+8
2022-01-20Fix crash when switching appJules Aguillon1-0/+10
2022-01-15German keyboard added (#20)Moini1-1/+1
* Add German metadata translation * Add German keyboard Co-authored-by: Jules Aguillon <jules@j3s.fr>
2022-01-10Swap the Enter and Action keys when neededJules Aguillon1-0/+3
When IME_FLAG_NO_ENTER_ACTION is set.
2022-01-09Add the Action keyJules Aguillon1-0/+43
It is placed on the top-right of the enter key on every layouts. It sends a special event (performEditorAction) instead of writing a newline. The "actionId" is passed through the EditorInfo object in an obfuscated way so it's not clear whether it's using the right one.
2022-01-09Allow to hide more keys than just accentsJules Aguillon1-14/+13
Add the "FLAGS_LANGS" set of flags, which will be used to hide individual keys that are not accents.
2021-12-30Add themesJules Aguillon1-18/+16
Add a "Theme" option to choose between a dark and light theme. The light theme uses the colors of the dark theme with the luminance inversed. The reloading after a configuration change is changed slightly: - Special handling is needed when the Theme is changed (recreate the views) - The default implementation of 'onConfigurationChanged' is used Which triggers more refresh (but don't recreate the views) - 'onCreateInputView' is no longer needed
2021-12-28Reference the "special key font" in the Theme objectJules Aguillon1-7/+0
Remove the last cast of the context.
2021-12-28Separate "handler" codeJules Aguillon1-56/+40
As with the previous commit, remove casts of the context. The "handler" object is referenced in the "config" object for now.
2021-12-28Turn Config into a singleton objectJules Aguillon1-8/+4
The goal is to remove a cast of the 'context' into 'Keyboard2'.
2021-12-19Auto-format Java and XML filesJules Aguillon1-115/+115
Use xmllint. Re-indent Java files using spaces.
2021-12-11Fix Android's builtin shortcut not workingJules Aguillon1-1/+1
The 'repeat' field of generated key events was incorrectly set to '1'.
2021-05-09Fix NullPointerException when ready options from subtypesJules Aguillon1-4/+8
Seems like subtypes might not match what is declared. Must protect against that.
2021-05-09Restore support for Android < 12, set minimal version to 4Jules Aguillon1-3/+24
API level 12 is required for "subtype" code introduced in 1.7. This adds a fallback for older version, "subtype" features are not available but the keyboard is usable. Changet he minimal version to 4 to be able to query the API level. Using integer constant for versions because that's how it's presented in the documentation. Build.VERSION_CODES is WTF.
2021-05-09Add the accents preferenceJules Aguillon1-9/+48
This replaces the "disable accent keys" checkbox. The default should work for anyone: Accents will be hidden unless the user has the french language installed. The value "show every accents" is useful for versions of android that don't have subtypes.
2021-05-07Fix layout not updating after rotationJules Aguillon1-0/+1
Reset the layout on onStartInputView.
2021-05-01Reset keyboard when finishingJules Aguillon1-0/+7
This may cause key repeat continuing for a bit after the keyboard closes.
2021-04-29Add the "layout" option againJules Aguillon1-24/+20
Some versions of android don't allow to configure several languages.
2021-04-24Allow different sizesJules Aguillon1-1/+1
Improve Paint code.
2021-04-18Fix crash when no current input bindingJules Aguillon1-3/+8
Broken recently. Restore previous code
2021-04-18Separate handling of modifiers from KeyValue classJules Aguillon1-15/+13
KeyValue defines an ADT and some of its values, it now contains public final fields and no internal logic. KeyModifier handles modifiers and accents and creates new instances of KeyValue when needed. This operation is now properly cached.
2021-04-18Hide the input switching key if it's not neededJules Aguillon1-1/+2
Android has a new way of switching between input methods and this key need to be hidden in most cases.
2021-04-15Use subtypes to choose layoutJules Aguillon1-23/+54
This removes the "layout" setting. Every layouts that the user could use will appear in the global settings.
2021-04-15Stateless KeyboardData classJules Aguillon1-15/+1
It was a pain to use. It was also a pain to write this though.
2021-04-13Fix layout pref under debug buildsJules Aguillon1-8/+18
Remove the use of [getIdentifier] because it requires the current package name to be passed, which can't be found reliably since the change in build system.
2016-12-11switchToNextInputMethod keyjuloo1-0/+8
2015-10-29Move configs to Config objectjaguillo1-2/+14
2015-10-26Last used emojijaguillo1-14/+6
2015-10-24Emoji panejaguillo1-14/+27
2015-10-23Start with emojisjaguillo1-20/+36