openharmony 鸿蒙 js-apis-accessibility-sys

2026-08-25 浏览 (1)

@ohos.accessibility (Accessibility) (System API)

The Accessibility module provides accessibility event types and operations executable on accessibility nodes.

NOTE

  • The initial APIs of this module are supported since API version 20. Newly added APIs will be marked with a superscript to indicate their earliest API version.
  • This topic describes only the system APIs provided by the module. For details about other public APIs, see @ohos.accessibility.

Modules to Import

import { accessibility } from '@kit.AccessibilityKit';

AccessibilityEventType

Enumerates accessibility event types.

System API: This is a system API.

System capability: SystemCapability.BarrierFree.Accessibility.Core

NameValueDescription
TYPE_ACCESSIBILITY_FOCUS0Event of gaining an accessibility focus.
TYPE_ACCESSIBILITY_FOCUS_CLEAR1Event of clearing an accessibility focus.
TYPE_CLICK2Event of clicking a component.
TYPE_LONG_CLICK3Event of long pressing a component.
TYPE_SELECT4Event of selecting a component.
TYPE_HOVER_ENTER5Event indicating the mouse pointer enters a component.
TYPE_HOVER_EXIT6Event indicating the mouse pointer exits a component.
TYPE_FOCUS7Event indicating the component gains a focus.
TYPE_TEXT_UPDATE8Event indicating the component text has been updated.
TYPE_TEXT_SELECTION_UPDATE9Event indicating the selected text has been updated.
TYPE_SCROLL10Event of scrolling the view.
TYPE_REQUEST_FOCUS_FOR_ACCESSIBILITY11Event of auto-focusing.
TYPE_ANNOUNCE_FOR_ACCESSIBILITY12Event of auto-broadcasting.
TYPE_REQUEST_FOCUS_FOR_ACCESSIBILITY_NOT_INTERRUPT13Event of auto-focusing without interruption.
TYPE_ANNOUNCE_FOR_ACCESSIBILITY_NOT_INTERRUPT14Event of auto-broadcasting without interruption.
TYPE_ELEMENT_INFO_CHANGE15Event indicating the component information changes.
TYPE_SCROLLING16Event indicating an item is scrolled out of the screen.
TYPE_WINDOW_ADD17Event of adding windows.
TYPE_WINDOW_REMOVE18Event of deleting windows.
TYPE_WINDOW_BOUNDS19Event indicating the window boundary changes.
TYPE_WINDOW_ACTIVE20Event indicating the window activity state changes.
TYPE_WINDOW_FOCUS21Event indicating the window focus changes.
TYPE_WINDOW_PROPERTY22Event indicating the window properties change, such as opacity, size, and so on.
TYPE_WINDOW_LAYER23Event indicating the window layer changes.
TYPE_TOUCH_BEGIN24Event indicating a touch begins.
TYPE_TOUCH_END25Event indicating a touch ends.
TYPE_PAGE_CONTENT_UPDATE26Event indicating the page content is updated.
TYPE_PAGE_STATE_UPDATE27Event indicating the page state is updated.
TYPE_PAGE_OPEN28Event of opening a page.
TYPE_PAGE_CLOSE29Event of closing a page.
TYPE_SWIPE_LEFT30Event indicating the swipe-left gesture.
TYPE_SWIPE_LEFT_THEN_RIGHT31Event indicating the swipe-left-then-right gesture.
TYPE_SWIPE_LEFT_THEN_UP32Event indicating the swipe-left-then-up gesture.
TYPE_SWIPE_LEFT_THEN_DOWN33Event indicating the swipe-left-then-down gesture.
TYPE_SWIPE_RIGHT34Event indicating the swipe-right gesture.
TYPE_SWIPE_RIGHT_THEN_LEFT35Event indicating the swipe-right-then-left gesture.
TYPE_SWIPE_RIGHT_THEN_UP36Event indicating the swipe-right-then-up gesture.
TYPE_SWIPE_RIGHT_THEN_DOWN37Event indicating the swipe-right-then-down gesture.
TYPE_SWIPE_UP38Event indicating the swipe-up gesture.
TYPE_SWIPE_UP_THEN_LEFT39Event indicating the swipe-up-then-left gesture.
TYPE_SWIPE_UP_THEN_RIGHT40Event indicating the swipe-up-then-right gesture.
TYPE_SWIPE_UP_THEN_DOWN41Event indicating the swipe-up-then-down gesture.
TYPE_SWIPE_DOWN42Event indicating the swipe-down gesture.
TYPE_SWIPE_DOWN_THEN_LEFT43Event indicating the swipe-down-then-left gesture.
TYPE_SWIPE_DOWN_THEN_RIGHT44Event indicating the swipe-down-then-right gesture.
TYPE_SWIPE_DOWN_THEN_UP45Event indicating the swipe-down-then-up gesture.
TYPE_TWO_FINGER_SINGLE_TAP46Event indicating the two-finger single-tap gesture.
TYPE_TWO_FINGER_DOUBLE_TAP47Event indicating the two-finger double-tap gesture.
TYPE_TWO_FINGER_DOUBLE_TAP_AND_HOLD48Event indicating the two-finger double-tap-and-hold gesture.
TYPE_TWO_FINGER_TRIPLE_TAP49Event indicating the two-finger triple-tap gesture.
TYPE_TWO_FINGER_TRIPLE_TAP_AND_HOLD50Event indicating the two-finger triple-tap-and-hold gesture.
TYPE_THREE_FINGER_SINGLE_TAP51Event indicating the three-finger single-tap gesture.
TYPE_THREE_FINGER_DOUBLE_TAP52Event indicating the three-finger double-tap gesture.
TYPE_THREE_FINGER_DOUBLE_TAP_AND_HOLD53Event indicating the three-finger double-tap-and-hold gesture.
TYPE_THREE_FINGER_TRIPLE_TAP54Event indicating the three-finger triple-tap gesture.
TYPE_THREE_FINGER_TRIPLE_TAP_AND_HOLD55Event indicating the three-finger triple-tap-and-hold gesture.
TYPE_FOUR_FINGER_SINGLE_TAP56Event indicating the four-finger single-tap gesture.
TYPE_FOUR_FINGER_DOUBLE_TAP57Event indicating the four-finger double-tap gesture.
TYPE_FOUR_FINGER_DOUBLE_TAP_AND_HOLD58Event indicating the four-finger double-tap-and-hold gesture.
TYPE_FOUR_FINGER_TRIPLE_TAP59Event indicating the four-finger triple-tap gesture.
TYPE_FOUR_FINGER_TRIPLE_TAP_AND_HOLD60Event indicating the four-finger triple-tap-and-hold gesture.
TYPE_THREE_FINGER_SWIPE_UP61Event indicating the three-finger swipe-up gesture.
TYPE_THREE_FINGER_SWIPE_DOWN62Event indicating the three-finger swipe-down gesture.
TYPE_THREE_FINGER_SWIPE_LEFT63Event indicating the three-finger swipe-left gesture.
TYPE_THREE_FINGER_SWIPE_RIGHT64Event indicating the three-finger swipe-right gesture.
TYPE_FOUR_FINGER_SWIPE_UP65Event indicating the four-finger swipe-up gesture.
TYPE_FOUR_FINGER_SWIPE_DOWN66Event indicating the four-finger swipe-down gesture.
TYPE_FOUR_FINGER_SWIPE_LEFT67Event indicating the four-finger swipe-left gesture.
TYPE_FOUR_FINGER_SWIPE_RIGHT68Event indicating the four-finger swipe-right gesture.
TYPE_PAGE_ACTIVE23+69Event indicating the page is active.

AccessibilityAction

Enumerates executable actions for accessibility node elements.

Accessibility node elements are UI components that support accessibility actions, such as buttons, text boxes, and so on.

System API: This is a system API.

System capability: SystemCapability.BarrierFree.Accessibility.Core

NameValueDescription
ACCESSIBILITY_FOCUS0Gain an accessibility focus.
CLEAR_ACCESSIBILITY_FOCUS1Clear an accessibility focus.
FOCUS2Gain a focus for a component.
CLEAR_FOCUS3Clear a focus for a component.
CLICK4Click a component.
LONG_CLICK5Long press a component.
CUT6Cut the content of a component.
COPY7Copy the content of a component.
PASTE8Paste the content into a component.
SELECT9Select a component.
SET_TEXT10Set the text of a component.
SCROLL_FORWARD11Scroll a component forward.
SCROLL_BACKWARD12Scroll a component backward.
SET_SELECTION13Select a text range in a component.
SET_CURSOR_POSITION14Set the cursor position in a component.
HOME15Return to the home screen.
BACK16Return to the previous screen.
RECENT_TASK17Open a recent task.
NOTIFICATION_CENTER18Open the notification center.
CONTROL_CENTER19Open the control center.
SPAN_CLICK20Click a text span.

FocusMoveResultCode23+

Enumerates the result codes returned by the focusable node query.

System API: This is a system API.

System capability: SystemCapability.BarrierFree.Accessibility.Core

NameValueDescription
NOT_SUPPORTED-1Query is not supported.
SEARCH_SUCCESS0The node is queried successfully.
SEARCH_SUCCESS_NEXT_BYPASS_DESCENDANTS1The node is queried successfully. Use the bypassSelfDescendants parameter to quickly obtain the result in the next query.
SEARCH_FAILURE2Failed to query the node. The current page has no focusable node.
SEARCH_FAILURE_IN_CHILD_TREE3Failed to query the node. The current container has no focusable node.
SEARCH_FAILURE_LOST_NODE4Failed to query the node. The start node is not found.
SEARCH_NEXT5The returned node is not focusable. Continue to query from the returned node.
DOUBLE_CHECK_CHILD_PROPERTY6The returned node is not focusable. Continue to query from all descendants of the returned node.
DOUBLE_CHECK_CHILD_PROPERTY_AND_GET_LAST7The returned node is not focusable. Continue to query from the last child node of the returned node.
SEARCH_FAILURE_IN_SCROLL8Failed to query the node in the scrollable component.

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 js-apis-accessibility-GesturePoint

openharmony 鸿蒙 js-apis-application-accessibilityExtensionAbility-sys

openharmony 鸿蒙 js-apis-inner-application-accessibilityExtensionContext

openharmony 鸿蒙 js-apis-accessibility

openharmony 鸿蒙 Readme-EN

openharmony 鸿蒙 js-apis-accessibility-config-sys

openharmony 鸿蒙 js-apis-inner-application-accessibilityExtensionContext-sys

openharmony 鸿蒙 errorcode-accessibility

openharmony 鸿蒙 js-apis-application-accessibilityExtensionAbility

openharmony 鸿蒙 js-apis-accessibility-GesturePath

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/noBi6md9