diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 13eaca8..2677270 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -24,7 +24,7 @@
{
+ val selectedText = inputConnection.getSelectedText(0)
+ if (TextUtils.isEmpty(selectedText)) {
+ inputConnection.deleteSurroundingText(1, 0)
+ } else {
+ inputConnection.commitText("", 1)
+ }
+ caps = !caps
+ keyboard!!.isShifted = caps
+ keyboardView!!.invalidateAllKeys()
+ }
+ Keyboard.KEYCODE_SHIFT -> {
+ caps = !caps
+ keyboard!!.isShifted = caps
+ keyboardView!!.invalidateAllKeys()
+ }
+ Keyboard.KEYCODE_DONE -> inputConnection.sendKeyEvent(KeyEvent(KeyEvent.ACTION_DOWN, KeyEvent.KEYCODE_ENTER))
+ else -> {
+ var code = primaryCode.toChar()
+ if (Character.isLetter(code) && caps) {
+ code = Character.toUpperCase(code)
+ }
+ inputConnection.commitText(code.toString(), 1)
+ }
+ }
+ }
+ }
+
+ override fun onText(text: CharSequence?) {}
+
+ override fun swipeLeft() {}
+
+ override fun swipeRight() {}
+
+ override fun swipeDown() {}
+
+ override fun swipeUp() {}
+}
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index 2956f31..bd64030 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -17,4 +17,12 @@
android:text="@string/change_keyboard" />
+
+
+
diff --git a/app/src/main/res/layout/keyboard_preview.xml b/app/src/main/res/layout/keyboard_preview.xml
new file mode 100644
index 0000000..69c3510
--- /dev/null
+++ b/app/src/main/res/layout/keyboard_preview.xml
@@ -0,0 +1,7 @@
+
diff --git a/app/src/main/res/layout/keyboard_view.xml b/app/src/main/res/layout/keyboard_view.xml
new file mode 100644
index 0000000..e604c87
--- /dev/null
+++ b/app/src/main/res/layout/keyboard_view.xml
@@ -0,0 +1,7 @@
+
diff --git a/app/src/main/res/xml/keys_layout.xml b/app/src/main/res/xml/keys_layout.xml
new file mode 100644
index 0000000..36fd274
--- /dev/null
+++ b/app/src/main/res/xml/keys_layout.xml
@@ -0,0 +1,172 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/xml/method.xml b/app/src/main/res/xml/method.xml
index ce43852..3acad80 100644
--- a/app/src/main/res/xml/method.xml
+++ b/app/src/main/res/xml/method.xml
@@ -1,11 +1,8 @@
+ android:settingsActivity="com.simplemobiletools.keyboard.activities.SettingsActivity">
-
+