「App:Library:LVGL:docs:Porting:Input device interface」の版間の差分
(→Enums) |
|||
(同じ利用者による、間の12版が非表示) | |||
80行目: | 80行目: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | <span style="background-color: #dbfaf4;>'''Important :'''<BR /> | |
− | + | Touchpad drivers must return the last X/Y coordinates even when the state is LV_INDEV_STATE_REL.</span><BR /> | |
− | + | <BR /> | |
− | |||
To set a mouse cursor use <code style="color: #bb0000;">lv_indev_set_cursor(my_indev, &img_cursor)</code>. (<code style="color: #bb0000;">my_indev</code> is the return value of <code style="color: #bb0000;">lv_indev_drv_register</code>) | To set a mouse cursor use <code style="color: #bb0000;">lv_indev_set_cursor(my_indev, &img_cursor)</code>. (<code style="color: #bb0000;">my_indev</code> is the return value of <code style="color: #bb0000;">lv_indev_drv_register</code>) | ||
|画面上のポイントをクリックできる入力デバイスは、このカテゴリに属します。 | |画面上のポイントをクリックできる入力デバイスは、このカテゴリに属します。 | ||
104行目: | 103行目: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | + | <span style="background-color: #dbfaf4;>'''Important :'''<BR /> | |
− | + | タッチパッドドライバは、状態がLV_INDEV_STATE_RELであっても、最後のX/Y座標を返す必要があります。</span><BR /> | |
− | + | <BR /> | |
− | + | マウスカーソルを設定するには、<code style="color: #bb0000;">lv_indev_set_cursor(my_indev, &img_cursor)</code> を使用します。(<code style="color: #bb0000;">my_indev</code>は<code style="color: #bb0000;">lv_indev_drv_register</code>の戻り値) | |
− | |||
|} | |} | ||
:[[App:Library:LVGL:docs:Porting#Input device interface|戻る : Previous]] | :[[App:Library:LVGL:docs:Porting#Input device interface|戻る : Previous]] | ||
123行目: | 121行目: | ||
* Register a <code style="color: #bb0000;">read_cb</code> function with <code style="color: #bb0000;">LV_INDEV_TYPE_KEYPAD</code> type. | * Register a <code style="color: #bb0000;">read_cb</code> function with <code style="color: #bb0000;">LV_INDEV_TYPE_KEYPAD</code> type. | ||
+ | * Enable <code style="color: #bb0000;">LV_USE_GROUP</code> in lv_conf.h | ||
* An object group has to be created: <code style="color: #bb0000;">lv_group_t * g = lv_group_create()</code> and objects have to be added to it with <code style="color: #bb0000;">lv_group_add_obj(g, obj)</code> | * An object group has to be created: <code style="color: #bb0000;">lv_group_t * g = lv_group_create()</code> and objects have to be added to it with <code style="color: #bb0000;">lv_group_add_obj(g, obj)</code> | ||
* The created group has to be assigned to an input device: <code style="color: #bb0000;">lv_indev_set_group(my_indev, g)</code> (<code style="color: #bb0000;">my_indev</code> is the return value of <code style="color: #bb0000;">lv_indev_drv_register</code>) | * The created group has to be assigned to an input device: <code style="color: #bb0000;">lv_indev_set_group(my_indev, g)</code> (<code style="color: #bb0000;">my_indev</code> is the return value of <code style="color: #bb0000;">lv_indev_drv_register</code>) | ||
* Use <code style="color: #bb0000;">LV_KEY_...</code> to navigate among the objects in the group. See <code style="color: #bb0000;">lv_core/lv_group.h</code> for the available keys. | * Use <code style="color: #bb0000;">LV_KEY_...</code> to navigate among the objects in the group. See <code style="color: #bb0000;">lv_core/lv_group.h</code> for the available keys. | ||
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="c++" style="border: 1px dashed gray;"> |
indev_drv.type = LV_INDEV_TYPE_KEYPAD; | indev_drv.type = LV_INDEV_TYPE_KEYPAD; | ||
indev_drv.read_cb = keyboard_read; | indev_drv.read_cb = keyboard_read; | ||
132行目: | 131行目: | ||
... | ... | ||
− | + | bool keyboard_read(lv_indev_drv_t * drv, lv_indev_data_t*data){ | |
data->key = last_key(); /*Get the last pressed or released key*/ | data->key = last_key(); /*Get the last pressed or released key*/ | ||
if(key_pressed()) data->state = LV_INDEV_STATE_PRESSED; | if(key_pressed()) data->state = LV_INDEV_STATE_PRESSED; | ||
else data->state = LV_INDEV_STATE_RELEASED; | else data->state = LV_INDEV_STATE_RELEASED; | ||
+ | |||
+ | return false; /*No buffering now so no more data read*/ | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
147行目: | 148行目: | ||
* <font class="goog-text-highlight">入力デバイスを登録するには、</font><code style="color: #bb0000;">read_cb</code>タイプで関数を登録します<code style="color: #bb0000;">LV_INDEV_TYPE_KEYPAD</code>。 | * <font class="goog-text-highlight">入力デバイスを登録するには、</font><code style="color: #bb0000;">read_cb</code>タイプで関数を登録します<code style="color: #bb0000;">LV_INDEV_TYPE_KEYPAD</code>。 | ||
+ | * lv_conf.hの中の <code style="color: #bb0000;">LV_USE_GROUP</code> を有効化します | ||
* オブジェクトグループを作成する必要があります:<code style="color: #bb0000;">lv_group_t * g = lv_group_create()</code>そしてオブジェクトを追加する必要があります<code style="color: #bb0000;">lv_group_add_obj(g, obj)</code> | * オブジェクトグループを作成する必要があります:<code style="color: #bb0000;">lv_group_t * g = lv_group_create()</code>そしてオブジェクトを追加する必要があります<code style="color: #bb0000;">lv_group_add_obj(g, obj)</code> | ||
* 作成されたグループは、入力デバイスに割り当てる必要があります:(<code style="color: #bb0000;">lv_indev_set_group(my_indev, g)</code>はの<code style="color: #bb0000;">my_indev</code>戻り値です<code style="color: #bb0000;">lv_indev_drv_register</code>) | * 作成されたグループは、入力デバイスに割り当てる必要があります:(<code style="color: #bb0000;">lv_indev_set_group(my_indev, g)</code>はの<code style="color: #bb0000;">my_indev</code>戻り値です<code style="color: #bb0000;">lv_indev_drv_register</code>) | ||
* <font class="goog-text-highlight">入力デバイスを登録するには、</font><code style="color: #bb0000;">LV_KEY_...</code>グループ内のオブジェクト間を移動するために使用します。<code style="color: #bb0000;">lv_core/lv_group.h</code>使用可能なキーについては、を参照してください。 | * <font class="goog-text-highlight">入力デバイスを登録するには、</font><code style="color: #bb0000;">LV_KEY_...</code>グループ内のオブジェクト間を移動するために使用します。<code style="color: #bb0000;">lv_core/lv_group.h</code>使用可能なキーについては、を参照してください。 | ||
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="c++" style="border: 1px dashed gray;"> |
indev_drv 。タイプ = LV_INDEV_TYPE_KEYPAD ; | indev_drv 。タイプ = LV_INDEV_TYPE_KEYPAD ; | ||
indev_drv 。read_cb = Keyboard_read ; | indev_drv 。read_cb = Keyboard_read ; | ||
156行目: | 158行目: | ||
... | ... | ||
− | + | bool Keyboard_read (lv_indev_drv_t * drv 、 lv_indev_data_t * data ){ | |
data- > key = last_key (); /*最後に押されたキーまたはリリースされたキーを取得します*/ | data- > key = last_key (); /*最後に押されたキーまたはリリースされたキーを取得します*/ | ||
if (key_pressed ()) data- > state = LV_INDEV_STATE_PRESSED ; | if (key_pressed ()) data- > state = LV_INDEV_STATE_PRESSED ; | ||
else データ->状態 = LV_INDEV_STATE_RELEASED ; | else データ->状態 = LV_INDEV_STATE_RELEASED ; | ||
+ | |||
+ | return false; /*現在はバッファリングがないため、データの読み取りはありません*/ | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
190行目: | 194行目: | ||
To use an ''Encoder'' (similarly to the ''Keypads'') the objects should be added to groups. | To use an ''Encoder'' (similarly to the ''Keypads'') the objects should be added to groups. | ||
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="c++" style="border: 1px dashed gray;"> |
indev_drv.type = LV_INDEV_TYPE_ENCODER; | indev_drv.type = LV_INDEV_TYPE_ENCODER; | ||
indev_drv.read_cb = encoder_read; | indev_drv.read_cb = encoder_read; | ||
196行目: | 200行目: | ||
... | ... | ||
− | + | bool encoder_read(lv_indev_drv_t * drv, lv_indev_data_t*data){ | |
data->enc_diff = enc_get_new_moves(); | data->enc_diff = enc_get_new_moves(); | ||
if(enc_pressed()) data->state = LV_INDEV_STATE_PRESSED; | if(enc_pressed()) data->state = LV_INDEV_STATE_PRESSED; | ||
else data->state = LV_INDEV_STATE_RELEASED; | else data->state = LV_INDEV_STATE_RELEASED; | ||
+ | |||
+ | return false; /*No buffering now so no more data read*/ | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
221行目: | 227行目: | ||
''エンコーダー(キーパッド''と同様) を使用するには、オブジェクトをグループに追加する必要があります。 | ''エンコーダー(キーパッド''と同様) を使用するには、オブジェクトをグループに追加する必要があります。 | ||
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="c++" style="border: 1px dashed gray;"> |
− | + | indev_drv.type = LV_INDEV_TYPE_ENCODER; | |
− | + | indev_drv.read_cb = encoder_read; | |
− | + | ||
− | + | ... | |
− | + | ||
− | + | bool encoder_read(lv_indev_drv_t * drv, lv_indev_data_t*data){ | |
− | + | data->enc_diff = enc_get_new_moves(); | |
− | + | ||
− | + | if(enc_pressed()) data->state = LV_INDEV_STATE_PRESSED; | |
− | + | else data->state = LV_INDEV_STATE_RELEASED; | |
− | + | ||
+ | return false; /*現在はバッファリングがないため、データの読み取りはありません*/ | ||
+ | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
256行目: | 264行目: | ||
If you hold the keys it will simulate an encoder advance with period specified in <code style="color: #bb0000;">indev_drv.long_press_rep_time</code>. | If you hold the keys it will simulate an encoder advance with period specified in <code style="color: #bb0000;">indev_drv.long_press_rep_time</code>. | ||
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="c++" style="border: 1px dashed gray;"> |
indev_drv.type = LV_INDEV_TYPE_ENCODER; | indev_drv.type = LV_INDEV_TYPE_ENCODER; | ||
indev_drv.read_cb = encoder_with_keys_read; | indev_drv.read_cb = encoder_with_keys_read; | ||
262行目: | 270行目: | ||
... | ... | ||
− | + | bool encoder_with_keys_read(lv_indev_drv_t * drv, lv_indev_data_t*data){ | |
data->key = last_key(); /*Get the last pressed or released key*/ | data->key = last_key(); /*Get the last pressed or released key*/ | ||
/* use LV_KEY_ENTER for encoder press */ | /* use LV_KEY_ENTER for encoder press */ | ||
271行目: | 279行目: | ||
data->enc_diff = enc_get_new_moves(); | data->enc_diff = enc_get_new_moves(); | ||
} | } | ||
+ | |||
+ | return false; /*No buffering now so no more data read*/ | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
286行目: | 296行目: | ||
キーを押したままにすると、で指定された期間でエンコーダの前進をシミュレートします<code style="color: #bb0000;">indev_drv.long_press_rep_time</code>。 | キーを押したままにすると、で指定された期間でエンコーダの前進をシミュレートします<code style="color: #bb0000;">indev_drv.long_press_rep_time</code>。 | ||
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="c++" style="border: 1px dashed gray;"> |
− | + | indev_drv.type = LV_INDEV_TYPE_ENCODER; | |
− | + | indev_drv.read_cb = encoder_with_keys_read; | |
− | + | ||
− | + | ... | |
− | + | ||
− | + | bool encoder_with_keys_read(lv_indev_drv_t * drv, lv_indev_data_t*data){ | |
− | + | data->key = last_key(); /*最後に押されたキーまたは離されたキーを取得します*/ | |
− | + | /*エンコーダーを押すためにLV_KEY_ENTERを使用します*/ | |
− | + | if(key_pressed()) data->state = LV_INDEV_STATE_PRESSED; | |
− | + | else { | |
− | + | data->state = LV_INDEV_STATE_RELEASED; | |
− | + | /* Optionally you can also use enc_diff, if you have encoder*/ | |
− | + | data->enc_diff = enc_get_new_moves(); | |
− | + | } | |
− | + | ||
+ | return false; /*エンコーダーがある場合は、オプションでenc_diffを使用することもできます*/ | ||
+ | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
321行目: | 333行目: | ||
<span style="background-color: #dbfaf4;>'''Important''': The points_array can't go out of scope. Either declare it as a global variable or as a static variable inside a function. </span> | <span style="background-color: #dbfaf4;>'''Important''': The points_array can't go out of scope. Either declare it as a global variable or as a static variable inside a function. </span> | ||
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="c++" style="border: 1px dashed gray;"> |
indev_drv.type = LV_INDEV_TYPE_BUTTON; | indev_drv.type = LV_INDEV_TYPE_BUTTON; | ||
indev_drv.read_cb = button_read; | indev_drv.read_cb = button_read; | ||
327行目: | 339行目: | ||
... | ... | ||
− | + | bool button_read(lv_indev_drv_t * drv, lv_indev_data_t*data){ | |
static uint32_t last_btn = 0; /*Store the last pressed button*/ | static uint32_t last_btn = 0; /*Store the last pressed button*/ | ||
int btn_pr = my_btn_read(); /*Get the ID (0,1,2...) of the pressed button*/ | int btn_pr = my_btn_read(); /*Get the ID (0,1,2...) of the pressed button*/ | ||
338行目: | 350行目: | ||
data->btn = last_btn; /*Save the last button*/ | data->btn = last_btn; /*Save the last button*/ | ||
+ | |||
+ | return false; /*No buffering now so no more data read*/ | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
350行目: | 364行目: | ||
'''重要''':points_arrayはスコープ外に出ることはできません。グローバル変数または関数内の静的変数として宣言します。 | '''重要''':points_arrayはスコープ外に出ることはできません。グローバル変数または関数内の静的変数として宣言します。 | ||
− | <syntaxhighlight lang=" | + | <syntaxhighlight lang="c++" style="border: 1px dashed gray;"> |
− | + | indev_drv.type = LV_INDEV_TYPE_BUTTON; | |
− | + | indev_drv.read_cb = button_read; | |
− | + | ||
− | + | ... | |
− | + | ||
− | + | bool button_read(lv_indev_drv_t * drv, lv_indev_data_t*data){ | |
− | + | static uint32_t last_btn = 0; /*最後に押されたボタンを保存します*/ | |
− | + | int btn_pr = my_btn_read(); /*押されたボタンのID(0,1,2 ...)を取得します*/ | |
− | + | if(btn_pr >= 0) { /*ボタンが押されたか?(例-1はボタンが押されていないことを示します)*/ | |
− | + | last_btn = btn_pr; /*押されたボタンのIDを保存します*/ | |
− | + | data->state = LV_INDEV_STATE_PRESSED; /*押された状態を設定します*/ | |
− | + | } else { | |
− | + | data->state = LV_INDEV_STATE_RELEASED; /*リリース状態を設定します*/ | |
− | + | } | |
− | + | ||
− | + | data->btn = last_btn; /*最後のボタンを保存します*/ | |
− | + | ||
+ | return false; /*バッファリングがなくなったので、これ以上データを読み込まない*/ | ||
+ | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|} | |} | ||
373行目: | 389行目: | ||
== Other features == | == Other features == | ||
− | |||
− | |||
{| class="wikitable" | {| class="wikitable" | ||
!英文 | !英文 | ||
!自動翻訳 | !自動翻訳 | ||
|- | |- | ||
− | | | + | |Besides <code style="color: #bb0000;">read_cb</code> a <code style="color: #bb0000;">feedback_cb</code> callback can be also specified in <code style="color: #bb0000;">lv_indev_drv_t</code>. <code style="color: #bb0000;">feedback_cb</code> is called when any type of event is sent by the input devices. (independently from its type). It allows making feedback for the user e.g. to play a sound on <code style="color: #bb0000;">LV_EVENT_CLICK</code>. |
− | + | |read_cbの他に、feedback_cbコールバックをlv_indev_drv_tに指定することができる。feedback_cbは、入力デバイスから何らかのタイプのイベントが送信されると呼び出される。(イベントの種類によらず)呼び出されます。例えば、LV_EVENT_CLICKで音を鳴らすなど、ユーザーへのフィードバックが可能になります。 | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | | | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | |The default value of the following parameters can be set in ''lv_conf.h'' but the default value can be overwritten in <code style="color: #bb0000;">lv_indev_drv_t</code>: |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | * '''drag_limit''' Number of pixels to slide before actually drag the object | |
+ | * '''drag_throw''' Drag throw slow-down in [%]. Greater value means faster slow-down | ||
+ | * '''long_press_time''' Press time to send <code style="color: #bb0000;">LV_EVENT_LONG_PRESSED</code> (in milliseconds) | ||
+ | * '''long_press_rep_time''' Interval of sending <code style="color: #bb0000;">LV_EVENT_LONG_PRESSED_REPEAT</code> (in milliseconds) | ||
+ | * '''read_task''' pointer to the <code style="color: #bb0000;">lv_task</code> which reads the input device. Its parameters can be changed by <code style="color: #bb0000;">lv_task_...()</code> functions | ||
+ | |以下のパラメータのデフォルト値は lv_conf.h で設定できるが、lv_indev_drv_t でデフォルト値を上書きすることができる。 | ||
− | + | * '''drag_limit''' 実際にオブジェクトをドラッグする前にスライドさせるピクセル数 | |
− | + | * '''drag_throw''' ドラッグスローの減速率を [%] で指定します。値が大きい程、スローダウンが速くなる | |
− | + | * '''long_press_time''' LV_EVENT_LONG_PRESSED を送信するプレス時間 (ミリ秒単位) | |
− | + | * '''long_press_rep_time''' LV_EVENT_LONG_PRESSED_REPEATを送信する間隔(ミリ秒) | |
− | + | * '''read_task''' 入力デバイスを読み込むlv_taskへのポインタ.パラメータは,lv_task_...()関数で変更できる. | |
− | |||
− | |||
− | |||
− | |||
|- | |- | ||
− | | | + | |Every Input device is associated with a display. By default, a new input device is added to the lastly created or the explicitly selected (using <code style="color: #bb0000;">lv_disp_set_default()</code>) display. The associated display is stored and can be changed in <code style="color: #bb0000;">disp</code> field of the driver. |
− | Every | + | |すべての入力デバイスは、ディスプレイと関連付けられています。デフォルトでは、新しい入力デバイスは、最後に作成されたディスプレイか、明示的に選択された(lv_disp_set_default()を使用した)ディスプレイに追加されます。 |
− | + | 関連付けられたディスプレイは、ドライバのdispフィールドに保存され、変更することができる。 | |
− | By default, a new input device is added to the | ||
− | |||
− | The associated display is stored and can be changed in <code style="color: #bb0000;">disp</code> field of the driver. | ||
− | | | ||
− | |||
− | |||
− | |||
|} | |} | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
:[[App:Library:LVGL:docs:Porting#Input device interface|戻る : Previous]] | :[[App:Library:LVGL:docs:Porting#Input device interface|戻る : Previous]] | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== API == | == API == | ||
491行目: | 425行目: | ||
|- | |- | ||
| | | | ||
− | + | Input Device HAL interface layer header file | |
− | Typedefs | + | '''Typedefs''' |
<span style="background-color: #e7f2fa; color: #2980b9;">typedef struct _[https://docs.lvgl.io/8.2/porting/indev.html#_CPPv415_lv_indev_drv_t lv_indev_drv_t] lv_indev_drv_t</span> | <span style="background-color: #e7f2fa; color: #2980b9;">typedef struct _[https://docs.lvgl.io/8.2/porting/indev.html#_CPPv415_lv_indev_drv_t lv_indev_drv_t] lv_indev_drv_t</span> | ||
506行目: | 440行目: | ||
− | |||
− | Typedef | + | 入力デバイスHALインターフェイスレイヤーヘッダーファイル |
+ | |||
+ | '''Typedef''' | ||
<span style="background-color:#e7f2fa;color:#2980b9;">typedef struct _ lv_indev_drv_t lv_indev_drv_t</span> | <span style="background-color:#e7f2fa;color:#2980b9;">typedef struct _ lv_indev_drv_t lv_indev_drv_t</span> | ||
530行目: | 465行目: | ||
!自動翻訳 | !自動翻訳 | ||
|- | |- | ||
− | | | + | |<span style="background-color: #e7f2fa; color: #2980b9;">enum lv_indev_type_t </span> |
− | <span style="background-color: #e7f2fa; color: #2980b9;">enum lv_indev_type_t </span> | + | : Possible input device types |
− | : Possible input device types ''Values:'' | + | : '''''Values:''''' |
− | : <span style="background-color: #eeeeee;">enumerator LV_INDEV_TYPE_NONE </span> | + | : <span style="background-color: #eeeeee;">enumerator '''LV_INDEV_TYPE_NONE''' </span> |
:: Uninitialized state | :: Uninitialized state | ||
− | : <span style="background-color: #eeeeee;">enumerator LV_INDEV_TYPE_POINTER </span> | + | : <span style="background-color: #eeeeee;">enumerator '''LV_INDEV_TYPE_POINTER''' </span> |
:: Touch pad, mouse, external button | :: Touch pad, mouse, external button | ||
− | : <span style="background-color: #eeeeee;">enumerator LV_INDEV_TYPE_KEYPAD </span> | + | : <span style="background-color: #eeeeee;">enumerator '''LV_INDEV_TYPE_KEYPAD''' </span> |
:: Keypad or keyboard | :: Keypad or keyboard | ||
− | : <span style="background-color: #eeeeee;">enumerator LV_INDEV_TYPE_BUTTON </span> | + | : <span style="background-color: #eeeeee;">enumerator '''LV_INDEV_TYPE_BUTTON''' </span> |
:: External (hardware button) which is assigned to a specific point of the screen | :: External (hardware button) which is assigned to a specific point of the screen | ||
− | : <span style="background-color: #eeeeee;">enumerator LV_INDEV_TYPE_ENCODER </span> | + | :<span style="background-color: #eeeeee;">enumerator '''LV_INDEV_TYPE_ENCODER''' </span> |
:: Encoder with only Left, Right turn and a Button | :: Encoder with only Left, Right turn and a Button | ||
+ | |<span style="background-color:#e7f2fa;color:#2980b9;">列挙型lv_indev_type_t</span> | ||
− | + | : 可能な入力デバイスタイプ | |
− | + | : '''''値''':'' | |
− | :'' | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
: <span style="background-color: #eeeeee;">列挙子LV_INDEV_TYPE_NONE</span> | : <span style="background-color: #eeeeee;">列挙子LV_INDEV_TYPE_NONE</span> | ||
:: 初期化されていない状態 | :: 初期化されていない状態 | ||
566行目: | 492行目: | ||
: <span style="background-color: #eeeeee;">列挙子LV_INDEV_TYPE_ENCODER</span> | : <span style="background-color: #eeeeee;">列挙子LV_INDEV_TYPE_ENCODER</span> | ||
:: 左折、右折、ボタンのみのエンコーダ | :: 左折、右折、ボタンのみのエンコーダ | ||
+ | |- | ||
+ | |<span style="background-color: #e7f2fa; color: #2980b9;">enum [anonymous] </span> | ||
+ | : States for input devices | ||
+ | :'''''Values:''''' | ||
+ | :<span style="background-color: #eeeeee;">enumerator '''LV_INDEV_STATE_REL''' </span>(RELEASED) | ||
+ | :<span style="background-color: #eeeeee;">enumerator '''LV_INDEV_STATE_PR''' </span> (PRESSED) | ||
− | <span style="background-color:#e7f2fa;color:#2980b9;">列挙型lv_indev_state_t</span> | + | |<span style="background-color:#e7f2fa;color:#2980b9;">列挙型lv_indev_state_t</span> |
+ | : 入力デバイスの状態 | ||
+ | :'''''値:''''' | ||
+ | :<span style="background-color: #eeeeee;">列挙子LV_INDEV_STATE_REL</span> | ||
+ | :<span style="background-color: #eeeeee;">列挙子LV_INDEV_STATE_PR</span> | ||
+ | |- | ||
+ | | | ||
+ | <span style="background-color: #e7f2fa; color: #2980b9;">enum [anonymous] </span> | ||
+ | :'''''Values:''''' | ||
+ | :; ''enumerator''<code>LV_DRAG_DIR_HOR</code>[https://docs.lvgl.io/latest/en/html/porting/indev.html#_CPPv4NUt2_3215LV_DRAG_DIR_HORE] | ||
+ | :: Object can be dragged[https://docs.lvgl.io/latest/en/html/porting/indev.html#_CPPv4NUt2_3215LV_DRAG_DIR_HORE] horizontally. | ||
+ | :; <span id="_CPPv3NUt2_3215LV_DRAG_DIR_VERE"></span><span id="lv__hal__indev_8h_1a4790f45dcc812c1b00184a2edccdddf5a0f1ce2dd8b51b54a701e40b651383210" class="target"></span>''enumerator''<code>LV_DRAG_DIR_VER</code>[https://docs.lvgl.io/latest/en/html/porting/indev.html#_CPPv4NUt2_3215LV_DRAG_DIR_VERE]<span id="_CPPv3NUt2_3215LV_DRAG_DIR_VERE"></span><span id="lv__hal__indev_8h_1a4790f45dcc812c1b00184a2edccdddf5a0f1ce2dd8b51b54a701e40b651383210" class="target"></span> | ||
+ | :: Object can be dragged[https://docs.lvgl.io/latest/en/html/porting/indev.html#_CPPv4NUt2_3215LV_DRAG_DIR_VERE] vertically. | ||
+ | :; <span id="_CPPv3NUt2_3216LV_DRAG_DIR_BOTHE"></span><span id="lv__hal__indev_8h_1a4790f45dcc812c1b00184a2edccdddf5a8e25032b851b539382dbdb86e3e27b24" class="target"></span>''enumerator''<code>LV_DRAG_DIR_BOTH</code>[https://docs.lvgl.io/latest/en/html/porting/indev.html#_CPPv4NUt2_3216LV_DRAG_DIR_BOTHE]<span id="_CPPv3NUt2_3216LV_DRAG_DIR_BOTHE"></span><span id="lv__hal__indev_8h_1a4790f45dcc812c1b00184a2edccdddf5a8e25032b851b539382dbdb86e3e27b24" class="target"></span> | ||
+ | :: Object can be dragged [https://docs.lvgl.io/latest/en/html/porting/indev.html#_CPPv4NUt2_3216LV_DRAG_DIR_BOTHE]in all directions. | ||
+ | :; <span id="_CPPv3NUt2_3215LV_DRAG_DIR_ONEE"></span><span id="lv__hal__indev_8h_1a4790f45dcc812c1b00184a2edccdddf5aebd8cb014b550b5a208a4930b63e811a" class="target"></span>''enumerator''<code>LV_DRAG_DIR_ONE</code>[https://docs.lvgl.io/latest/en/html/porting/indev.html#_CPPv4NUt2_3215LV_DRAG_DIR_ONEE]<span id="_CPPv3NUt2_3215LV_DRAG_DIR_ONEE"></span><span id="lv__hal__indev_8h_1a4790f45dcc812c1b00184a2edccdddf5aebd8cb014b550b5a208a4930b63e811a" class="target"></span> | ||
+ | :: Object can be dragged[https://docs.lvgl.io/latest/en/html/porting/indev.html#_CPPv4NUt2_3215LV_DRAG_DIR_ONEE] only one direction (the first move). | ||
+ | |||
+ | |<span style="background-color: #e7f2fa; color: #2980b9;">enum [anonymous] </span> | ||
+ | :'''''Values:''''' | ||
+ | :;''enumerator''<code>LV_DRAG_DIR_HOR</code>[https://docs.lvgl.io/latest/en/html/porting/indev.html#_CPPv4NUt2_3215LV_DRAG_DIR_HORE] | ||
+ | :: オブジェクトは[1]水平方向にドラッグできます。 | ||
+ | :;<span id="_CPPv3NUt2_3215LV_DRAG_DIR_VERE"></span><span id="lv__hal__indev_8h_1a4790f45dcc812c1b00184a2edccdddf5a0f1ce2dd8b51b54a701e40b651383210" class="target"></span>''enumerator''<code>LV_DRAG_DIR_VER</code>[https://docs.lvgl.io/latest/en/html/porting/indev.html#_CPPv4NUt2_3215LV_DRAG_DIR_VERE]<span id="_CPPv3NUt2_3215LV_DRAG_DIR_VERE"></span><span id="lv__hal__indev_8h_1a4790f45dcc812c1b00184a2edccdddf5a0f1ce2dd8b51b54a701e40b651383210" class="target"></span><span id="_CPPv3NUt2_3215LV_DRAG_DIR_VERE"></span><span id="lv__hal__indev_8h_1a4790f45dcc812c1b00184a2edccdddf5a0f1ce2dd8b51b54a701e40b651383210" class="target"></span><span id="_CPPv3NUt2_3215LV_DRAG_DIR_VERE"></span><span id="lv__hal__indev_8h_1a4790f45dcc812c1b00184a2edccdddf5a0f1ce2dd8b51b54a701e40b651383210" class="target"></span> | ||
+ | :: オブジェクトは[1]垂直方向にドラッグできます。 | ||
+ | :;<span id="_CPPv3NUt2_3216LV_DRAG_DIR_BOTHE"></span><span id="lv__hal__indev_8h_1a4790f45dcc812c1b00184a2edccdddf5a8e25032b851b539382dbdb86e3e27b24" class="target"></span>''enumerator''<code>LV_DRAG_DIR_BOTH</code>[https://docs.lvgl.io/latest/en/html/porting/indev.html#_CPPv4NUt2_3216LV_DRAG_DIR_BOTHE]<span id="_CPPv3NUt2_3216LV_DRAG_DIR_BOTHE"></span><span id="lv__hal__indev_8h_1a4790f45dcc812c1b00184a2edccdddf5a8e25032b851b539382dbdb86e3e27b24" class="target"></span><span id="_CPPv3NUt2_3216LV_DRAG_DIR_BOTHE"></span><span id="lv__hal__indev_8h_1a4790f45dcc812c1b00184a2edccdddf5a8e25032b851b539382dbdb86e3e27b24" class="target"></span><span id="_CPPv3NUt2_3216LV_DRAG_DIR_BOTHE"></span><span id="lv__hal__indev_8h_1a4790f45dcc812c1b00184a2edccdddf5a8e25032b851b539382dbdb86e3e27b24" class="target"></span> | ||
+ | :: オブジェクトは[1]全方向にドラッグできます。 | ||
+ | :;<span id="_CPPv3NUt2_3215LV_DRAG_DIR_ONEE"></span><span id="lv__hal__indev_8h_1a4790f45dcc812c1b00184a2edccdddf5aebd8cb014b550b5a208a4930b63e811a" class="target"></span>''enumerator''<code>LV_DRAG_DIR_ONE</code>[https://docs.lvgl.io/latest/en/html/porting/indev.html#_CPPv4NUt2_3215LV_DRAG_DIR_ONEE]<span id="_CPPv3NUt2_3215LV_DRAG_DIR_ONEE"></span><span id="lv__hal__indev_8h_1a4790f45dcc812c1b00184a2edccdddf5aebd8cb014b550b5a208a4930b63e811a" class="target"></span><span id="_CPPv3NUt2_3215LV_DRAG_DIR_ONEE"></span><span id="lv__hal__indev_8h_1a4790f45dcc812c1b00184a2edccdddf5aebd8cb014b550b5a208a4930b63e811a" class="target"></span><span id="_CPPv3NUt2_3215LV_DRAG_DIR_ONEE"></span><span id="lv__hal__indev_8h_1a4790f45dcc812c1b00184a2edccdddf5aebd8cb014b550b5a208a4930b63e811a" class="target"></span> | ||
+ | :: オブジェクトは一方向にのみドラッグ[1]できます (最初の移動)。 | ||
− | : | + | |- |
− | : '' | + | |<span style="background-color: #e7f2fa; color: #2980b9;">enum [anonymous] </span> |
− | : <span style="background-color: #eeeeee;"> | + | :'''''Values:''''' |
− | :: | + | :; <span style="background-color: #eeeeee;">''enumerator''<code>LV_GESTURE_DIR_TOP</code></span>[https://docs.lvgl.io/latest/en/html/porting/indev.html#_CPPv4NUt2_3318LV_GESTURE_DIR_TOPE] |
− | : <span style="background-color: #eeeeee;"> | + | :: <span style="background-color: #eeeeee;">Gesture dir up.</span> |
+ | :; <span id="_CPPv3NUt2_3321LV_GESTURE_DIR_BOTTOME"></span><span id="lv__hal__indev_8h_1a4caf8d8f829279fba122163d961608a4a0c6ebe9bdeec0edc85919b05ab01eb33" class="target"></span><span style="background-color: #eeeeee;">''enu''</span>[https://docs.lvgl.io/latest/en/html/porting/indev.html#_CPPv4NUt2_3318LV_GESTURE_DIR_TOPE]<span style="background-color: #eeeeee;">''merator''<code>LV_GESTURE_DIR_BOTTOM</code></span>[https://docs.lvgl.io/latest/en/html/porting/indev.html#_CPPv4NUt2_3321LV_GESTURE_DIR_BOTTOME]<span id="_CPPv3NUt2_3321LV_GESTURE_DIR_BOTTOME"></span><span id="lv__hal__indev_8h_1a4caf8d8f829279fba122163d961608a4a0c6ebe9bdeec0edc85919b05ab01eb33" class="target"></span> | ||
+ | :: <span style="background-color: #eeeeee;">Gesture dir down.</span> | ||
+ | :; <span id="_CPPv3NUt2_3319LV_GESTURE_DIR_LEFTE"></span><span id="lv__hal__indev_8h_1a4caf8d8f829279fba122163d961608a4a13b17e52ede3d49b85cad583cc6ade6a" class="target"></span><span style="background-color: #eeeeee;">''enum''</span>[https://docs.lvgl.io/latest/en/html/porting/indev.html#_CPPv4NUt2_3321LV_GESTURE_DIR_BOTTOME]<span style="background-color: #eeeeee;">''erator''<code>LV_GESTURE_DIR_LEFT</code></span>[https://docs.lvgl.io/latest/en/html/porting/indev.html#_CPPv4NUt2_3319LV_GESTURE_DIR_LEFTE]<span id="_CPPv3NUt2_3319LV_GESTURE_DIR_LEFTE"></span><span id="lv__hal__indev_8h_1a4caf8d8f829279fba122163d961608a4a13b17e52ede3d49b85cad583cc6ade6a" class="target"></span> | ||
+ | :: <span style="background-color: #eeeeee;">Gesture dir left.</span> | ||
+ | :; <span id="_CPPv3NUt2_3320LV_GESTURE_DIR_RIGHTE"></span><span id="lv__hal__indev_8h_1a4caf8d8f829279fba122163d961608a4a9675fe01ca4b57ef3077f684260822ab" class="target"></span><span style="background-color: #eeeeee;">''en''</span>[https://docs.lvgl.io/latest/en/html/porting/indev.html#_CPPv4NUt2_3319LV_GESTURE_DIR_LEFTE]<span style="background-color: #eeeeee;">''umerator''<code>LV_GESTURE_DIR_RIGHT</code></span>[https://docs.lvgl.io/latest/en/html/porting/indev.html#_CPPv4NUt2_3320LV_GESTURE_DIR_RIGHTE]<span id="_CPPv3NUt2_3320LV_GESTURE_DIR_RIGHTE"></span><span id="lv__hal__indev_8h_1a4caf8d8f829279fba122163d961608a4a9675fe01ca4b57ef3077f684260822ab" class="target"></span> | ||
+ | :: <span style="background-color: #eeeeee;">Gesture dir right.</span> | ||
+ | |<span style="background-color: #e7f2fa; color: #2980b9;">enum [anonymous] </span> | ||
+ | :'''''Values:''''' | ||
+ | :;<span style="background-color: #eeeeee;">''enumerator''<code>LV_GESTURE_DIR_TOP</code></span>[https://docs.lvgl.io/latest/en/html/porting/indev.html#_CPPv4NUt2_3318LV_GESTURE_DIR_TOPE] | ||
+ | ::<span style="background-color: #eeeeee;">Gesture dir up.</span> | ||
+ | :;<span id="_CPPv3NUt2_3321LV_GESTURE_DIR_BOTTOME"></span><span id="lv__hal__indev_8h_1a4caf8d8f829279fba122163d961608a4a0c6ebe9bdeec0edc85919b05ab01eb33" class="target"></span><span style="background-color: #eeeeee;">''enu''</span>[https://docs.lvgl.io/latest/en/html/porting/indev.html#_CPPv4NUt2_3318LV_GESTURE_DIR_TOPE]<span style="background-color: #eeeeee;">''merator''<code>LV_GESTURE_DIR_BOTTOM</code></span>[https://docs.lvgl.io/latest/en/html/porting/indev.html#_CPPv4NUt2_3321LV_GESTURE_DIR_BOTTOME]<span id="_CPPv3NUt2_3321LV_GESTURE_DIR_BOTTOME"></span><span id="lv__hal__indev_8h_1a4caf8d8f829279fba122163d961608a4a0c6ebe9bdeec0edc85919b05ab01eb33" class="target"></span><span id="_CPPv3NUt2_3321LV_GESTURE_DIR_BOTTOME"></span><span id="lv__hal__indev_8h_1a4caf8d8f829279fba122163d961608a4a0c6ebe9bdeec0edc85919b05ab01eb33" class="target"></span><span id="_CPPv3NUt2_3321LV_GESTURE_DIR_BOTTOME"></span><span id="lv__hal__indev_8h_1a4caf8d8f829279fba122163d961608a4a0c6ebe9bdeec0edc85919b05ab01eb33" class="target"></span> | ||
+ | ::<span style="background-color: #eeeeee;">Gesture dir down.</span> | ||
+ | :;<span id="_CPPv3NUt2_3319LV_GESTURE_DIR_LEFTE"></span><span id="lv__hal__indev_8h_1a4caf8d8f829279fba122163d961608a4a13b17e52ede3d49b85cad583cc6ade6a" class="target"></span><span style="background-color: #eeeeee;">''enum''</span>[https://docs.lvgl.io/latest/en/html/porting/indev.html#_CPPv4NUt2_3321LV_GESTURE_DIR_BOTTOME]<span style="background-color: #eeeeee;">''erator''<code>LV_GESTURE_DIR_LEFT</code></span>[https://docs.lvgl.io/latest/en/html/porting/indev.html#_CPPv4NUt2_3319LV_GESTURE_DIR_LEFTE]<span id="_CPPv3NUt2_3319LV_GESTURE_DIR_LEFTE"></span><span id="lv__hal__indev_8h_1a4caf8d8f829279fba122163d961608a4a13b17e52ede3d49b85cad583cc6ade6a" class="target"></span><span id="_CPPv3NUt2_3319LV_GESTURE_DIR_LEFTE"></span><span id="lv__hal__indev_8h_1a4caf8d8f829279fba122163d961608a4a13b17e52ede3d49b85cad583cc6ade6a" class="target"></span><span id="_CPPv3NUt2_3319LV_GESTURE_DIR_LEFTE"></span><span id="lv__hal__indev_8h_1a4caf8d8f829279fba122163d961608a4a13b17e52ede3d49b85cad583cc6ade6a" class="target"></span> | ||
+ | ::<span style="background-color: #eeeeee;">Gesture dir left.</span> | ||
+ | :;<span id="_CPPv3NUt2_3320LV_GESTURE_DIR_RIGHTE"></span><span id="lv__hal__indev_8h_1a4caf8d8f829279fba122163d961608a4a9675fe01ca4b57ef3077f684260822ab" class="target"></span><span style="background-color: #eeeeee;">''en''</span>[https://docs.lvgl.io/latest/en/html/porting/indev.html#_CPPv4NUt2_3319LV_GESTURE_DIR_LEFTE]<span style="background-color: #eeeeee;">''umerator''<code>LV_GESTURE_DIR_RIGHT</code></span>[https://docs.lvgl.io/latest/en/html/porting/indev.html#_CPPv4NUt2_3320LV_GESTURE_DIR_RIGHTE]<span id="_CPPv3NUt2_3320LV_GESTURE_DIR_RIGHTE"></span><span id="lv__hal__indev_8h_1a4caf8d8f829279fba122163d961608a4a9675fe01ca4b57ef3077f684260822ab" class="target"></span><span id="_CPPv3NUt2_3320LV_GESTURE_DIR_RIGHTE"></span><span id="lv__hal__indev_8h_1a4caf8d8f829279fba122163d961608a4a9675fe01ca4b57ef3077f684260822ab" class="target"></span><span id="_CPPv3NUt2_3320LV_GESTURE_DIR_RIGHTE"></span><span id="lv__hal__indev_8h_1a4caf8d8f829279fba122163d961608a4a9675fe01ca4b57ef3077f684260822ab" class="target"></span> | ||
+ | ::<span style="background-color: #eeeeee;">Gesture dir right.</span> | ||
|} | |} | ||
:[[App:Library:LVGL:docs:Porting#Input device interface|戻る : Previous]] | :[[App:Library:LVGL:docs:Porting#Input device interface|戻る : Previous]] | ||
− | |||
=== Functions === | === Functions === | ||
583行目: | 557行目: | ||
!自動翻訳 | !自動翻訳 | ||
|- | |- | ||
− | | | + | |<span style="background-color: #e7f2fa; color: #2980b9;">void '''lv_indev_drv_init'''(struct _[https://docs.lvgl.io/8.2/porting/indev.html#_CPPv415_lv_indev_drv_t lv_indev_drv_t] *driver) </span> |
− | <span style="background-color: #e7f2fa; color: #2980b9;">void lv_indev_drv_init(struct _[https://docs.lvgl.io/8.2/porting/indev.html#_CPPv415_lv_indev_drv_t lv_indev_drv_t] *driver) </span> | ||
: Initialize an input device driver with default values. It is used to surely have known values in the fields and not memory junk. After it you can set the fields. | : Initialize an input device driver with default values. It is used to surely have known values in the fields and not memory junk. After it you can set the fields. | ||
: '''Parameters''' | : '''Parameters''' | ||
:: '''driver''' -- pointer to driver variable to initialize | :: '''driver''' -- pointer to driver variable to initialize | ||
− | <span style="background-color: #e7f2fa; color: #2980b9;">[https://docs.lvgl.io/8.2/porting/indev.html#_CPPv410lv_indev_t ''' | + | <span style="background-color: #e7f2fa; color: #2980b9;">[https://docs.lvgl.io/8.2/porting/indev.html#_CPPv410lv_indev_t lv_indev_t] *'''lv_indev_drv_register'''(struct _[https://docs.lvgl.io/8.2/porting/indev.html#_CPPv415_lv_indev_drv_t lv_indev_drv_t] *driver) </span> |
: Register an initialized input device driver. | : Register an initialized input device driver. | ||
: '''Parameters''' | : '''Parameters''' | ||
595行目: | 568行目: | ||
: '''Returns''' | : '''Returns''' | ||
:: pointer to the new input device or NULL on error | :: pointer to the new input device or NULL on error | ||
+ | |<span style="background-color:#e7f2fa;color:#2980b9;">void '''lv_indev_drv_init'''(struct _ lv_indev_drv_t * driver)</span> | ||
− | + | : 入力デバイスドライバーをデフォルト値で初期化します。これは、メモリジャンクではなく、フィールドに既知の値を確実に持つために使用されます。その後、フィールドを設定できます。 | |
− | + | : '''パラメーター''' | |
− | : ''' | + | :: '''driver-初期化するドライバー'''変数へのポインター |
− | :: | ||
− | |||
− | <span style="background-color: #e7f2fa; color: #2980b9;"> | + | <span style="background-color:#e7f2fa;color:#2980b9;">lv_indev_t * '''lv_indev_drv_register'''(struct _ lv_indev_drv_t * driver)</span> |
− | |||
− | |||
− | |||
− | <span style="background-color: #e7f2fa; color: #2980b9;">[https://docs.lvgl.io/8.2/porting/indev.html#_CPPv410lv_indev_t ''' | + | : 初期化された入力デバイスドライバを登録します。 |
+ | : '''パラメーター''' | ||
+ | :: '''driver-'''初期化された'lv_indev_drv_t'変数へのポインター(ローカル変数にすることができます) | ||
+ | : '''戻り値''' | ||
+ | :: 新しい入力デバイスへのポインタ、またはエラーの場合はNULL | ||
+ | |- | ||
+ | |<span style="background-color: #e7f2fa; color: #2980b9;">void '''lv_indev_drv_update'''([https://docs.lvgl.io/8.2/porting/indev.html#_CPPv410lv_indev_t lv_indev_t] *indev, struct [https://docs.lvgl.io/8.2/porting/indev.html#_CPPv415_lv_indev_drv_t _lv_indev_drv_t] *new_drv) </span> | ||
+ | : Update the driver in run time. | ||
+ | :'''Parameters''' | ||
+ | ::*'''indev''' -- pointer to an input device. (return value of <code style="color: #bb0000;">lv_indev_drv_register</code>) | ||
+ | ::*'''new_drv''' -- pointer to the new driver | ||
+ | |<span style="background-color:#e7f2fa;color:#2980b9;">void '''lv_indev_drv_update'''(lv_indev_t * indev、struct _lv_indev_drv_t * new_drv)</span> | ||
+ | : 実行時にドライバーを更新します。 | ||
+ | :'''パラメーター''' | ||
+ | ::*'''indev--'''入力デバイスへのポインタ。(の戻り値<code style="color: #bb0000;">lv_indev_drv_register</code>) | ||
+ | ::*'''new_drv--'''新しいドライバへのポインタ | ||
+ | |- | ||
+ | |<span style="background-color: #e7f2fa; color: #2980b9;">[https://docs.lvgl.io/8.2/porting/indev.html#_CPPv410lv_indev_t lv_indev_t] *'''lv_indev_get_next('''[https://docs.lvgl.io/8.2/porting/indev.html#_CPPv410lv_indev_t lv_indev_t] *indev) </span> | ||
: Get the next input device. | : Get the next input device. | ||
− | : '''Parameters''' | + | :'''Parameters''' |
− | :: '''indev''' -- pointer to the current input device. NULL to initialize. | + | ::'''indev''' -- pointer to the current input device. NULL to initialize. |
− | : '''Returns''' | + | :'''Returns''' |
:: the next input device or NULL if there are no more. Provide the first input device when the parameter is NULL | :: the next input device or NULL if there are no more. Provide the first input device when the parameter is NULL | ||
− | <span style="background-color: #e7f2fa; color: #2980b9;">void _lv_indev_read([https://docs.lvgl.io/8.2/porting/indev.html#_CPPv410lv_indev_t | + | <span style="background-color: #e7f2fa; color: #2980b9;">void '''_lv_indev_read'''([https://docs.lvgl.io/8.2/porting/indev.html#_CPPv410lv_indev_t lv_indev_t] *indev, [https://docs.lvgl.io/8.2/porting/indev.html#_CPPv415lv_indev_data_t lv_indev_data_t] *data) </span> |
: Read data from an input device. | : Read data from an input device. | ||
− | : '''Parameters''' | + | :'''Parameters''' |
− | ::* '''indev''' -- pointer to an input device | + | ::*'''indev''' -- pointer to an input device |
− | ::* '''data''' -- input device will write its data here | + | ::*'''data''' -- input device will write its data here |
+ | |<span style="background-color:#e7f2fa;color:#2980b9;">lv_indev_t * '''lv_indev_get_next'''( lv_indev_t * indev)</span> | ||
+ | : 次の入力デバイスを取得します。 | ||
+ | :'''パラメーター''' | ||
+ | ::'''indev--'''現在の入力デバイスへのポインタ。初期化するにはNULL。 | ||
+ | :'''戻り値''' | ||
+ | :: 次の入力デバイス。それ以上ない場合はNULL。パラメータがNULLの場合、最初の入力デバイスを提供します | ||
+ | |||
+ | <span style="background-color:#e7f2fa;color:#2980b9;">void '''_lv_indev_read'''(lv_indev_t * indev、lv_indev_data_t * data)</span> | ||
− | <span style="background-color: #e7f2fa; color: #2980b9;">struct lv_indev_data_t </span> | + | : 入力デバイスからデータを読み取ります。 |
− | : ''#include <lv_hal_i'ndev.h>'' | + | :'''パラメーター''' |
− | : Data structure passed to an input driver to fill | + | ::*'''indev-'''入力デバイスへのポインタ |
− | : '''Public Members''' | + | ::*'''data-'''入力デバイスはここにデータを書き込みます |
− | : <span style="background-color: #eeeeee;">lv_point_t point </span> | + | |- |
+ | |<span style="background-color: #e7f2fa; color: #2980b9;">struct '''lv_indev_data_t''' </span> | ||
+ | :''#include <lv_hal_i'ndev.h>'' | ||
+ | : Data structure passed to an input driver to fill | ||
+ | :'''Public Members''' | ||
+ | :<span style="background-color: #eeeeee;">lv_point_t '''point''' </span> | ||
:: For LV_INDEV_TYPE_POINTER the currently pressed point | :: For LV_INDEV_TYPE_POINTER the currently pressed point | ||
− | : <span style="background-color: #eeeeee;">uint32_t key </span> | + | :<span style="background-color: #eeeeee;">uint32_t '''key''' </span> |
:: For LV_INDEV_TYPE_KEYPAD the currently pressed key | :: For LV_INDEV_TYPE_KEYPAD the currently pressed key | ||
− | : <span style="background-color: #eeeeee;">uint32_t btn_id </span> | + | :<span style="background-color: #eeeeee;">uint32_t '''btn_id''' </span> |
:: For LV_INDEV_TYPE_BUTTON the currently pressed button | :: For LV_INDEV_TYPE_BUTTON the currently pressed button | ||
− | : <span style="background-color: #eeeeee;">int16_t enc_diff </span> | + | :<span style="background-color: #eeeeee;">int16_t '''enc_diff''' </span> |
:: For LV_INDEV_TYPE_ENCODER number of steps since the previous read | :: For LV_INDEV_TYPE_ENCODER number of steps since the previous read | ||
− | : <span style="background-color: #eeeeee;">[https://docs.lvgl.io/8.2/porting/indev.html#_CPPv416lv_indev_state_t ''' | + | :<span style="background-color: #eeeeee;">[https://docs.lvgl.io/8.2/porting/indev.html#_CPPv416lv_indev_state_t lv_indev_state_t] '''state''' </span> |
:: LV_INDEV_STATE_REL or LV_INDEV_STATE_PR | :: LV_INDEV_STATE_REL or LV_INDEV_STATE_PR | ||
− | : <span style="background-color: #eeeeee;"> | + | |<span style="background-color:#e7f2fa;color:#2980b9;">struct '''lv_indev_data_t'''</span> |
− | :: | + | :''#include <lv_hal_i'ndev.h>'' |
− | + | : 入力ドライバーに渡されて入力されるデータ構造 | |
− | <span style="background-color: #e7f2fa; color: #2980b9;">struct _lv_indev_drv_t </span> | + | :'''パブリックメンバー''' |
− | : ''#include <lv_hal_i'ndev.h>'' | + | :<span style="background-color: #eeeeee;">lv_point_t '''point'''</span> |
+ | :: LV_INDEV_TYPE_POINTERの場合、現在押されているポイント | ||
+ | :<span style="background-color: #eeeeee;">uint32_t '''key'''</span> | ||
+ | :: LV_INDEV_TYPE_KEYPADの場合、現在押されているキー | ||
+ | :<span style="background-color: #eeeeee;">uint32_t '''btn_id'''</span> | ||
+ | :: LV_INDEV_TYPE_BUTTONの場合、現在押されているボタン | ||
+ | :<span style="background-color: #eeeeee;">int16_t '''enc_diff'''</span> | ||
+ | :: LV_INDEV_TYPE_ENCODERの場合、前回の読み取り以降のステップ数 | ||
+ | :[https://docs.lvgl.io/8.2/porting/indev.html#_CPPv416lv_indev_state_t <span style="background-color: #eeeeee;">lv_indev_state_t</span>] <span style="background-color: #eeeeee;">'''state'''</span> | ||
+ | :: LV_INDEV_STATE_RELまたはLV_INDEV_STATE_PR | ||
+ | |- | ||
+ | |<span style="background-color: #e7f2fa; color: #2980b9;">struct _lv_indev_drv_t </span> | ||
+ | :''#include <lv_hal_i'ndev.h>'' | ||
: Initialized by the user and registered by 'lv_indev_add()' | : Initialized by the user and registered by 'lv_indev_add()' | ||
: | : | ||
− | : '''Public Members''' | + | :'''Public Members''' |
− | : <span style="background-color: #eeeeee;">[https://docs.lvgl.io/8.2/porting/indev.html#_CPPv415lv_indev_type_t ''' | + | :<span style="background-color: #eeeeee;">[https://docs.lvgl.io/8.2/porting/indev.html#_CPPv415lv_indev_type_t lv_indev_type_t] '''type'''</span> |
:: < Input device type Function pointer to read input device data. | :: < Input device type Function pointer to read input device data. | ||
− | : <span style="background-color: #eeeeee;">void (*read_cb)(struct _[https://docs.lvgl.io/8.2/porting/indev.html#_CPPv415_lv_indev_drv_t | + | :<span style="background-color: #eeeeee;">void (*'''read_cb''')(struct _[https://docs.lvgl.io/8.2/porting/indev.html#_CPPv415_lv_indev_drv_t lv_indev_drv_t] *indev_drv, [https://docs.lvgl.io/8.2/porting/indev.html#_CPPv415lv_indev_data_t lv_indev_data_t] *data)</span> |
:: | :: | ||
− | : <span style="background-color: #eeeeee;">void (*feedback_cb)(struct _[https://docs.lvgl.io/8.2/porting/indev.html#_CPPv415_lv_indev_drv_t | + | :<span style="background-color: #eeeeee;">void (*'''feedback_cb''')(struct _[https://docs.lvgl.io/8.2/porting/indev.html#_CPPv415_lv_indev_drv_t lv_indev_drv_t]*, uint8_t)</span> |
− | :: Called when an action happened on the input device. | + | :: Called when an action happened on the input device. |
:: The second parameter is the event from <code style="color: #bb0000;">lv_event_t</code> | :: The second parameter is the event from <code style="color: #bb0000;">lv_event_t</code> | ||
− | : <span style="background-color: #eeeeee;"> | + | :<span style="background-color: #eeeeee;">lv_indev_drv_user_data_t<code>'''user_data'''</code></span> |
:: | :: | ||
− | : <span style="background-color: #eeeeee;">struct _[https://docs.lvgl.io/8.2/porting/display.html#_CPPv410_lv_disp_t ''' | + | :<span style="background-color: #eeeeee;">struct _[https://docs.lvgl.io/8.2/porting/display.html#_CPPv410_lv_disp_t lv_disp_t] *'''disp'''</span> |
:: < Pointer to the assigned display Timer to periodically read the input device | :: < Pointer to the assigned display Timer to periodically read the input device | ||
− | : <span style="background-color: #eeeeee;">[https://docs.lvgl.io/8.2/overview/timer.html#_CPPv410lv_timer_t ''' | + | :<span style="background-color: #eeeeee;">[https://docs.lvgl.io/8.2/overview/timer.html#_CPPv410lv_timer_t lv_timer_t] *'''read_task'''</span> |
:: Number of pixels to slide before actually drag the object | :: Number of pixels to slide before actually drag the object | ||
− | : <span style="background-color: #eeeeee;">uint8_t | + | :<span style="background-color: #eeeeee;">uint8_t '''drag_limit''' </span> |
− | :: Drag throw slow-down in [%]. | + | :: Drag throw slow-down in [%]. |
:: Greater value means faster slow-down | :: Greater value means faster slow-down | ||
− | : <span style="background-color: #eeeeee;">uint8_t | + | :<span style="background-color: #eeeeee;">uint8_t '''drag_throw''' </span> |
:: At least this difference should be between two points to evaluate as gesture | :: At least this difference should be between two points to evaluate as gesture | ||
− | : <span style="background-color: #eeeeee;">uint8_t gesture_min_velocity </span> | + | :<span style="background-color: #eeeeee;">uint8_t '''gesture_min_velocity''' </span> |
:: At least this difference should be to send a gesture | :: At least this difference should be to send a gesture | ||
− | : <span style="background-color: #eeeeee;">uint8_t gesture_limit </span> | + | :<span style="background-color: #eeeeee;">uint8_t '''gesture_limit''' </span> |
:: Long press time in milliseconds | :: Long press time in milliseconds | ||
− | : <span style="background-color: #eeeeee;">uint16_t long_press_time </span> | + | :<span style="background-color: #eeeeee;">uint16_t '''long_press_time''' </span> |
:: Repeated trigger period in long press [ms] | :: Repeated trigger period in long press [ms] | ||
− | : <span style="background-color: #eeeeee;">uint16_t | + | :<span style="background-color: #eeeeee;">uint16_t '''long_press_rep_time''' </span>(repeat) |
+ | |<span style="background-color:#e7f2fa;color:#2980b9;">struct _lv_indev_drv_t</span> | ||
+ | :''#include <lv_hal_i'ndev.h>'' | ||
+ | : ユーザーによって初期化され、「lv_indev_add()」によって登録されます | ||
+ | : | ||
+ | :'''パブリックメンバー''' | ||
+ | :[https://docs.lvgl.io/8.2/porting/indev.html#_CPPv415lv_indev_type_t <span style="background-color: #eeeeee;">lv_indev_type_t</span>] <span style="background-color: #eeeeee;">'''type'''</span> | ||
+ | :: <入力デバイスタイプ入力デバイスデータを読み取るための関数ポインタ。 | ||
+ | :<span style="background-color: #eeeeee;">void (*'''read_cb''')(struct _[https://docs.lvgl.io/8.2/porting/indev.html#_CPPv415_lv_indev_drv_t lv_indev_drv_t] *indev_drv, [https://docs.lvgl.io/8.2/porting/indev.html#_CPPv415lv_indev_data_t lv_indev_data_t] *data)</span> | ||
+ | :: | ||
+ | :<span style="background-color: #eeeeee;">void (*'''feedback_cb''')(struct _[https://docs.lvgl.io/8.2/porting/indev.html#_CPPv415_lv_indev_drv_t lv_indev_drv_t]*, uint8_t)</span> | ||
+ | :: 入力デバイスでアクションが発生したときに呼び出されます。 | ||
+ | :: 2番目のパラメータはからのイベントです<code style="color: #bb0000;">lv_event_t</code> | ||
+ | :<span style="background-color: #eeeeee;">lv_indev_drv_user_data_t<code>'''user_data'''</code></span> | ||
+ | :: | ||
+ | :<span style="background-color: #eeeeee;">struct _[https://docs.lvgl.io/8.2/porting/display.html#_CPPv410_lv_disp_t lv_disp_t] *'''disp'''</span> | ||
+ | :: <入力デバイスを定期的に読み取るための割り当てられたディスプレイタイマーへのポインタ | ||
+ | :<span style="background-color: #eeeeee;">[https://docs.lvgl.io/8.2/overview/timer.html#_CPPv410lv_timer_t lv_timer_t] *'''read_task'''</span> | ||
+ | :: オブジェクトを実際にドラッグする前にスライドするピクセル数 | ||
+ | :<span style="background-color: #eeeeee;">uint8_t '''drag_limit'''</span> | ||
+ | :: [%]でスロースローダウンをドラッグします。 | ||
+ | :: 値が大きいほど、速度が速くなります | ||
+ | :<span style="background-color: #eeeeee;">uint8_t '''drag_throw'''</span> | ||
+ | :: ジェスチャーとして評価するには、少なくともこの違いは2つのポイントの間にある必要があります | ||
+ | :<span style="background-color: #eeeeee;">uint8_t '''gesture_min_velocity'''</span> | ||
+ | :: 少なくともこの違いは、ジェスチャーを送信することです | ||
+ | :<span style="background-color: #eeeeee;">uint8_t '''gesture_limit'''</span> | ||
+ | :: ミリ秒単位の長押し時間 | ||
+ | :<span style="background-color: #eeeeee;">uint16_t '''long_press_time'''</span> | ||
+ | :: 長押しで繰り返されるトリガー期間[ms] | ||
+ | :<span style="background-color: #eeeeee;">uint16_t '''long_press_rep_time'''</span> | ||
:: | :: | ||
− | + | |- | |
− | <span style="background-color: #e7f2fa; color: #2980b9;">struct _lv_indev_proc_t </span> | + | |<span style="background-color: #e7f2fa; color: #2980b9;">struct _lv_indev_proc_t </span> |
− | : ''#include <lv_hal_indev.h>'' Run time data of input devices Internally used by the library, you should not need to touch it. | + | :''#include <lv_hal_indev.h>'' Run time data of input devices Internally used by the library, you should not need to touch it. |
: | : | ||
− | : '''Public Members''' | + | :'''Public Members''' |
− | :<span style="background-color: #eeeeee;">[https://docs.lvgl.io/8.2/porting/indev.html#_CPPv416lv_indev_state_t ''' | + | :<span style="background-color: #eeeeee;">[https://docs.lvgl.io/8.2/porting/indev.html#_CPPv416lv_indev_state_t lv_indev_state_t] '''state'''</span> |
:: Current state of the input device. | :: Current state of the input device. | ||
− | + | :<span style="background-color: #eeeeee;">lv_point_t '''act_point''' </span> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | : <span style="background-color: #eeeeee;">lv_point_t act_point </span> | ||
:: Current point of input device. | :: Current point of input device. | ||
− | : <span style="background-color: #eeeeee;">lv_point_t last_point </span> | + | :<span style="background-color: #eeeeee;">lv_point_t '''last_point''' </span> |
:: Last point of input device. | :: Last point of input device. | ||
− | : <span style="background-color: #eeeeee;">lv_point_t last_raw_point </span> | + | :<span style="background-color: #eeeeee;">lv_point_t '''last_raw_point''' </span> |
:: Last point read from read_cb. | :: Last point read from read_cb. | ||
− | : <span style="background-color: #eeeeee;">lv_point_t vect </span> | + | :<span style="background-color: #eeeeee;">lv_point_t '''vect''' </span> |
:: Difference between <code style="color: #bb0000;">act_point</code> and <code style="color: #bb0000;">last_point</code>. | :: Difference between <code style="color: #bb0000;">act_point</code> and <code style="color: #bb0000;">last_point</code>. | ||
− | : <span style="background-color: #eeeeee;">lv_point_t | + | :<span style="background-color: #eeeeee;">lv_point_t '''drag_sum''' </span> |
:: | :: | ||
− | : <span style="background-color: #eeeeee;">lv_point_t scroll_throw_vect </span> | + | :<span style="background-color: #eeeeee;">lv_point_t '''scroll_throw_vect''' </span> |
:: | :: | ||
− | : <span style="background-color: #eeeeee;">lv_point_t scroll_throw_vect_ori </span> | + | :<span style="background-color: #eeeeee;">lv_point_t '''scroll_throw_vect_ori''' </span> |
:: | :: | ||
− | : <span style="background-color: #eeeeee;">struct _[https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv49_lv_obj_t ''' | + | :<span style="background-color: #eeeeee;">struct _[https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv49_lv_obj_t lv_obj_t] *'''act_obj'''</span> |
:: | :: | ||
− | : <span style="background-color: #eeeeee;">struct _[https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv49_lv_obj_t ''' | + | :<span style="background-color: #eeeeee;">struct _[https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv49_lv_obj_t lv_obj_t] *'''last_obj'''</span> |
:: | :: | ||
− | : <span style="background-color: #eeeeee;">struct _[https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv49_lv_obj_t ''' | + | :<span style="background-color: #eeeeee;">struct _[https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv49_lv_obj_t lv_obj_t] *'''scroll_obj'''</span> |
:: | :: | ||
− | : <span style="background-color: #eeeeee;">struct _[https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv49_lv_obj_t ''' | + | :<span style="background-color: #eeeeee;">struct _[https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv49_lv_obj_t lv_obj_t] *'''last_pressed'''</span> |
− | : | + | : |
− | + | : | |
− | + | : <span style="background-color: #eeeeee;">lv_dir_t '''gesture_dir''' </span> | |
− | |||
− | |||
− | : <span style="background-color: #eeeeee;">lv_dir_t | ||
:: | :: | ||
− | : <span style="background-color: #eeeeee;"> | + | :<span style="background-color: #eeeeee;">uint8_t '''gesture_sent''' </span> |
:: | :: | ||
− | : <span style="background-color: #eeeeee;"> | + | :<span style="background-color: #eeeeee;">struct _[https://docs.lvgl.io/8.2/porting/indev.html#_CPPv416_lv_indev_proc_t lv_indev_proc_t]::[anonymous]::[anonymous] '''pointer'''</span> |
:: | :: | ||
− | : <span style="background-color: #eeeeee;"> | + | :<span style="background-color: #eeeeee;">[https://docs.lvgl.io/8.2/porting/indev.html#_CPPv416lv_indev_state_t lv_indev_state_t] '''last_state''' </span> |
:: | :: | ||
− | : <span style="background-color: #eeeeee;"> | + | :<span style="background-color: #eeeeee;">uint32_t '''last_key''' </span> |
:: | :: | ||
− | : <span style="background-color: #eeeeee;"> | + | :<span style="background-color: #eeeeee;">struct _[https://docs.lvgl.io/8.2/porting/indev.html#_CPPv416_lv_indev_proc_t lv_indev_proc_t]::[anonymous]::[anonymous] '''keypad'''</span> |
:: | :: | ||
− | + | :<span style="background-color: #eeeeee;">union _[https://docs.lvgl.io/8.2/porting/indev.html#_CPPv416_lv_indev_proc_t lv_indev_proc_t]::[anonymous] '''types''' </span> | |
− | |||
− | : <span style="background-color: #eeeeee;">union _[https://docs.lvgl.io/8.2/porting/indev.html#_CPPv416_lv_indev_proc_t lv_indev_proc_t] | ||
:: | :: | ||
− | : <span style="background-color: #eeeeee;">uint32_t pr_timestamp </span> | + | :<span style="background-color: #eeeeee;">uint32_t '''pr_timestamp''' </span> |
:: Pressed time stamp | :: Pressed time stamp | ||
− | : <span style="background-color: #eeeeee;">uint32_t longpr_rep_timestamp </span> | + | :<span style="background-color: #eeeeee;">uint32_t '''longpr_rep_timestamp''' </span> |
− | :: Long press repeat time stamp | + | :: Long press repeat time stamp ---- |
− | + | : <span style="background-color: #eeeeee;">uint8_t '''long_pr_sent''' </span> | |
− | |||
− | : <span style="background-color: #eeeeee;"> | ||
:: | :: | ||
− | : <span style="background-color: #eeeeee;"> | + | :<span style="background-color: #eeeeee;">uint8_t '''reset_query''' </span> |
:: | :: | ||
− | : <span style="background-color: #eeeeee;"> | + | :<span style="background-color: #eeeeee;">uint8_t '''disabled''' </span> |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
:: | :: | ||
− | : <span style="background-color: #eeeeee;"> | + | :<span style="background-color: #eeeeee;">uint8_t '''wait_until_release''' </span> |
− | + | |<span style="background-color:#e7f2fa;color:#2980b9;">struct _lv_indev_proc_t</span> | |
− | + | :''#include <lv_hal_indev.h>''入力デバイスの実行時データライブラリによって内部的に使用されるため、ライブラリに触れる必要はありません。 | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | <span style="background-color:#e7f2fa;color:#2980b9;">struct _lv_indev_proc_t</span> | ||
− | |||
− | : ''#include <lv_hal_indev.h>''入力デバイスの実行時データライブラリによって内部的に使用されるため、ライブラリに触れる必要はありません。 | ||
: | : | ||
− | : '''パブリックメンバー''' | + | :'''パブリックメンバー''' |
− | : <span style="background-color: #eeeeee;">''' | + | :[https://docs.lvgl.io/8.2/porting/indev.html#_CPPv416lv_indev_state_t <span style="background-color: #eeeeee;">lv_indev_state_t</span>] <span style="background-color: #eeeeee;">'''state'''</span> |
:: 入力デバイスの現在の状態。 | :: 入力デバイスの現在の状態。 | ||
− | + | : | |
− | + | :<span style="background-color: #eeeeee;">lv_point_t '''act_point'''</span> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | : <span style="background-color: #eeeeee;">lv_point_t act_point</span> | ||
:: 入力デバイスの現在のポイント。 | :: 入力デバイスの現在のポイント。 | ||
− | : <span style="background-color: #eeeeee;">lv_point_t last_point</span> | + | :<span style="background-color: #eeeeee;">lv_point_t '''last_point'''</span> |
:: 入力デバイスの最後のポイント。 | :: 入力デバイスの最後のポイント。 | ||
− | : <span style="background-color: #eeeeee;">lv_point_t last_raw_point</span> | + | :<span style="background-color: #eeeeee;">lv_point_t '''last_raw_point'''</span> |
:: read_cbから読み取られた最後のポイント。 | :: read_cbから読み取られた最後のポイント。 | ||
− | : <span style="background-color: #eeeeee;">lv_point_t vect</span> | + | :<span style="background-color: #eeeeee;">lv_point_t '''vect'''</span> |
− | :: <font class="goog-text-highlight">入力デバイスを登録するには、</font><code style="color: #bb0000;">act_point</code>との違い<code style="color: #bb0000;">last_point</code>。 | + | ::<font class="goog-text-highlight">入力デバイスを登録するには、</font><code style="color: #bb0000;">act_point</code>との違い<code style="color: #bb0000;">last_point</code>。 |
− | : <span style="background-color: #eeeeee;">lv_point_t | + | :<span style="background-color: #eeeeee;">lv_point_t '''drag_sum'''</span> |
:: | :: | ||
− | : <span style="background-color: #eeeeee;">lv_point_t scroll_throw_vect</span> | + | :<span style="background-color: #eeeeee;">lv_point_t '''scroll_throw_vect'''</span> |
:: | :: | ||
− | : <span style="background-color: #eeeeee;">lv_point_t scroll_throw_vect_ori</span> | + | :<span style="background-color: #eeeeee;">lv_point_t '''scroll_throw_vect_ori'''</span> |
:: | :: | ||
− | : <span style="background-color: #eeeeee;">struct _ ''' | + | :<span style="background-color: #eeeeee;">struct _[https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv49_lv_obj_t lv_obj_t] *'''act_obj'''</span> |
:: | :: | ||
− | : <span style="background-color: #eeeeee;">struct _ ''' | + | :<span style="background-color: #eeeeee;">struct _[https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv49_lv_obj_t lv_obj_t] *'''last_obj'''</span> |
:: | :: | ||
− | : <span style="background-color: #eeeeee;">struct _ ''' | + | :<span style="background-color: #eeeeee;">struct _[https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv49_lv_obj_t lv_obj_t] *'''scroll_obj'''</span> |
:: | :: | ||
− | : <span style="background-color: #eeeeee;">struct _ ''' | + | :<span style="background-color: #eeeeee;">struct _[https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv49_lv_obj_t lv_obj_t] *'''last_pressed'''</span> |
:: | :: | ||
− | : <span style="background-color: #eeeeee;"> | + | :<span style="background-color: #eeeeee;">lv_dir_t '''gesture_dir'''</span> |
:: | :: | ||
− | : <span style="background-color: #eeeeee;"> | + | :<span style="background-color: #eeeeee;">uint8_t '''gesture_sent'''</span> |
:: | :: | ||
− | : <span style="background-color: #eeeeee;"> | + | :<span style="background-color: #eeeeee;">struct _[https://docs.lvgl.io/8.2/porting/indev.html#_CPPv416_lv_indev_proc_t lv_indev_proc_t]::[anonymous]::[anonymous] '''pointer'''</span> |
:: | :: | ||
− | : <span style="background-color: #eeeeee;"> | + | :[https://docs.lvgl.io/8.2/porting/indev.html#_CPPv416lv_indev_state_t <span style="background-color: #eeeeee;">lv_indev_state_t</span>] <span style="background-color: #eeeeee;">'''last_state'''</span> |
:: | :: | ||
− | : <span style="background-color: #eeeeee;"> | + | :<span style="background-color: #eeeeee;">uint32_t '''last_key'''</span> |
:: | :: | ||
− | : <span style="background-color: #eeeeee;">struct _ | + | :<span style="background-color: #eeeeee;">struct _[https://docs.lvgl.io/8.2/porting/indev.html#_CPPv416_lv_indev_proc_t lv_indev_proc_t]::[anonymous]::[anonymous] '''keypad'''</span> |
:: | :: | ||
− | : <span style="background-color: #eeeeee;">''' | + | :<span style="background-color: #eeeeee;">union _[https://docs.lvgl.io/8.2/porting/indev.html#_CPPv416_lv_indev_proc_t lv_indev_proc_t]::[anonymous] '''types'''</span> |
:: | :: | ||
− | : <span style="background-color: #eeeeee;">uint32_t | + | :<span style="background-color: #eeeeee;">uint32_t '''pr_timestamp'''</span> |
+ | :: 押されたタイムスタンプ | ||
+ | :<span style="background-color: #eeeeee;">uint32_t '''longpr_rep_timestamp'''</span> | ||
+ | :: 長押しリピートタイムスタンプ | ||
+ | |||
+ | : <span style="background-color: #eeeeee;">uint8_t '''long_pr_sent'''</span> | ||
:: | :: | ||
− | : <span style="background-color: #eeeeee;"> | + | :<span style="background-color: #eeeeee;">uint8_t '''reset_query'''</span> |
:: | :: | ||
− | : <span style="background-color: #eeeeee;"> | + | :<span style="background-color: #eeeeee;">uint8_t '''disabled'''</span> |
:: | :: | ||
− | : <span style="background-color: #eeeeee;"> | + | :<span style="background-color: #eeeeee;">uint8_t '''wait_until_release'''</span> |
− | :: | + | |- |
− | : <span style="background-color: #eeeeee;"> | + | | |
− | :: | + | <span style="background-color: #e7f2fa; color: #2980b9;">struct _lv_indev_t </span> |
− | + | :''#include <lv_h'al_indev.h>'' | |
+ | : The main input device descriptor with driver, runtime data ('proc') and some additional information | ||
+ | : '''Public Members''' | ||
+ | :<span style="background-color: #eeeeee;">struct _[https://docs.lvgl.io/8.2/porting/indev.html#_CPPv415_lv_indev_drv_t lv_indev_drv_t] *'''driver'''</span> | ||
+ | :: | ||
+ | :<span style="background-color: #eeeeee;">[https://docs.lvgl.io/8.2/porting/indev.html#_CPPv416_lv_indev_proc_t _lv_indev_proc_t] '''proc'''</span> | ||
+ | :: | ||
+ | :<span style="background-color: #eeeeee;">struct _[https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv49_lv_obj_t lv_obj_t] *'''cursor'''</span> | ||
+ | :: Cursor for LV_INPUT_TYPE_POINTER | ||
+ | :<span style="background-color: #eeeeee;">struct _[https://docs.lvgl.io/8.2/overview/indev.html#_CPPv411_lv_group_t lv_group_t] *'''group'''</span> | ||
+ | :: Keypad destination group | ||
+ | :<span style="background-color: #eeeeee;">const lv_point_t *'''btn_points''' </span> | ||
+ | :: Array points assigned to the button ()screen will be pressed here by the buttons | ||
+ | | | ||
<span style="background-color:#e7f2fa;color:#2980b9;">struct _lv_indev_t</span> | <span style="background-color:#e7f2fa;color:#2980b9;">struct _lv_indev_t</span> | ||
− | : ''#include <lv_h'al_indev.h '''>'''''<nowiki/>''' | + | :''#include <lv_h'al_indev.h '''>''''' |
− | : struct _ ''' | + | : ドライバ、ランタイムデータ('proc')、いくつかの<nowiki/>追加情報を含む主入力デバイス記述子 |
+ | : '''パブリックメンバー''' | ||
+ | : struct _ lv_<nowiki/>indev_drv_t * '''driver''' | ||
:: | :: | ||
− | : <span style="background-color: #eeeeee;">''' | + | :<span style="background-color: #eeeeee;">_lv_indev_proc_t '''proc'''</span> |
:: | :: | ||
− | : <span style="background-color: #eeeeee;">struct _ ''' | + | :<span style="background-color: #eeeeee;">struct _ lv_obj_t * '''cursor'''</span> |
:: LV_INPUT_TYPE_POINTERのカーソル | :: LV_INPUT_TYPE_POINTERのカーソル | ||
− | : <span style="background-color: #eeeeee;">struct _ ''' | + | :<span style="background-color: #eeeeee;">struct _ lv_group_t * '''group'''</span> |
:: キーパッドの宛先グループ | :: キーパッドの宛先グループ | ||
− | : <span style="background-color: #eeeeee;">const lv_point_t * btn_points</span> | + | :<span style="background-color: #eeeeee;">const lv_point_t * '''btn_points'''</span> |
:: ボタン()画面に割り当てられた配列ポイントは、ここでボタンによって押されます | :: ボタン()画面に割り当てられた配列ポイントは、ここでボタンによって押されます | ||
|} | |} | ||
:[[App:Library:LVGL:docs:Porting#Input device interface|戻る : Previous]] | :[[App:Library:LVGL:docs:Porting#Input device interface|戻る : Previous]] |
2022年8月31日 (水) 01:04時点における最新版
https://docs.lvgl.io/8.2/porting/indev.html
Input device interface
Types of input devices
英文 | 自動翻訳 |
---|---|
To set up an input device an lv_indev_drv_t indev_drv;
lv_indev_drv_init(&indev_drv); /*Basic initialization*/
indev_drv.type =... /*See below.*/
indev_drv.read_cb =... /*See below.*/
/*Register the driver in LVGL and save the created input device object*/
lv_indev_t * my_indev = lv_indev_drv_register(&indev_drv);
Visit Input devices to learn more about input devices in general. |
入力デバイスを設定するには、変数lv_indev_drv_t を初期化する必要があります。
lv_indev_drv_t indev_drv ;
lv_indev_drv_init (&indev_drv ); /*基本的な初期化*/
indev_drv 。type = ... /*以下を参照してください。*/
indev_drv 。read_cb = ... /*以下を参照してください。* // * LVGL
にドライバーを登録し、作成した入力デバイスオブジェクトを保存します* /
lv_indev_t * my_indev = lv_indev_drv_register (&indev_drv );
|
Touchpad, mouse or any pointer
英文 | 自動翻訳 |
---|---|
Input devices that can click points on the screen belong to this category. indev_drv.type = LV_INDEV_TYPE_POINTER;
indev_drv.read_cb = my_input_read;
...
void my_input_read(lv_indev_drv_t * drv, lv_indev_data_t*data)
{
if(touchpad_pressed) {
data->point.x = touchpad_x;
data->point.y = touchpad_y;
data->state = LV_INDEV_STATE_PRESSED;
} else {
data->state = LV_INDEV_STATE_RELEASED;
}
}
Important : |
画面上のポイントをクリックできる入力デバイスは、このカテゴリに属します。
indev_drv 。タイプ = LV_INDEV_TYPE_POINTER ;
indev_drv 。read_cb = my_input_read ;
...
void my_input_read (lv_indev_drv_t * drv 、 lv_indev_data_t * data )
{
if (touchpad_pressed ) {
data- > point 。x = touchpad_x ;
データ->ポイント。y = touchpad_y ;
データ->状態 = LV_INDEV_STATE_PRESSED ;
} else {
データ->状態 = LV_INDEV_STATE_RELEASED ;
}
}
Important : |
Keypad or keyboard
英文 | 自動翻訳 |
---|---|
Full keyboards with all the letters or simple keypads with a few navigation buttons belong here. To use a keyboard/keypad:
indev_drv.type = LV_INDEV_TYPE_KEYPAD;
indev_drv.read_cb = keyboard_read;
...
bool keyboard_read(lv_indev_drv_t * drv, lv_indev_data_t*data){
data->key = last_key(); /*Get the last pressed or released key*/
if(key_pressed()) data->state = LV_INDEV_STATE_PRESSED;
else data->state = LV_INDEV_STATE_RELEASED;
return false; /*No buffering now so no more data read*/
}
|
キーボード/キーパッドを使用するには:
indev_drv 。タイプ = LV_INDEV_TYPE_KEYPAD ;
indev_drv 。read_cb = Keyboard_read ;
...
bool Keyboard_read (lv_indev_drv_t * drv 、 lv_indev_data_t * data ){
data- > key = last_key (); /*最後に押されたキーまたはリリースされたキーを取得します*/
if (key_pressed ()) data- > state = LV_INDEV_STATE_PRESSED ;
else データ->状態 = LV_INDEV_STATE_RELEASED ;
return false; /*現在はバッファリングがないため、データの読み取りはありません*/
}
|
Encoder
英文 | 自動翻訳 |
---|---|
With an encoder you can do the following:
indev_drv.type = LV_INDEV_TYPE_ENCODER;
indev_drv.read_cb = encoder_read;
...
bool encoder_read(lv_indev_drv_t * drv, lv_indev_data_t*data){
data->enc_diff = enc_get_new_moves();
if(enc_pressed()) data->state = LV_INDEV_STATE_PRESSED;
else data->state = LV_INDEV_STATE_RELEASED;
return false; /*No buffering now so no more data read*/
}
|
つまり、エンコーダ入力デバイスは次のように機能します。
エンコーダー(キーパッドと同様) を使用するには、オブジェクトをグループに追加する必要があります。 indev_drv.type = LV_INDEV_TYPE_ENCODER;
indev_drv.read_cb = encoder_read;
...
bool encoder_read(lv_indev_drv_t * drv, lv_indev_data_t*data){
data->enc_diff = enc_get_new_moves();
if(enc_pressed()) data->state = LV_INDEV_STATE_PRESSED;
else data->state = LV_INDEV_STATE_RELEASED;
return false; /*現在はバッファリングがないため、データの読み取りはありません*/
}
|
Using buttons with Encoder logic
英文 | 自動翻訳 |
---|---|
In addition to standard encoder behavior, you can also utilize its logic to navigate(focus) and edit widgets using buttons. This is especially handy if you have only few buttons available, or you want to use other buttons in addition to encoder wheel.
indev_drv.type = LV_INDEV_TYPE_ENCODER;
indev_drv.read_cb = encoder_with_keys_read;
...
bool encoder_with_keys_read(lv_indev_drv_t * drv, lv_indev_data_t*data){
data->key = last_key(); /*Get the last pressed or released key*/
/* use LV_KEY_ENTER for encoder press */
if(key_pressed()) data->state = LV_INDEV_STATE_PRESSED;
else {
data->state = LV_INDEV_STATE_RELEASED;
/* Optionally you can also use enc_diff, if you have encoder*/
data->enc_diff = enc_get_new_moves();
}
return false; /*No buffering now so no more data read*/
}
|
3つのボタンを使用できるようにする必要があります。
キーを押したままにすると、で指定された期間でエンコーダの前進をシミュレートします indev_drv.type = LV_INDEV_TYPE_ENCODER;
indev_drv.read_cb = encoder_with_keys_read;
...
bool encoder_with_keys_read(lv_indev_drv_t * drv, lv_indev_data_t*data){
data->key = last_key(); /*最後に押されたキーまたは離されたキーを取得します*/
/*エンコーダーを押すためにLV_KEY_ENTERを使用します*/
if(key_pressed()) data->state = LV_INDEV_STATE_PRESSED;
else {
data->state = LV_INDEV_STATE_RELEASED;
/* Optionally you can also use enc_diff, if you have encoder*/
data->enc_diff = enc_get_new_moves();
}
return false; /*エンコーダーがある場合は、オプションでenc_diffを使用することもできます*/
}
|
Button
英文 | 自動翻訳 |
---|---|
Buttons mean external "hardware" buttons next to the screen which are assigned to specific coordinates of the screen. If a button is pressed it will simulate the pressing on the assigned coordinate. (Similarly to a touchpad)
Important: The points_array can't go out of scope. Either declare it as a global variable or as a static variable inside a function. indev_drv.type = LV_INDEV_TYPE_BUTTON;
indev_drv.read_cb = button_read;
...
bool button_read(lv_indev_drv_t * drv, lv_indev_data_t*data){
static uint32_t last_btn = 0; /*Store the last pressed button*/
int btn_pr = my_btn_read(); /*Get the ID (0,1,2...) of the pressed button*/
if(btn_pr >= 0) { /*Is there a button press? (E.g. -1 indicated no button was pressed)*/
last_btn = btn_pr; /*Save the ID of the pressed button*/
data->state = LV_INDEV_STATE_PRESSED; /*Set the pressed state*/
} else {
data->state = LV_INDEV_STATE_RELEASED; /*Set the released state*/
}
data->btn = last_btn; /*Save the last button*/
return false; /*No buffering now so no more data read*/
}
|
ボタンを座標に割り当てるには、を使用します
重要:points_arrayはスコープ外に出ることはできません。グローバル変数または関数内の静的変数として宣言します。 indev_drv.type = LV_INDEV_TYPE_BUTTON;
indev_drv.read_cb = button_read;
...
bool button_read(lv_indev_drv_t * drv, lv_indev_data_t*data){
static uint32_t last_btn = 0; /*最後に押されたボタンを保存します*/
int btn_pr = my_btn_read(); /*押されたボタンのID(0,1,2 ...)を取得します*/
if(btn_pr >= 0) { /*ボタンが押されたか?(例-1はボタンが押されていないことを示します)*/
last_btn = btn_pr; /*押されたボタンのIDを保存します*/
data->state = LV_INDEV_STATE_PRESSED; /*押された状態を設定します*/
} else {
data->state = LV_INDEV_STATE_RELEASED; /*リリース状態を設定します*/
}
data->btn = last_btn; /*最後のボタンを保存します*/
return false; /*バッファリングがなくなったので、これ以上データを読み込まない*/
}
|
Other features
英文 | 自動翻訳 |
---|---|
Besides read_cb a feedback_cb callback can be also specified in lv_indev_drv_t . feedback_cb is called when any type of event is sent by the input devices. (independently from its type). It allows making feedback for the user e.g. to play a sound on LV_EVENT_CLICK .
|
read_cbの他に、feedback_cbコールバックをlv_indev_drv_tに指定することができる。feedback_cbは、入力デバイスから何らかのタイプのイベントが送信されると呼び出される。(イベントの種類によらず)呼び出されます。例えば、LV_EVENT_CLICKで音を鳴らすなど、ユーザーへのフィードバックが可能になります。 |
The default value of the following parameters can be set in lv_conf.h but the default value can be overwritten in lv_indev_drv_t :
|
以下のパラメータのデフォルト値は lv_conf.h で設定できるが、lv_indev_drv_t でデフォルト値を上書きすることができる。
|
Every Input device is associated with a display. By default, a new input device is added to the lastly created or the explicitly selected (using lv_disp_set_default() ) display. The associated display is stored and can be changed in disp field of the driver.
|
すべての入力デバイスは、ディスプレイと関連付けられています。デフォルトでは、新しい入力デバイスは、最後に作成されたディスプレイか、明示的に選択された(lv_disp_set_default()を使用した)ディスプレイに追加されます。
関連付けられたディスプレイは、ドライバのdispフィールドに保存され、変更することができる。 |
API
英文 | 自動翻訳 |
---|---|
Input Device HAL interface layer header file Typedefs typedef struct _lv_indev_drv_t lv_indev_drv_t
typedef struct _lv_indev_proc_t _lv_indev_proc_t
typedef struct _lv_indev_t lv_indev_t
|
入力デバイスHALインターフェイスレイヤーヘッダーファイル Typedef typedef struct _ lv_indev_drv_t lv_indev_drv_t
typedef struct _ lv_indev_proc_t _lv_indev_proc_t
typedef struct _ lv_indev_t lv_indev_t
|
Enums
英文 | 自動翻訳 |
---|---|
enum lv_indev_type_t
|
列挙型lv_indev_type_t
|
enum [anonymous]
|
列挙型lv_indev_state_t
|
enum [anonymous]
|
enum [anonymous] |
enum [anonymous] | enum [anonymous] |
Functions
英文 | 自動翻訳 |
---|---|
void lv_indev_drv_init(struct _lv_indev_drv_t *driver)
lv_indev_t *lv_indev_drv_register(struct _lv_indev_drv_t *driver)
|
void lv_indev_drv_init(struct _ lv_indev_drv_t * driver)
lv_indev_t * lv_indev_drv_register(struct _ lv_indev_drv_t * driver)
|
void lv_indev_drv_update(lv_indev_t *indev, struct _lv_indev_drv_t *new_drv)
|
void lv_indev_drv_update(lv_indev_t * indev、struct _lv_indev_drv_t * new_drv)
|
lv_indev_t *lv_indev_get_next(lv_indev_t *indev)
void _lv_indev_read(lv_indev_t *indev, lv_indev_data_t *data)
|
lv_indev_t * lv_indev_get_next( lv_indev_t * indev)
void _lv_indev_read(lv_indev_t * indev、lv_indev_data_t * data)
|
struct lv_indev_data_t
|
struct lv_indev_data_t
|
struct _lv_indev_drv_t
|
struct _lv_indev_drv_t
|
struct _lv_indev_proc_t
|
struct _lv_indev_proc_t
|
struct _lv_indev_t
|
struct _lv_indev_t
|