mirror of
https://github.com/Julow/Unexpected-Keyboard.git
synced 2025-08-17 21:01:19 +02:00
Compare commits
3 Commits
sel-mode-f
...
settings-h
Author | SHA1 | Date | |
---|---|---|---|
757dff4583 | |||
8d69be7f23 | |||
3f8a0ffe1e |
91
funding.json
91
funding.json
@ -1,91 +0,0 @@
|
||||
{
|
||||
"version": "v1.0.0",
|
||||
"entity": {
|
||||
"type": "individual",
|
||||
"role": "owner",
|
||||
"name": "Julow",
|
||||
"email": "jules@j3s.fr",
|
||||
"description": "Open source developer and maintainer of Unexpected Keyboard.",
|
||||
"webpageUrl": {
|
||||
"url": "https://github.com/Julow"
|
||||
}
|
||||
},
|
||||
"projects": [
|
||||
{
|
||||
"guid": "unexpected-keyboard",
|
||||
"name": "Unexpected Keyboard",
|
||||
"description": "Lightweight and privacy-conscious virtual keyboard for Android.",
|
||||
"webpageUrl": {
|
||||
"url": "https://github.com/Julow/Unexpected-Keyboard/"
|
||||
},
|
||||
"repositoryUrl": {
|
||||
"url": "https://github.com/Julow/Unexpected-Keyboard/"
|
||||
},
|
||||
"licenses": [
|
||||
"spdx:GPL-3.0",
|
||||
"spdx:CC0-1.0"
|
||||
],
|
||||
"tags": [
|
||||
"android",
|
||||
"mobile",
|
||||
"privacy",
|
||||
"productivity",
|
||||
"programming",
|
||||
"user-experience"
|
||||
]
|
||||
}
|
||||
],
|
||||
"funding": {
|
||||
"channels": [
|
||||
{
|
||||
"guid": "liberapay",
|
||||
"type": "other",
|
||||
"address": "https://liberapay.com/Julow/",
|
||||
"description": "Recurring donations for funding Unexpected Keyboard."
|
||||
},
|
||||
{
|
||||
"guid": "github-sponsors",
|
||||
"type": "other",
|
||||
"address": "https://github.com/sponsors/Julow",
|
||||
"description": "Recurring donations for funding Unexpected Keyboard."
|
||||
},
|
||||
{
|
||||
"guid": "paypal",
|
||||
"type": "other",
|
||||
"address": "https://paypal.me/JulesAguillon",
|
||||
"description": "One-time donations for funding Unexpected-keyboard."
|
||||
}
|
||||
],
|
||||
"plans": [
|
||||
{
|
||||
"guid": "fund-maintenance",
|
||||
"status": "active",
|
||||
"name": "Fund developer time",
|
||||
"description": "Help the maintainers spend time on Unexpected Keyboard",
|
||||
"amount": 0,
|
||||
"currency": "EUR",
|
||||
"frequency": "monthly",
|
||||
"channels": [
|
||||
"liberapay",
|
||||
"github-sponsors",
|
||||
"paypal"
|
||||
]
|
||||
},
|
||||
{
|
||||
"guid": "one-time-contribution",
|
||||
"status": "active",
|
||||
"name": "Fund developer time",
|
||||
"description": "Help the maintainers spend time on Unexpected Keyboard",
|
||||
"amount": 0,
|
||||
"currency": "EUR",
|
||||
"frequency": "one-time",
|
||||
"channels": [
|
||||
"liberapay",
|
||||
"github-sponsors",
|
||||
"paypal"
|
||||
]
|
||||
}
|
||||
],
|
||||
"history": []
|
||||
}
|
||||
}
|
@ -49,7 +49,7 @@ public final class ClipboardHistoryService
|
||||
/** The maximum size limits the amount of user data stored in memory but also
|
||||
gives a sense to the user that the history is not persisted and can be
|
||||
forgotten as soon as the app stops. */
|
||||
public static final int MAX_HISTORY_SIZE = 6;
|
||||
public static final int MAX_HISTORY_SIZE = 3;
|
||||
/** Time in ms until history entries expire. */
|
||||
public static final long HISTORY_TTL_MS = 5 * 60 * 1000;
|
||||
|
||||
|
@ -78,11 +78,6 @@ public final class KeyEventHandler
|
||||
case Compose_pending:
|
||||
_autocap.stop();
|
||||
break;
|
||||
case Slider:
|
||||
// Don't wait for the next key_up and move the cursor right away. This
|
||||
// is called after the trigger distance have been travelled.
|
||||
handle_slider(key.getSlider(), key.getSliderRepeat(), true);
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
@ -104,7 +99,7 @@ public final class KeyEventHandler
|
||||
case Modifier: break;
|
||||
case Editing: handle_editing_key(key.getEditing()); break;
|
||||
case Compose_pending: _recv.set_compose_pending(true); break;
|
||||
case Slider: handle_slider(key.getSlider(), key.getSliderRepeat(), false); break;
|
||||
case Slider: handle_slider(key.getSlider(), key.getSliderRepeat()); break;
|
||||
case Macro: evaluate_macro(key.getMacro()); break;
|
||||
}
|
||||
update_meta_state(old_mods);
|
||||
@ -266,7 +261,7 @@ public final class KeyEventHandler
|
||||
}
|
||||
|
||||
/** [r] might be negative, in which case the direction is reversed. */
|
||||
void handle_slider(KeyValue.Slider s, int r, boolean key_down)
|
||||
void handle_slider(KeyValue.Slider s, int r)
|
||||
{
|
||||
switch (s)
|
||||
{
|
||||
@ -274,8 +269,8 @@ public final class KeyEventHandler
|
||||
case Cursor_right: move_cursor(r); break;
|
||||
case Cursor_up: move_cursor_vertical(-r); break;
|
||||
case Cursor_down: move_cursor_vertical(r); break;
|
||||
case Selection_cursor_left: move_cursor_sel(r, true, key_down); break;
|
||||
case Selection_cursor_right: move_cursor_sel(r, false, key_down); break;
|
||||
case Selection_cursor_left: move_cursor_sel(r, true); break;
|
||||
case Selection_cursor_right: move_cursor_sel(r, false); break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -315,7 +310,7 @@ public final class KeyEventHandler
|
||||
|
||||
/** Move one of the two side of a selection. If [sel_left] is true, the left
|
||||
position is moved, otherwise the right position is moved. */
|
||||
void move_cursor_sel(int d, boolean sel_left, boolean key_down)
|
||||
void move_cursor_sel(int d, boolean sel_left)
|
||||
{
|
||||
InputConnection conn = _recv.getCurrentInputConnection();
|
||||
if (conn == null)
|
||||
@ -325,23 +320,10 @@ public final class KeyEventHandler
|
||||
{
|
||||
int sel_start = et.selectionStart;
|
||||
int sel_end = et.selectionEnd;
|
||||
// Reorder the selection when the slider has just been pressed. The
|
||||
// selection might have been reversed if one end crossed the other end
|
||||
// with a previous slider.
|
||||
if (key_down && sel_start > sel_end)
|
||||
{
|
||||
sel_start = et.selectionEnd;
|
||||
sel_end = et.selectionStart;
|
||||
}
|
||||
do
|
||||
{
|
||||
if (sel_left)
|
||||
sel_start += d;
|
||||
else
|
||||
sel_end += d;
|
||||
// Move the cursor twice if moving it once would make the selection
|
||||
// empty and stop selection mode.
|
||||
} while (sel_start == sel_end);
|
||||
if (sel_left == (sel_start <= sel_end))
|
||||
sel_start += d;
|
||||
else
|
||||
sel_end += d;
|
||||
if (conn.setSelection(sel_start, sel_end))
|
||||
return; // Fallback to sending key events if [setSelection] failed
|
||||
}
|
||||
|
@ -306,6 +306,7 @@ public final class Pointers implements Handler.Callback
|
||||
// Start sliding mode
|
||||
if (new_value.getKind() == KeyValue.Kind.Slider)
|
||||
startSliding(ptr, x, y, dx, dy, new_value);
|
||||
_handler.onPointerDown(new_value, true);
|
||||
}
|
||||
|
||||
}
|
||||
@ -468,7 +469,7 @@ public final class Pointers implements Handler.Callback
|
||||
stopLongPress(ptr);
|
||||
ptr.flags |= FLAG_P_SLIDING;
|
||||
ptr.sliding = new Sliding(x, y, dirx, diry, kv.getSlider());
|
||||
_handler.onPointerDown(kv, true);
|
||||
_handler.onPointerHold(kv, ptr.modifiers);
|
||||
}
|
||||
|
||||
/** Return the [FLAG_P_*] flags that correspond to pressing [kv]. */
|
||||
|
Reference in New Issue
Block a user