Commit Graph

337 Commits

Author SHA1 Message Date
Jules Aguillon
0da02d60c4 Do not remove numpad keys from the layout
This removes keys like '.' and '-' from their usual place, which is
pretty annoying.

The feature is retained for the number row.
2023-03-02 10:57:58 +01:00
Jules Aguillon
798494e701 Fix miscalculated keyboard height with number row
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-02-26 11:31:08 +01:00
JackDotJS
9523b158b3
Add theme "Alternative Black" (#297)
* Add alternative black theme
2023-02-26 09:47:31 +01:00
Jules Aguillon
0f62b3044c Option to switch to the previous input method
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-12 23:20:11 +01:00
Jules Aguillon
c46e3b6c61 Modify keys after a long press 2023-02-12 23:14:57 +01:00
Kazoku
5fac3459aa
Added missing accent that can combine with horn_accent (#293) 2023-02-09 23:38:55 +01:00
Kazoku
b54f9c5797
Vietnamese keyboard (#291)
Added missing accent (horn, hook, dot below)
Added layout
Added accent font svg (by modified existing accent)
2023-02-09 18:40:48 +01:00
Jules Aguillon
72249b8a42 Fix arrow keys not repeating
The special handling of arrow keys have been removed in 854eff2. Key
repeat was not starting when the key0 was empty.
2023-02-08 22:38:01 +01:00
Ram Kromberg
0fe27ef486
Add theme 'ePaper' (#287)
* Add theme 'ePaper'
2023-01-31 20:11:36 +01:00
Ram Kromberg
51ce2ccdf1 Add layouts 'he_il_1452_1' and 'he_il_1452_2' 2023-01-31 20:07:30 +01:00
Jules Aguillon
540384bb0a Add optional number row
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-30 23:58:47 +01:00
Jules Aguillon
c7184303e9 Remove the digits when numpad is visible 2023-01-30 23:54:39 +01:00
Jules Aguillon
78a461f740 Modification step for the special layout
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-30 23:46:02 +01:00
Jules Aguillon
90b7944129 Apply modify_layout to text layout only
Refactor. Allows to remove the 'extra_keys' and 'num_pad' flags and to
implement more complicated transformations to the layouts.
2023-01-30 22:33:01 +01:00
Jules Aguillon
2539feadcd Fix placeholder key not replaced
Since fecc4dd, placeholder keys can't be compared by reference.
Add a placeholder kind and defined placeholder values.
2023-01-30 21:29:59 +01:00
Jules Aguillon
fecc4dd70a Remove the explicit hashmap in KeyValue
Refactoring. Predefined keys are represented by a big switch statement
rather than added into a hashmap.
2023-01-29 19:38:54 +01:00
Jules Aguillon
7bc93c470e Don't send event at end of sliding
A sliding pointer going up must not cause a key event to be sent. This
caused an extra cursor movement and cleared the latched modifiers.
2023-01-29 18:49:44 +01:00
Jules Aguillon
854eff211d Move cursor by sliding on the space bar
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.
2023-01-22 23:21:21 +01:00
Jules Aguillon
f4032e3be9 Remove the modulated repeat
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.
2023-01-22 23:20:04 +01:00
Jules Aguillon
6126578111 Avoid switching back from secondary layout automatically
Stay on the secondary layout after a config refresh or onStartInputView.
The information is kept until the keyboard is restarted.

Additionally, move tweaking the secondary layout to the Config class now
that physical equality is not needed.
2023-01-15 23:19:09 +01:00
Jules Aguillon
fd0f0d5476 Separate option for bottom margin in landscape mode
A large margin in portrait mode is desirable but generally not in
landscape mode.
2023-01-15 19:19:07 +01:00
Jules Aguillon
a199962117 Separate option for horizontal margin in landscape mode
A separate option is needed, the +25dp offset wasn't enough.
2023-01-15 19:11:08 +01:00
Jules Aguillon
e190394b47 Add layout 'qwertz_sk'
Co-authored-by: Jozef Kundlak <ingjozefkundlak@gmail.com>
2023-01-14 23:31:37 +01:00
Jules Aguillon
c5f5a23d75 Fix dimensions going off after rotation
Values like 'characterSize' and 'horizontalMargin' can't be fed back into the default value because they are not of the same unit.
To avoid this happening again, change the way the default value is defined for every options.
The 'key_height' dimension was no longer used.
2022-12-31 14:00:38 +01:00
Jules Aguillon
e333eb06fd Add keys for every context menu actions
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-12-30 15:29:18 +01:00
Jules Aguillon
764cd882d2 Fix inaccessible text layout from pin
The "main" layout can now be pin layout. 'SWITCH_TEXT' and
'SWITCH_SECOND_BACK' don't mean to use that.
2022-12-29 12:43:02 +01:00
Jules Aguillon
8f972113ca Fix pin entry layout not showing up
The regular text layout was showing instead of the pin entry due to a
misuse of the 'switch' syntax.
2022-12-14 15:33:44 +01:00
Jules Aguillon
c61b31168c Fix a crash on API < 12
'extra_keys_subtype' can be none on API level < 12 when the "accents"
option is tweaked.
2022-12-14 15:09:46 +01:00
Jules Aguillon
7d6306fbc9 Fix keyboard not showing up after rotation
'setInputView()' must be called on every 'onStartInputView()', not just
when the view is re-created.

This is broken since bf31872.
2022-12-14 15:04:11 +01:00
Chasm Solacer
90cad963ec
Make the keyboard transparent (#252)
* Add option for keyboard opacity (transparency). Keyboard background, keys and pressed keys can be adjusted separately.

* Make the borders transparent as well

* Moved setAlphas outside drawKeyFrame to top of onDraw method
2022-12-11 22:10:00 +01:00
Jules Aguillon
bf31872955 Handle configuration change quickly
setInputView() was not called when the view was re-created through
refresh_config(). Also, the refresh_config() function was not able to
properly set the current layout.

Now keep the default layout (_localeTextLayout) and the current non-text
layout (if any, _currentSpecialLayout) separately to be able to refresh
them later.

setInputView() is called everytime the view is created instead of by
onStartInputView() specifically.

The setting activity now save the preferences to the protected storage
in onStop() instead of listening for onSharedPreferenceChanged.
2022-12-11 21:57:40 +01:00
Jules Aguillon
199ca5cf03 Improve emoji pane layout
The measurement function was wrong in some situations. Set a width for
columns and properly configure the GridView.
2022-12-11 16:26:50 +01:00
Jules Aguillon
87d21685ca Fix keyboard not reacting to changed preferences
The callback might not be called if the "default" shared preferences is
different from the shared preferences actually used. This is unexpected
but seems to happen half of the time on Android 12.

Since f1ce6ab, this callback is critical to update the keyboard.
Restarting the application can no longer solve these issues.
2022-12-11 14:55:32 +01:00
Chasm Solacer
8665d002bf
Added qwerty_pl layout (#251)
* Updated pl translation

* Added qwerty_pl.xml – QWERTY (Polski) layout
2022-12-11 14:49:22 +01:00
Jules Aguillon
c17b53ce7f Add option 'numpad_layout'
Allow choosing whether to show the high or the low digits first. The
numeric pane and the numpad are affected by the option.
2022-12-10 19:39:22 +01:00
Jules Aguillon
804ea84981 Correctly handle pointer cancel events
The cancel event ends the motion, it doesn't apply to a single pointer
like it was previously expected.
2022-12-04 18:21:59 +01:00
Jules Aguillon
e745c81269 Allow using a custom layout
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-26 22:30:45 +01:00
Jules Aguillon
09d984a1ab Refactor: Use XmlPullParser directly
XmlResourceParser is convenient but cannot be easily instantiated.
2022-11-26 22:16:48 +01:00
Jules Aguillon
69994a55c5 Refactor: Pass layout as a KeyboardData instead of ID
Parse layouts sooner.
2022-11-26 22:14:29 +01:00
Jules Aguillon
122a9c23d0 Make fake pointers not lockable
Especially annoying now that modifiers are not locked by a double tap.
2022-11-26 17:22:31 +01:00
Jules Aguillon
6fb15b3f16 Stop using deprecated 'shouldOfferSwitchingToNextInputMethod'
This function has been introduced in API 19 and deprecated in API 28.
There was no version check for API 19 but instead of adding these,
simply remove the feature for API under 28.
2022-11-26 15:46:45 +01:00
Jules Aguillon
f7e16c0345 Fix missing version check
setSystemGestureExclusionRects is API 29. Broken since d644d2b, which
almost got into the release!
2022-11-13 20:59:40 +01:00
Jules Aguillon
64c7c8ce20 Draw borders and update themes
Themes can define the color of each borders independently. Every borders
must have the same width for now. It's possible to set a different width
when the key is activated, thought this is only used to remove borders.

The 4 themes are updated to take advantage of borders.
2022-11-13 20:53:06 +01:00
Jules Aguillon
c1751578ef Highlight activated keys label
Rendering change only.
2022-11-13 18:03:01 +01:00
Jules Aguillon
2aa98de7aa Add editing keys: copy, paste, cut, select all 2022-11-13 16:45:57 +01:00
Jules Aguillon
078dbcd5ff Refactor: Move editing code from to KeyEventHandler
Remove the code dealing with InputMethodConnection from 'Keyboard2' and
move it into 'KeyEventHandler', where more editing actions can now be
implemented.

Autocapitalisation is also moved, the IReceiver interface is simplified.
2022-11-13 16:28:39 +01:00
Jules Aguillon
22a7df6632 Refactor: Use enum values in KeyValue.Kind
instead of maintaining a separate set of constants and a conversion
function.
2022-11-13 15:19:50 +01:00
Jules Aguillon
e213834f67 Don't depend on dpi values in swipe distance
The dpi values "xdpi" and "ydpi" can have wildly different values on
different devices.

The new computation defines a baseline and only take into account the
dpi values as a ratio.

On a 480dpi screen (in both directions), this decrease the value by
about 18%. This new distance felt better during testing.
2022-11-13 14:43:53 +01:00
Jules Aguillon
b102ad9078 Fix localized keys appearing on secondary layout 2022-11-13 00:39:31 +01:00
Jules Aguillon
51b330c616 Allow switching quickly between two layouts
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-13 00:24:23 +01:00