@@ -76,22 +76,22 @@ class SimpleKeyboardIME : InputMethodService(), MyKeyboardView.OnKeyboardActionL
7676 return
7777 }
7878
79- if (keyboardMode != KEYBOARD_LETTERS || ShiftState .isInputTypePassword (inputTypeClassVariation)) {
79+ if (keyboardMode != KEYBOARD_LETTERS || ShiftState .isInputTypePasswordOrEmail (inputTypeClassVariation)) {
8080 return
8181 }
8282
8383 val text = currentInputConnection.getTextBeforeCursor(2 , 0 ) ? : return
84- // Capitalize first letter on startup or if text is empty
84+ // capitalize first letter on startup or if text is empty
8585 if (code == null || text.isEmpty()) {
8686 keyboard!! .setShifted(ShiftState .ON_ONE_CHAR )
8787 keyboardView?.invalidateAllKeys()
8888 return
8989 }
9090
91- // Capitalize sentences if needed
91+ // capitalize sentences if needed
9292 if (config.enableSentencesCapitalization) {
9393
94- // Capitalize on Enter click
94+ // capitalize on Enter click
9595 if (code == MyKeyboard .KEYCODE_ENTER ) {
9696 keyboard!! .setShifted(ShiftState .ON_ONE_CHAR )
9797 keyboardView?.invalidateAllKeys()
@@ -104,10 +104,10 @@ class SimpleKeyboardIME : InputMethodService(), MyKeyboardView.OnKeyboardActionL
104104 keyboardView?.invalidateAllKeys()
105105 return
106106 } else {
107- // Try capitalizing based on the editor info like google keep or google messenger apps
107+ // try capitalizing based on the editor info like google keep or google messenger apps
108108 val editorInfo = currentInputEditorInfo
109109
110- if (editorInfo != null && editorInfo.inputType != InputType .TYPE_NULL && keyboard?.mShiftState != ShiftState . ON_PERMANENT ) {
110+ if (editorInfo != null && editorInfo.inputType != InputType .TYPE_NULL ) {
111111 if (currentInputConnection.getCursorCapsMode(editorInfo.inputType) != 0 ) {
112112 keyboard?.setShifted(ShiftState .ON_ONE_CHAR )
113113 keyboardView?.invalidateAllKeys()
@@ -117,7 +117,7 @@ class SimpleKeyboardIME : InputMethodService(), MyKeyboardView.OnKeyboardActionL
117117 }
118118 }
119119
120- // Else just reset shift to OFF
120+ // In other cases reset shift to OFF
121121 keyboard?.setShifted(ShiftState .OFF )
122122 keyboardView?.invalidateAllKeys()
123123 }
@@ -128,6 +128,8 @@ class SimpleKeyboardIME : InputMethodService(), MyKeyboardView.OnKeyboardActionL
128128 return
129129 }
130130
131+ // this.keyboardView.setEditorInfo(EditorInfo)
132+
131133 if (code != MyKeyboard .KEYCODE_SHIFT ) {
132134 lastShiftPressTS = 0
133135 }
0 commit comments