Sdílet prostřednictvím


InputMethod.AccessibilityInputConnection.GetCursorCapsMode(Int32) Method

Definition

Retrieve the current capitalization mode in effect at the current cursor position in the text.

[Android.Runtime.Register("getCursorCapsMode", "(I)I", "", ApiSince=33)]
public int GetCursorCapsMode (int reqModes);
[<Android.Runtime.Register("getCursorCapsMode", "(I)I", "", ApiSince=33)>]
member this.GetCursorCapsMode : int -> int

Parameters

reqModes
Int32

The desired modes to retrieve, as defined by android.text.TextUtils#getCapsMode TextUtils.getCapsMode. These constants are defined so that you can simply pass the current EditorInfo#inputType TextBoxAttribute.contentType value directly in to here.

Returns

the caps mode flags that are in effect at the current cursor position. See TYPE_TEXT_FLAG_CAPS_* in android.text.InputType.

Attributes

Remarks

Retrieve the current capitalization mode in effect at the current cursor position in the text. See android.text.TextUtils#getCapsMode TextUtils.getCapsMode for more information.

This method may fail either if the input connection has become invalid (such as its process crashing) or the client is taking too long to respond with the text (it is given a couple seconds to return). In either case, 0 is returned.

This method does not affect the text in the editor in any way, nor does it affect the selection or composing spans.

<strong>Editor authors:</strong> please be careful of race conditions in implementing this call. An IME can change the cursor position and use this method right away; you need to make sure the returned value is consistent with the results of the latest edits and changes to the cursor position.

Java documentation for android.accessibilityservice.InputMethod.AccessibilityInputConnection.getCursorCapsMode(int).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to