abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/KeyValue.java
AgeCommit message (Collapse)AuthorFilesLines
2023-08-06Add glyphs for editing keysJules Aguillon1-13/+23
All from Material Design Icons.
2023-08-06Elide custom keys labelsJules Aguillon1-1/+1
Make the font smaller for custom keys with a length above 1. Draw up to 4 characters on keys.
2023-08-05Translatable key descriptionsJules Aguillon1-20/+0
Key descriptions are shown in the "extra keys" option and can now be translated.
2023-08-02font: Move glyphs into the PUAJules Aguillon1-40/+40
Glyphs in the Private Use Area at uE000 will no longer conflict with fallback fonts in the "extra keys" option.
2023-07-30Allow more than 2 layoutsJules Aguillon1-4/+4
The two layout selection options are replaced by a ListGroupPreference that allow to enter an arbitrary amount of layouts. The "switch_second" and "switch_second_back" keys are replaced by "switch_forward" and "switch_backward", which allow to cycle through the selected layouts in two directions. Layouts are changed to place these two key on the space bar. The backward key is not shown if there's only two layouts.
2023-07-19Refactor: Make KeyValue.makeStringKey publicJules Aguillon1-9/+10
2023-06-28Accept some escaped keys in custom layoutsJules Aguillon1-0/+8
These symbols have special meaning when in `res/xml` and are escaped in standard layouts. The backslash is not stripped when parsed from the custom layout option. Treat these backslashed keys specifically to allow standard layouts to be passed back to the custom layout option.
2023-06-25Add Bengali Provat Layout (#357)Sabbir1-0/+3
* Add Bengali Provat Layout I added bengali_provat layout and renamed old bengali to actual layout name.
2023-06-03Add Voice Typing keyJules Aguillon1-0/+3
The new key switches to any installed "voice" input method. If several input methods matches, no effort is made to choose. Might misbehave with some input methods other than Google's on API < 28. It is placed on the middle of the arrows on the bottom bar. It is enabled by default and can be removed in the "Extra keys" option. The key is not removed from the keyboard if no voice input method exists.
2023-03-03Allow 8 symbols per keyJules Aguillon1-1/+8
'Keyboard.Key' now contains an array of size 9, giving each keyvalue an index. The algorithm for finding the nearest key during a swipe now needs 16 segments, which are now calculated as an angle. The algorithm does one more interation instead of 2 more, slightly reducing the sensitivity of corner values. The 'getAtDirection' function is moved into the Pointers class to clearly separate the two systems. The 'edgekey' attribute is now obsolete but is kept for compatibility. The flag is removed internally, key index are simply translated. Similarly, the 'slider' attribute now act on keys at index 5 and 6 instead of 2 and 3.
2023-02-12Option to switch to the previous input methodJules Aguillon1-0/+2
A new option changes the "change_method" into the new "change_method_prev". It switch to the previously used input method. A long press on "change_method_prev" sends "change_method". A new section is added in the settings and existing options are moved.
2023-02-09Vietnamese keyboard (#291)Kazoku1-1/+6
Added missing accent (horn, hook, dot below) Added layout Added accent font svg (by modified existing accent)
2023-01-31Add layouts 'he_il_1452_1' and 'he_il_1452_2'Ram Kromberg1-1/+45
2023-01-30Fix placeholder key not replacedJules Aguillon1-11/+19
Since fecc4dd, placeholder keys can't be compared by reference. Add a placeholder kind and defined placeholder values.
2023-01-29Remove the explicit hashmap in KeyValueJules Aguillon1-124/+118
Refactoring. Predefined keys are represented by a big switch statement rather than added into a hashmap.
2023-01-22Remove the modulated repeatJules Aguillon1-5/+5
It allowed to modulate the repeat speed of some keys (arrow, backspace, delete) by move the finger farther or closer to the key. In practice, this wasn't pratical and doesn't seem popular. It is removed in favor of a better mechanism for moving the cursor.
2022-12-30Add keys for every context menu actionsJules Aguillon1-1/+16
The most requested keys are undo and redo. Unfortunatly redo doesn't work reliably. The other context menu actions like share, assist and autofill are added even thought they are rarely useful or implemented.
2022-11-13Add editing keys: copy, paste, cut, select allJules Aguillon1-1/+26
2022-11-13Refactor: Use enum values in KeyValue.KindJules Aguillon1-38/+24
instead of maintaining a separate set of constants and a conversion function.
2022-11-13Allow switching quickly between two layoutsJules Aguillon1-2/+4
A new option allow to choose a secondary layout, the switching key is placed on the top edge of the space bar. The "Programming layout" option was basically doing that but it was possible to choose from a few layouts only. It is improved and renamed. The 'LayoutListPreference' allows setting the string for the first entry but otherwise share the rest of the array. Add nice icons from materialdesignicons.
2022-11-11Dim secondary keysJules Aguillon1-9/+11
Reduce the constrast of "secondary" labels. Modifiers (except diacritics), event and keyevent keys are considered secondary.
2022-11-05Add the bar diacritic dead keyJules Aguillon1-0/+2
Allows to type many of the "with stroke" or "with bar" latin letters.
2022-11-05Apply Fn firstJules Aguillon1-2/+2
It's otherwise impossible to type Ctrl+F keys.
2022-10-23Make the shift symbol biggerJules Aguillon1-1/+1
2022-10-23Show keys description in settingsJules Aguillon1-0/+19
The symbols alone might be hard to understand when scrolling through the "extra keys" option.
2022-10-23Refactor: Remove boilerplate for symbol keysJules Aguillon1-33/+49
2022-10-23Add the capslock keyJules Aguillon1-1/+3
The key enable caps lock immediately. It does nothing if caps lock is already enabled. It is not present on the keyboard by default but a place is defined on every layout, top-right of the shift key. It can be enabled in the settings. The icon is from materialdesignicons.com.
2022-10-15Add the breve diacriticJules Aguillon1-16/+22
2022-07-30Fix auto-capitalisation interfering with caps lockJules Aguillon1-0/+1
Add a flag to recognize fake pointers and avoid clearing the intentionally locked shift key.
2022-07-09Add key for switching to the greekmath paneJules Aguillon1-1/+3
The key is placed on the 3rd row of the numeric pane, by taking some space from the shift key.
2022-06-24Fix F12 being turned into F11Jules Aguillon1-1/+6
The "f11_placeholder" and "f12_placeholder" keys were equals since 31d6a70. Add an incrementing id into the unused key value to differentiate placeholder values.
2022-06-24Fix localized key not in predefined positionJules Aguillon1-19/+1
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-06Refactor: Remove KeyValue.nameJules Aguillon1-13/+31
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-05Fix "REMOVED" key appearing when typing Fn and ShiftJules Aguillon1-0/+2
Since cc571ea
2022-06-05Refactor: Make KeyValue finalJules Aguillon1-1/+1
The class has a complicated internal logic, it is no longer reasonable to extend it.
2022-06-05Refactor: Merge KeyValue._code and _flags fieldsJules Aguillon1-40/+54
With a small number of flags now, it's possible to remove one more field.
2022-06-05Refactor: Separate Events and Keyevents and use enumsJules Aguillon1-122/+127
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: Merge KeyValue.char and code fieldsJules Aguillon1-52/+43
These two fields couldn't have an interesting value at the same time. As we can no longer rely on a special value to distinguish between what's the kind, the kind of the key is explicitly encoded in the two most significative bits of the _flags field. Extra nice thing: This removes the special values 'EVENT_NONE' and 'CHAR_NONE'.
2022-06-05Refactor: Associate key events in KeyModifierJules Aguillon1-62/+12
Two advantages: - No need to distinguish modifiers in KeyEventHandler. The KeyValue is enough to decide what action to do. - Keys are never a Char and Event at the same time, fields can be merged.
2022-06-05Refactor: Abstract KeyValue fieldsJules Aguillon1-13/+75
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-05Add combining 'accent_arrow_right'Jules Aguillon1-0/+2
It's the first modifier that uses combining diacritics. Whether it should be represented as a modifier or a new kind of key can be reconsidered later.
2022-06-05Add the 'accent_slash' modifierJules Aguillon1-0/+3
Might be useful for some math characters.
2022-06-05Stop using flags for modifiersJules Aguillon1-94/+88
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-08Specify localized keys in each layoutsJules Aguillon1-15/+26
Each layouts can chose which key are localized instead of specifying it globally for each key. Important keys are no longer removed from layouts if the 'extra_keys' mechanism is not working properly. This can happen if language tags specified in method.xml don't match the user's language. Removed some currency symbols from some layouts. They are all in the Fn layer.
2022-04-30Fix modifiers not cleared when presses overlapJules Aguillon1-3/+4
When typing fast, a second key might be pressed before the first is released. Clearing modifiers earlier would prevent this but would break modifiers placed in corners (especially the accent keys). Instead, don't take latched modifiers into account when registering the second press. A new flag is needed to not interfere with holding modifers, which is merged with the norepeat flag.
2022-04-24Add Double acute diacriticJules Aguillon1-1/+4
Will be used by the Hungarian language.
2022-04-24Add support for LithuanianJules Aguillon1-1/+5
Requires two new diacritics: ogonek and dot_above. The new accents are also added to the Latvian layout as the two language can be close but not to the other localized layouts. A new mechanism is needed to reproducibly add extra keys to layouts without manual placement.
2022-04-03Add the Programming Layout optionJules Aguillon1-2/+4
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-04-03Rename the Meta keyJules Aguillon1-1/+1
The symbol isn't clear enough.
2022-04-03Swap Ctrl and switch_numeric keysJules Aguillon1-2/+2
The switch_numeric key is generally more important, especially in the numeric pane.