abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/KeyboardData.java
AgeCommit message (Collapse)AuthorFilesLines
2024-02-28Modify the number row according to the numpad scriptJules Aguillon1-2/+2
The same way as the numpad is modified.
2024-01-13Refactor: New namespace for preference classesJules Aguillon1-1/+1
2024-01-10prefs: Show custom layout names if providedJules Aguillon1-3/+9
Show the name of custom layouts in the list if it's provided using the `name` attribute. This should make managing several custom layouts easier.
2023-12-26Add layout attribute 'numpad_script'Jules Aguillon1-7/+18
This new attribute is now used instead of 'script' for modifying the numpad according to the selected layout's script. If not provided, it defaults to the value of 'script'.
2023-12-17Improve layout parsing errorsJules Aguillon1-4/+11
Add location information to all error and improve "expected tag" errors.
2023-12-17prefs: Report errors while editing custom layoutsJules Aguillon1-3/+10
Errors are obtained by running the parser, validation is throttle to when the user stops editing for a second.
2023-09-24Preferred position for locale `extra_keys`Jules Aguillon1-0/+22
`method.xml` is now able to specify a preferred position for each extra keys in term of an other key to which it should be placed nearby. It's implemented for French as an example.
2023-09-15Refactor: Preferred positions for extra keysJules Aguillon1-27/+90
The new PreferredPos class represents where an extra key should be placed Currently used to place keys at the same positions they were placed before.
2023-09-10Refactor: Compute key positions in layoutsJules Aguillon1-20/+46
`KeyboardData.getKeys()` now returns a map of the keys present on the layout to their position. Positions are the row, column and swipe direction. The computed map is cached in the KeyboardData object as it might be accessed later by `findKeyWithValue`, which now do less work.
2023-09-03Consistent layout for optional numpadJules Aguillon1-1/+1
Modify the optional right hand numpad the same way as the numeric layout.
2023-07-05Remove use of `Arrays.copyOf`Jules Aguillon1-1/+2
The function has been added in API 9.
2023-06-28Fix crash when the layout has less than 3 rowsJules Aguillon1-1/+1
2023-06-22Allow to specify a layout scriptJules Aguillon1-6/+10
Add the `script` attribute, which will be used to implement script-specific extra keys.
2023-06-03Per-layout shift modmapJules Aguillon1-10/+62
Specify the behavior of shift for a layout. This is intended for locales that use the same alphabet but have different capital letters (eg. Bengali). The modmap is defined like this: <keyboard> <modmap> <shift a="a" b="A"/> </modmap> </keyboard>
2023-03-28Refactor: Remove unecessary method KeyboardData.load_pin_entryJules Aguillon1-8/+0
2023-03-05Refactor: Remove KeyboardData.CornerJules Aguillon1-84/+66
The Corner class is removed. The "localized" flag for all the corners is held in a bitfield.
2023-03-05Remove the 'edgekeys' attributeJules Aguillon1-33/+0
2023-03-03Allow 8 symbols per keyJules Aguillon1-104/+73
'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-26Fix miscalculated keyboard height with number rowJules Aguillon1-2/+3
The 'keysHeight' field needs to be updated. As this class is not intended to be mutable, copy the list of rows and call the constructor. Also remove an unecessary component of the keyboard height calculation.
2023-01-30Add optional number rowJules Aguillon1-3/+11
An option is added to enable an extra number row at the top of the keyboard. Digits are removed from the keyboard while the number row is visible.
2023-01-30Remove the digits when numpad is visibleJules Aguillon1-12/+36
2023-01-30Modification step for the special layoutJules Aguillon1-6/+1
Refactor, follow up of 90b7944. Add a modification step to the "special" layouts: numpad, greekmath, pin entry. Remove the apply_key0 function, which is not expressive enough. Add an enum instead of yet an other "switch_" function.
2023-01-30Apply modify_layout to text layout onlyJules Aguillon1-17/+5
Refactor. Allows to remove the 'extra_keys' and 'num_pad' flags and to implement more complicated transformations to the layouts.
2023-01-22Move cursor by sliding on the space barJules Aguillon1-6/+14
Send key events for the left or right arrow as the finger slides on the space bar. Can be used to select text by holding shift. Works under Termux. Events are sent linearly as the finger travels. The distance between each events is defined from the swiping distance divided by 4. 'slider="true"' can be set on a key that have 'edgekeys="true"'. 'key2' and 'key3' represent the right and left keys.
2022-12-10Add option 'numpad_layout'Jules Aguillon1-2/+7
Allow choosing whether to show the high or the low digits first. The numeric pane and the numpad are affected by the option.
2022-11-26Allow using a custom layoutJules Aguillon1-1/+22
Add an option for specifying an XML layout description as a string. The option is a bit rough at the moment: - No documentation, users have to be aware of the keyboard's code to use this option. - No error are shown, the layout will fallback to qwerty on error.
2022-11-26Refactor: Use XmlPullParser directlyJules Aguillon1-20/+36
XmlResourceParser is convenient but cannot be easily instantiated.
2022-11-26Refactor: Pass layout as a KeyboardData instead of IDJules Aguillon1-11/+26
Parse layouts sooner.
2022-11-13Fix localized keys appearing on secondary layoutJules Aguillon1-3/+1
2022-10-24Draw letter indication on the pin layoutJules Aguillon1-6/+11
There is no way to type letters on the pin layout, the indication are decoration only. Use the E.161 standard.
2022-10-24Add the pin entry layoutJules Aguillon1-1/+2
The layout is used for phone number and datetime input boxes as well as some numbers. It is easier to use when the full numeric layout is not needed.
2022-10-23Add optional NumPadGero Streng1-5/+44
Shows a NumPad depending on preference: Never/Landscape/Always
2022-09-24Add more possible locations for extra keysJules Aguillon1-0/+6
Avoid dropping some keys on crowded layouts.
2022-07-24Automatic capitalisation at beginning of sentencesJules Aguillon1-0/+30
Keep track of end-of-sentence characters while typing and automatically enable shift when appropriate. The last few characters just before the cursor need to be queried in some cases: Begin of input, cursor has moved or text is deleted. This might have a performance cost. This normally only enable shift but it also needs to disable shift when the cursor moves.
2022-06-24Fix localized key not in predefined positionJules Aguillon1-33/+90
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-06Don't add extra keys to the numeric paneJules Aguillon1-13/+19
2022-05-29Automatically place localized keys on the layoutsJules Aguillon1-18/+77
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-08Better handling of removed keys and swipe getureJules Aguillon1-20/+4
The "closest key" logic must be careful not to reveal keys removed by a modifier. Must check [_handler.onPointerSwipe] for every candidate values. [selected_value] is changed back to [selected_direction]. This adds a new bug: When the direction change, the selected value might not change but a vibration will be triggered anyway.
2022-05-08Improve nearest key computationJules Aguillon1-76/+32
getAtDirection was too hard to maintain and might contain bugs. Change slightly the meaning of directions and implement a the nearest key calculation as a loop.
2022-05-08only vibrate when the swipe key changesRodrigo Batista de Moraes1-10/+12
2022-05-08use the closest swipe key on swipeRodrigo Batista de Moraes1-6/+90
fix a direction
2022-04-16Fix compatibility with Android 6Jules Aguillon1-1/+4
Android 6 uses Java 1.7, the only incompatible feature in use was lambdas.
2022-03-19Allow modifiers to hide keysJules Aguillon1-0/+12
Modifiers can temporarily remove a key from the layout by returning 'null'. Make sure pointer handling code handle these modified keys gracefully and doesn't trigger a key event and a vibration for the removed key.
2022-03-05Improve the code for dynamic updates of the layoutJules Aguillon1-65/+4
2022-02-13Scale the bottom row depending on the host layoutJules Aguillon1-10/+31
1ff8526 added a bug for layouts that weren't 10 units wide.
2022-02-07Define the bottom row separatelyJules Aguillon1-57/+76
Avoid divergences when the bottom row is modified.
2022-02-06Allow egde keys instead of corner keys (swipe vertically/horizontally)Max Schillinger1-3/+12
Add a new boolean parameter "edgekeys" for defining keys that have the additional (swipe) keys on the edges (top, right, left, bottom) instead of at the corners (top left, top right, bottom left, bottom right).
2022-01-10Swap the Enter and Action keys when neededJules Aguillon1-0/+26
When IME_FLAG_NO_ENTER_ACTION is set.
2022-01-09Add the Action keyJules Aguillon1-11/+21
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.
2021-12-19Auto-format Java and XML filesJules Aguillon1-49/+49
Use xmllint. Re-indent Java files using spaces.