From bf3b9c374e1e68b1244da392666b571ab37e51fb Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sat, 6 Jul 2024 22:16:37 +0200 Subject: Clipboard pane (#681) This adds the clipboard pane, which allows to save an arbitrary number of clipboards and to paste them later. The key can be disabled in settings. Checking the "Recently copied text" checkbox will cause the keyboard to keep a temporary history of copied text. This history can only contain 3 elements which expire after 5 minutes. If this is unchecked, no history is collected. History entries can be pinned into the persisted list of pins. --- srcs/juloo.keyboard2/KeyEventHandler.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'srcs/juloo.keyboard2/KeyEventHandler.java') diff --git a/srcs/juloo.keyboard2/KeyEventHandler.java b/srcs/juloo.keyboard2/KeyEventHandler.java index b6225f1..087ac5b 100644 --- a/srcs/juloo.keyboard2/KeyEventHandler.java +++ b/srcs/juloo.keyboard2/KeyEventHandler.java @@ -10,7 +10,9 @@ import android.view.inputmethod.ExtractedTextRequest; import android.view.inputmethod.InputConnection; import java.util.Iterator; -public final class KeyEventHandler implements Config.IKeyEventHandler +public final class KeyEventHandler + implements Config.IKeyEventHandler, + ClipboardHistoryService.ClipboardPasteCallback { IReceiver _recv; Autocapitalisation _autocap; @@ -105,6 +107,12 @@ public final class KeyEventHandler implements Config.IKeyEventHandler update_meta_state(mods); } + @Override + public void paste_from_clipboard_pane(String content) + { + send_text(content); + } + /** Update [_mods] to be consistent with the [mods], sending key events if needed. */ void update_meta_state(Pointers.Modifiers mods) -- cgit v1.2.3