abouttreesummaryrefslogcommitdiff
path: root/srcs/juloo.keyboard2/KeyboardData.java
AgeCommit message (Collapse)AuthorFilesLines
2025-09-15Allow smaller row height in custom layouts (#1100)Jules Aguillon1-1/+1
The height of row set with `<row height="...">` cannot be lower than 0.5 to avoid rendering problems. This restriction is not necessary when the row has no key and is lifted in this case.
2025-06-18Add <row scale=""> attribute (#1018)Jules Aguillon1-1/+5
* Add <row scale=""> attribute Scale the width of the keys in the row to match a value. Useful to remove space on the right of the row without adding a 'width' attribute to each key. * layouts: Use the 'scale=""' attribute in builtin layouts This removes the very specific 'width' values.
2025-04-15Add class Modmap and test KeyModifierJules Aguillon1-42/+23
2025-03-27Remove symbols from the number row by default (#964)Jules Aguillon1-7/+2
The number row option is changed into a ListPreference and controls whether the number row contains symbols or not. Co-authored-by: Joey Schaff <j@jaoh.xyz>
2025-03-15Selection mode (#913)Jules Aguillon1-0/+2
* Selection mode: Space to cancel the selection This adds the "selection mode", which is activated when text is selected in the text box. The selection mode is exited when the selection is cleared. While the selection mode is activated, the Space and Esc keys are modified into the "selection cancel" key, which remove the selection without changing the text. The space bar is otherwise easy to type by accident during a selection and causes the selected text to be deleted. * Selection mode: Move each ends of selection separately with slider When the selection mode is activated, the space bar sliders change how they affect the selection: - The left side of the slider moves the left position of the selection. To shrink the selection from the left side, the slider must be activated by sliding to the left, extending the selection temporarilly, then by sliding to the right. - The right side of the slider affects the right position if the selection.
2025-02-08Add embedded_number_row keyboard attribute (#891)dzaima1-3/+7
2025-01-11Remove the 'slider="true"' attributeJules Aguillon1-12/+6
Whether a key behaves as a slider is now purely defined by the key values present on it.
2024-11-24layouts format: Add 'c' as a synonym for 'key0'Jules Aguillon1-1/+1
The attribute 'c' specifies the symbol in the center of a key, just like 'key0'. This adds consistency with the cardinal direction attributes and is intended to make layouts more readable.
2024-09-29refactoring: safer KeyboardData.loadJules Aguillon1-13/+14
2024-07-27Fix scaling for layouts with few columnsJules Aguillon1-1/+1
This was causing a slight padding on the right of 4 columns layouts, which turned into a large padding when the number row was added.
2024-07-25Allow Ctrl modmaps in layoutsJules Aguillon1-3/+8
The 'ctrl' modmap is different from the other modmaps as it also applies the built-in Ctrl modifier to the resulting character, even if it was first modified by the custom modmap. For example, this will map Ctrl+в to Ctrl+V (not to v): <ctrl a="в" b="v"/> This is intended to add keyboard shortcuts in non-latin layouts. A caveat is that the latin character appears on the keyboard while Ctrl is activated.
2024-07-14Fix crash when using a different script layoutJules Aguillon1-2/+4
This might happen when using a layout of a different script than the installed languages.
2024-07-06Add locale_extra_keys keyboard attributeJules Aguillon1-4/+8
This attribute can be used to disable adding the extra keys from method.xml.
2024-07-06Fix crash with narrow layoutsJules Aguillon1-1/+1
The PreferredPos mechanism cause an out of bound access since 773147a.
2024-06-29Validate more fields in custom layoutsJules Aguillon1-5/+11
This adds some errors: - 'script' or 'numpad_script' is set an empty string. - Multiple '<modmap>' elements. - 'shift', 'width' and 'height' on every nodes that support them are clamped to a valid value.
2024-06-09Use preferred dir when placing a key next to an otherJules Aguillon1-2/+8
2024-06-09Automatic placement of f11/f12 placeholdersJules Aguillon1-7/+10
2024-05-29Configure anticircle gesture per-key (#644)Jules Aguillon1-6/+19
This adds the new 'anticircle' attribute to layouts '<key>' elements that configure the key to send when doing a anti-clockwise circle gesture on it. Labels are drawn the same way as indication. Updated docs.
2024-05-29Fix uninitialized bottom_row when editing custom layoutJules Aguillon1-22/+23
This happen when opening the settings from the launcher activity without ever opening the keyboard. To remove this bug entirely, the KeyboardData.init method is removed, the pieces needing initialization are now cached in Config.
2024-05-27Fix off-by-one error in 1-row layoutsJules Aguillon1-1/+1
2024-05-08Compass-point synonyms for edge keys in layouts (#628)Spike1-19/+34
2024-05-02allow for <fn ...> in <modmap> (#626)alotbsol5551-4/+21
2024-03-16Fix potential out of bounds accessJules Aguillon1-1/+1
The preferred pos mechanism could cause an out of bounds access on 1 row layouts.
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.