mirror of
				https://github.com/SimpleMobileTools/Simple-Keyboard.git
				synced 2025-06-05 21:49:26 +02:00 
			
		
		
		
	Fixed some wrong capitalizing scenarios
This commit is contained in:
		| @@ -17,7 +17,8 @@ import com.simplemobiletools.keyboard.extensions.config | |||||||
| import com.simplemobiletools.keyboard.helpers.* | import com.simplemobiletools.keyboard.helpers.* | ||||||
| import com.simplemobiletools.keyboard.interfaces.OnKeyboardActionListener | import com.simplemobiletools.keyboard.interfaces.OnKeyboardActionListener | ||||||
| import com.simplemobiletools.keyboard.views.MyKeyboardView | import com.simplemobiletools.keyboard.views.MyKeyboardView | ||||||
| import kotlinx.android.synthetic.main.keyboard_view_keyboard.view.* | import kotlinx.android.synthetic.main.keyboard_view_keyboard.view.keyboard_holder | ||||||
|  | import kotlinx.android.synthetic.main.keyboard_view_keyboard.view.keyboard_view | ||||||
|  |  | ||||||
| // based on https://www.androidauthority.com/lets-build-custom-keyboard-android-832362/ | // based on https://www.androidauthority.com/lets-build-custom-keyboard-android-832362/ | ||||||
| class SimpleKeyboardIME : InputMethodService(), OnKeyboardActionListener, SharedPreferences.OnSharedPreferenceChangeListener { | class SimpleKeyboardIME : InputMethodService(), OnKeyboardActionListener, SharedPreferences.OnSharedPreferenceChangeListener { | ||||||
| @@ -67,11 +68,11 @@ class SimpleKeyboardIME : InputMethodService(), OnKeyboardActionListener, Shared | |||||||
|         keyboard = createNewKeyboard() |         keyboard = createNewKeyboard() | ||||||
|         keyboardView?.setKeyboard(keyboard!!) |         keyboardView?.setKeyboard(keyboard!!) | ||||||
|         keyboardView?.setEditorInfo(attribute) |         keyboardView?.setEditorInfo(attribute) | ||||||
|         updateShiftKeyState(null) |         updateShiftKeyState() | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     private fun updateShiftKeyState(code: Int?) { |     private fun updateShiftKeyState() { | ||||||
|         if (code == MyKeyboard.KEYCODE_SHIFT) { |         if (keyboard!!.mShiftState == ShiftState.ON_PERMANENT) { | ||||||
|             return |             return | ||||||
|         } |         } | ||||||
|  |  | ||||||
| @@ -176,10 +177,6 @@ class SimpleKeyboardIME : InputMethodService(), OnKeyboardActionListener, Shared | |||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  |  | ||||||
|         if (keyboard!!.mShiftState != ShiftState.ON_PERMANENT) { |  | ||||||
|             updateShiftKeyState(code) |  | ||||||
|         } |  | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     override fun onActionUp() { |     override fun onActionUp() { | ||||||
| @@ -250,6 +247,7 @@ class SimpleKeyboardIME : InputMethodService(), OnKeyboardActionListener, Shared | |||||||
|         if (newSelStart == newSelEnd) { |         if (newSelStart == newSelEnd) { | ||||||
|             keyboardView?.closeClipboardManager() |             keyboardView?.closeClipboardManager() | ||||||
|         } |         } | ||||||
|  |         updateShiftKeyState() | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     private fun moveCursor(moveRight: Boolean) { |     private fun moveCursor(moveRight: Boolean) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user