Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public static int getCode(final String name) {
"key_output_text",
"key_delete",
"key_settings",
"key_paste",
"key_action_next",
"key_action_previous",
"key_shift_enter",
Expand All @@ -64,6 +65,7 @@ public static int getCode(final String name) {
Constants.CODE_OUTPUT_TEXT,
Constants.CODE_DELETE,
Constants.CODE_SETTINGS,
Constants.CODE_PASTE,
Constants.CODE_ACTION_NEXT,
Constants.CODE_ACTION_PREVIOUS,
Constants.CODE_SHIFT_ENTER,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ public final class KeyboardIconsSet {
public static final String NAME_SHIFT_KEY_SHIFTED = "shift_key_shifted";
public static final String NAME_DELETE_KEY = "delete_key";
public static final String NAME_SETTINGS_KEY = "settings_key";
public static final String NAME_PASTE_KEY = "paste_key";
public static final String NAME_SPACE_KEY = "space_key";
public static final String NAME_SPACE_KEY_FOR_NUMBER_LAYOUT = "space_key_for_number_layout";
public static final String NAME_ENTER_KEY = "enter_key";
Expand All @@ -62,6 +63,7 @@ public final class KeyboardIconsSet {
NAME_SHIFT_KEY, R.styleable.Keyboard_iconShiftKey,
NAME_DELETE_KEY, R.styleable.Keyboard_iconDeleteKey,
NAME_SETTINGS_KEY, R.styleable.Keyboard_iconSettingsKey,
NAME_PASTE_KEY, R.styleable.Keyboard_iconPasteKey,
NAME_SPACE_KEY, R.styleable.Keyboard_iconSpaceKey,
NAME_ENTER_KEY, R.styleable.Keyboard_iconEnterKey,
NAME_GO_KEY, R.styleable.Keyboard_iconGoKey,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ public static String[] getTextsTable(final Locale locale) {
// U+2205: "∅" EMPTY SET
/* morekeys_symbols_0 */ "\u207F,\u2205",
/* morekeys_am_pm */ "!fixedColumnOrder!2,!hasLabels!,!text/keylabel_time_am,!text/keylabel_time_pm",
/* keyspec_settings */ "!icon/settings_key|!code/key_settings",
/* keyspec_settings */ "!icon/paste_key|!code/key_paste,!icon/settings_key|!code/key_settings",
/* keyspec_action_next */ "!code/key_action_next",
/* keyspec_action_previous */ "!code/key_action_previous",
// Label for "switch to more symbol" modifier key ("= \ <"). Must be short to fit on key!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
package rkr.simplekeyboard.inputmethod.latin;

import android.annotation.TargetApi;
import android.content.ClipboardManager;
import android.content.Context;
import android.os.Build;
import android.util.Log;
import android.view.KeyEvent;
Expand Down Expand Up @@ -318,6 +320,16 @@ public void performEditorAction(final int actionId) {
}
}

public void pasteClipboard() {
ClipboardManager clipboard = (ClipboardManager) mLatinIME.getSystemService(Context.CLIPBOARD_SERVICE);
if (clipboard.hasPrimaryClip() && clipboard.getPrimaryClip().getItemCount() > 0) {
CharSequence pasteData = clipboard.getPrimaryClip().getItemAt(0).getText();
if (pasteData != null && pasteData.length() > 0) {
mLatinIME.onTextInput(pasteData.toString());
}
}
}

public void sendKeyEvent(final KeyEvent keyEvent) {
RichInputMethodManager.getInstance().resetSubtypeCycleOrder();
if (keyEvent.getAction() == KeyEvent.ACTION_DOWN) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ public static boolean isValidCoordinate(final int coordinate) {
public static final int CODE_OUTPUT_TEXT = -4;
public static final int CODE_DELETE = -5;
public static final int CODE_SETTINGS = -6;
public static final int CODE_PASTE = -7;
public static final int CODE_ACTION_NEXT = -8;
public static final int CODE_ACTION_PREVIOUS = -9;
public static final int CODE_LANGUAGE_SWITCH = -10;
Expand All @@ -113,6 +114,7 @@ public static String printableCode(final int code) {
case CODE_OUTPUT_TEXT: return "text";
case CODE_DELETE: return "delete";
case CODE_SETTINGS: return "settings";
case CODE_PASTE: return "paste";
case CODE_ACTION_NEXT: return "actionNext";
case CODE_ACTION_PREVIOUS: return "actionPrevious";
case CODE_LANGUAGE_SWITCH: return "languageSwitch";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package rkr.simplekeyboard.inputmethod.latin.inputlogic;

import android.content.ClipboardManager;
import android.os.SystemClock;
import android.text.TextUtils;
import android.view.KeyCharacterMap;
Expand Down Expand Up @@ -196,6 +197,9 @@ private void handleFunctionalEvent(final Event event, final InputTransaction inp
case Constants.CODE_SETTINGS:
onSettingsKeyPressed();
break;
case Constants.CODE_PASTE:
mConnection.pasteClipboard();
break;
case Constants.CODE_ACTION_NEXT:
performEditorAction(EditorInfo.IME_ACTION_NEXT);
break;
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions app/src/main/res/drawable-v24/sym_keyboard_paste_lxx_system.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="@color/key_functional_text_color_lxx_system">
<path
android:fillColor="@android:color/white"
android:pathData="M19,2h-4.18C14.4,0.84 13.3,0 12,0c-1.3,0 -2.4,0.84 -2.82,2L5,2c-1.1,0 -2,0.9 -2,2v16c0,1.1 0.9,2 2,2h14c1.1,0 2,-0.9 2,-2L21,4c0,-1.1 -0.9,-2 -2,-2zM12,2c0.55,0 1,0.45 1,1s-0.45,1 -1,1 -1,-0.45 -1,-1 0.45,-1 1,-1zM19,20L5,20L5,4h2v3h10L17,4h2v16z"/>
</vector>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/src/main/res/values-v24/keyboard-icons-lxx-system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<item name="iconShiftKey">@drawable/sym_keyboard_shift_lxx_system</item>
<item name="iconDeleteKey">@drawable/sym_keyboard_delete_lxx_system</item>
<item name="iconSettingsKey">@drawable/sym_keyboard_settings_lxx_system</item>
<item name="iconPasteKey">@drawable/sym_keyboard_paste_lxx_system</item>
<item name="iconSpaceKey">@null</item>
<item name="iconEnterKey">@drawable/sym_keyboard_return_lxx_system</item>
<item name="iconGoKey">@drawable/sym_keyboard_go_lxx_system</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/attrs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
<attr name="iconShiftKey" format="reference" />
<attr name="iconDeleteKey" format="reference" />
<attr name="iconSettingsKey" format="reference" />
<attr name="iconPasteKey" format="reference" />
<attr name="iconSpaceKey" format="reference" />
<attr name="iconEnterKey" format="reference" />
<attr name="iconGoKey" format="reference" />
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/keyboard-icons-lxx-dark.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<item name="iconShiftKey">@drawable/sym_keyboard_shift_lxx_dark</item>
<item name="iconDeleteKey">@drawable/sym_keyboard_delete_lxx_dark</item>
<item name="iconSettingsKey">@drawable/sym_keyboard_settings_lxx_dark</item>
<item name="iconPasteKey">@drawable/sym_keyboard_paste_lxx_dark</item>
<item name="iconSpaceKey">@null</item>
<item name="iconEnterKey">@drawable/sym_keyboard_return_lxx_dark</item>
<item name="iconGoKey">@drawable/sym_keyboard_go_lxx_dark</item>
Expand Down
1 change: 1 addition & 0 deletions app/src/main/res/values/keyboard-icons-lxx-light.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<item name="iconShiftKey">@drawable/sym_keyboard_shift_lxx_light</item>
<item name="iconDeleteKey">@drawable/sym_keyboard_delete_lxx_light</item>
<item name="iconSettingsKey">@drawable/sym_keyboard_settings_lxx_light</item>
<item name="iconPasteKey">@drawable/sym_keyboard_paste_lxx_light</item>
<item name="iconSpaceKey">@null</item>
<item name="iconEnterKey">@drawable/sym_keyboard_return_lxx_light</item>
<item name="iconGoKey">@drawable/sym_keyboard_go_lxx_light</item>
Expand Down
5 changes: 5 additions & 0 deletions app/src/main/res/xml-sw600dp/key_styles_common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@
latin:keySpec="!icon/settings_key|!code/key_settings"
latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" />
<key-style
latin:styleName="pasteKeyStyle"
latin:keySpec="!icon/paste_key|!code/key_paste"
latin:keyActionFlags="noKeyPreview"
latin:backgroundType="functional" />
<switch>
<case
latin:keyboardLayoutSetElement="alphabetManualShifted"
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/xml/key_styles_common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,12 @@
latin:keyActionFlags="noKeyPreview|altCodeWhileTyping"
latin:altCode="!code/key_space"
latin:backgroundType="functional" />
<key-style
latin:styleName="pasteKeyStyle"
latin:keySpec="!icon/paste_key|!code/key_paste"
latin:keyActionFlags="noKeyPreview|altCodeWhileTyping"
latin:altCode="!code/key_paste"
latin:backgroundType="functional" />
<key-style
latin:styleName="languageSwitchKeyStyle"
latin:keySpec="!icon/language_switch_key|!code/key_language_switch"
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ buildscript {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.7.3'
classpath 'com.android.tools.build:gradle:8.8.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip