build/dts/api/bindings/input/zephyr,input-longpress.html · build/dts/api/bindings/input/zephyr,input-longpress.rst 공식 원문 ↗

Zephyr 3.7.0 · Devicetree · Input · Zephyr-specific binding

Zephyr Input Long-Press 변환 바인딩

기존 key press duration을 short-press 또는 long-press event로 변환를 정의하는 5개 property schema입니다.

Official pathbuild/dts/api/bindings/input/zephyr,input-longpress.html
Source filebuild/dts/api/bindings/input/zephyr,input-longpress.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

본문 기준: Zephyr 3.7.0 LTS3 · 이후 유지보수 패치는 별도입니다.

Part 1

요약·해설

공식 원문 142줄과 property 5행을 전수 대조해 input filtering·parallel code-array mapping·press/release output timing 제약을 보존했습니다.

Compatible

zephyr,input-longpress

Vendor

Zephyr-specific binding

Properties

5 rows

Interface

Input key events → short/long key events

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 EE361542E8D355C3A0E3E729ED6EC2B6D8E0575C7C81BDF19B2961A184427998
:orphan:

.. raw:: html

    <!--
    FIXME: do not limit page width until content uses another representation
    format other than tables
    -->
    <style>.wy-nav-content { max-width: none; !important }</style>

.. dtcompatible:: zephyr,input-longpress
.. _dtbinding_zephyr_input_longpress:

zephyr,input-longpress
######################

Vendor: :ref:`Zephyr-specific binding <dt_vendor_zephyr>`

Description
***********



.. code-block:: none

   Input longpress pseudo-device

   Listens for key events as an input and produces key events as output
   corresponding to short and long press.

   Can be optionally be associated to a specific device to listen for events
   only from that device.

   Example configuration:

   #include <zephyr/dt-bindings/input/input-event-codes.h>

   longpress {
           input = <&buttons>;
           compatible = "zephyr,input-longpress";
           input-codes = <INPUT_KEY_0>, <INPUT_KEY_1>;
           short-codes = <INPUT_KEY_A>, <INPUT_KEY_B>;
           long-codes = <INPUT_KEY_X>, <INPUT_KEY_Y>;
           long-delay-ms = <1000>;
   };

   Example output:

   # short press
   input event: dev=buttons          SYN type= 1 code= 11 value=1 # INPUT_KEY_0 press
   # release before one second
   input event: dev=buttons          SYN type= 1 code= 11 value=0 # INPUT_KEY_0 release
   input event: dev=longpress        SYN type= 1 code= 30 value=1 # INPUT_KEY_A press
   input event: dev=longpress        SYN type= 1 code= 30 value=0 # INPUT_KEY_A release

   # long press
   input event: dev=buttons          SYN type= 1 code= 11 value=1 # INPUT_KEY_0 press
   # hold for more than one second
   input event: dev=longpress        SYN type= 1 code= 45 value=1 # INPUT_KEY_X press
   # wait for release
   input event: dev=buttons          SYN type= 1 code= 11 value=0 # INPUT_KEY_0 release
   input event: dev=longpress        SYN type= 1 code= 45 value=0 # INPUT_KEY_X release

Properties
**********

.. tabs::

   .. group-tab:: Node specific properties

      Properties not inherited from the base binding file.

      .. list-table::
         :widths: 1 1 4
         :header-rows: 1

         * - Name
           - Type
           - Details

         * - ``input``
           - ``phandle``
           - .. code-block:: none

                Input device phandle, if not specified listen for input from all devices.



         * - ``input-codes``
           - ``array``
           - .. code-block:: none

                Array of input event key codes (INPUT_KEY_* or INPUT_BTN_*).



             This property is **required**.

         * - ``short-codes``
           - ``array``
           - .. code-block:: none

                Optional array of key codes to be generated for short press (INPUT_KEY_* or
                INPUT_BTN_*).



         * - ``long-codes``
           - ``array``
           - .. code-block:: none

                Array of key codes to be generated for long press (INPUT_KEY_* or
                INPUT_BTN_*).



             This property is **required**.

         * - ``long-delay-ms``
           - ``int``
           - .. code-block:: none

                Time delay to register a long press in milliseconds.


             This property is **required**.



   .. group-tab:: Deprecated node specific properties

      Deprecated properties not inherited from the base binding file.

      (None)

   .. group-tab:: Base properties

      Properties inherited from the base binding file, which defines
      common properties that may be set on many nodes. Not all of these
      may apply to the "zephyr,input-longpress" compatible.

      (None)


Part 3

한국어 전문 번역

zephyr,input-longpress

Vendor: Zephyr-specific binding

공식 설명

Input longpress pseudo-device

Listens for key events as an input and produces key events as output
corresponding to short and long press.

Can be optionally be associated to a specific device to listen for events
only from that device.

Example configuration:

#include <zephyr/dt-bindings/input/input-event-codes.h>

longpress {
        input = <&buttons>;
        compatible = "zephyr,input-longpress";
        input-codes = <INPUT_KEY_0>, <INPUT_KEY_1>;
        short-codes = <INPUT_KEY_A>, <INPUT_KEY_B>;
        long-codes = <INPUT_KEY_X>, <INPUT_KEY_Y>;
        long-delay-ms = <1000>;
};

Example output:

# short press
input event: dev=buttons          SYN type= 1 code= 11 value=1 # INPUT_KEY_0 press
# release before one second
input event: dev=buttons          SYN type= 1 code= 11 value=0 # INPUT_KEY_0 release
input event: dev=longpress        SYN type= 1 code= 30 value=1 # INPUT_KEY_A press
input event: dev=longpress        SYN type= 1 code= 30 value=0 # INPUT_KEY_A release

# long press
input event: dev=buttons          SYN type= 1 code= 11 value=1 # INPUT_KEY_0 press
# hold for more than one second
input event: dev=longpress        SYN type= 1 code= 45 value=1 # INPUT_KEY_X press
# wait for release
input event: dev=buttons          SYN type= 1 code= 11 value=0 # INPUT_KEY_0 release
input event: dev=longpress        SYN type= 1 code= 45 value=0 # INPUT_KEY_X release

Input long-press pseudo-device

입력 key event를 듣고 press duration에 따라 short 또는 long key event를 새로 생성합니다. input-codes, long-codes, long-delay-ms가 필수이고 short-codes는 선택입니다.

input을 제공하면 특정 device event만 듣고, 생략하면 모든 input device를 듣습니다.

Key press

input-codes의 원본 key

Release before delay

short-codes press + release 생성

Hold beyond delay

long-codes press 생성

Later release

long-codes release 생성

공식 예는 1000 ms보다 일찍 놓으면 INPUT_KEY_A, 넘겨 유지하면 INPUT_KEY_X를 생성합니다. 배열 길이 불일치 처리 규칙은 이 schema에 명시되지 않습니다.

예제에는 compatible이 있지만 공식 property 표는 5개 node 항목뿐이고 base 표는 비어 있습니다. Compatible 행을 임의로 추가하지 않았습니다.

속성 전체 번역

공식 node-specific 5개 property를 번역했으며 base property 표는 비어 있습니다.

노드 전용 속성 · 5개
이름형식설명과 제약
inputphandleEvent를 받을 특정 input device의 phandle입니다.
input-codesarrayCAP1203 channel에 대응할 INPUT_KEY_* 또는 INPUT_BTN_* event code 배열입니다.
필수
short-codesarrayShort press 때 생성할 선택적인 INPUT_KEY_* 또는 INPUT_BTN_* code 배열입니다.
long-codesarrayLong press 때 생성할 INPUT_KEY_* 또는 INPUT_BTN_* code 배열입니다.
필수
long-delay-msintPress를 long press로 판정할 시간이며 millisecond 단위입니다.
필수

Source

출처

영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.