https://docs.lvgl.io/8.2/porting/indev.html
Input device interface
Types of input devices
英文
|
自動翻訳
|
To register an input device an lv_indev_drv_t variable has to be initialized.
Be sure to register at least one display before you register any input devices.
lv_disp_drv_register(&disp_drv);
static 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);
The type member can be:
LV_INDEV_TYPE_POINTER touchpad or mouse
LV_INDEV_TYPE_KEYPAD keyboard or keypad
LV_INDEV_TYPE_ENCODER encoder with left/right turn and push options
LV_INDEV_TYPE_BUTTON external buttons virtually pressing the screen
read_cb is a function pointer which will be called periodically to report the current state of an input device.
Visit Input devices to learn more about input devices in general.
|
入力デバイスを登録するには、変数lv_indev_drv_t を初期化する必要があります。
入力デバイスを登録する前に、必ず少なくとも1つのディスプレイを登録してください。
lv_disp_drv_register (&disp_drv );
static 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 );
type メンバーは次 のようになります。
LV_INDEV_TYPE_POINTER タッチパッドまたはマウス
LV_INDEV_TYPE_KEYPAD キーボードまたはキーパッド
LV_INDEV_TYPE_ENCODER 左/右回転およびプッシュオプション付きエンコーダ
LV_INDEV_TYPE_BUTTON 画面を仮想的に押す外部ボタン
read_cb 入力デバイスの現在の状態を報告するために定期的に呼び出される関数ポインタです。
一般的な入力デバイスの詳細については、入力デバイスにアクセスしてください。
|
- 戻る : Previous
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;
}
}
To set a mouse cursor use lv_indev_set_cursor(my_indev, &img_cursor) . (my_indev is the return value of lv_indev_drv_register )
|
画面上のポイントをクリックできる入力デバイスは、このカテゴリに属します。
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 ;
}
}
マウスカーソルを設定するには、を使用しますlv_indev_set_cursor(my_indev, &img_cursor) 。(my_indev はの戻り値ですlv_indev_drv_register )
|
- 戻る : Previous
Keypad or keyboard
英文
|
自動翻訳
|
Full keyboards with all the letters or simple keypads with a few navigation buttons belong here.
To use a keyboard/keypad:
- Register a
read_cb function with LV_INDEV_TYPE_KEYPAD type.
- An object group has to be created:
lv_group_t * g = lv_group_create() and objects have to be added to it with lv_group_add_obj(g, obj)
- The created group has to be assigned to an input device:
lv_indev_set_group(my_indev, g) (my_indev is the return value of lv_indev_drv_register )
- Use
LV_KEY_... to navigate among the objects in the group. See lv_core/lv_group.h for the available keys.
indev_drv.type = LV_INDEV_TYPE_KEYPAD;
indev_drv.read_cb = keyboard_read;
...
void 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;
}
|
すべての文字を含むフルキーボード、またはいくつかのナビゲーションボタンを備えたシンプルなキーパッドがここに属します。
キーボード/キーパッドを使用するには:
- 入力デバイスを登録するには、
read_cb タイプで関数を登録しますLV_INDEV_TYPE_KEYPAD 。
- オブジェクトグループを作成する必要があります:
lv_group_t * g = lv_group_create() そしてオブジェクトを追加する必要がありますlv_group_add_obj(g, obj)
- 作成されたグループは、入力デバイスに割り当てる必要があります:(
lv_indev_set_group(my_indev, g) はのmy_indev 戻り値ですlv_indev_drv_register )
- 入力デバイスを登録するには、
LV_KEY_... グループ内のオブジェクト間を移動するために使用します。lv_core/lv_group.h 使用可能なキーについては、を参照してください。
indev_drv 。タイプ = LV_INDEV_TYPE_KEYPAD ;
indev_drv 。read_cb = Keyboard_read ;
...
void 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 ;
}
|
- 戻る : Previous
Encoder
英文
|
自動翻訳
|
With an encoder you can do the following:
- Press its button
- Long-press its button
- Turn left
- Turn right
In short, the Encoder input devices work like this:
- By turning the encoder you can focus on the next/previous object.
- When you press the encoder on a simple object (like a button), it will be clicked.
- If you press the encoder on a complex object (like a list, message box, etc.) the object will go to edit mode whereby you can navigate inside the object by turning the encoder.
- To leave edit mode, long press the button.
To use an Encoder (similarly to the Keypads) the objects should be added to groups.
indev_drv.type = LV_INDEV_TYPE_ENCODER;
indev_drv.read_cb = encoder_read;
...
void 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;
}
|
エンコーダーを使用すると、次のことができます。
- そのボタンを押す
- ボタンを長押しします
- 左折してください
- 右に曲がる
つまり、エンコーダ入力デバイスは次のように機能します。
- エンコーダーを回すと、次/前のオブジェクトに焦点を合わせることができます。
- 単純なオブジェクト(ボタンなど)でエンコーダーを押すと、クリックされます。
- 複雑なオブジェクト(リスト、メッセージボックスなど)でエンコーダーを押すと、オブジェクトは編集モードになり、エンコーダーを回してオブジェクト内を移動できます。
- 編集モードを終了するには、ボタンを長押しします。
エンコーダー(キーパッドと同様) を使用するには、オブジェクトをグループに追加する必要があります。
indev_drv 。タイプ = LV_INDEV_TYPE_ENCODER ;
indev_drv 。read_cb = エンコーダー読み取り;
...
void エンコーダー読み取り(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 データ->状態 = LV_INDEV_STATE_RELEASED ;
}
|
- 戻る : Previous
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.
You need to have 3 buttons available:
LV_KEY_ENTER will simulate press or pushing of the encoder button
LV_KEY_LEFT will simulate turning encoder left
LV_KEY_RIGHT will simulate turning encoder right
- other keys will be passed to the focused widget
If you hold the keys it will simulate an encoder advance with period specified in indev_drv.long_press_rep_time .
indev_drv.type = LV_INDEV_TYPE_ENCODER;
indev_drv.read_cb = encoder_with_keys_read;
...
void 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();
}
}
|
標準のエンコーダー動作に加えて、そのロジックを利用して、ボタンを使用してウィジェットをナビゲート(フォーカス)および編集することもできます。これは、使用できるボタンが少ない場合、またはエンコーダーホイールに加えて他のボタンを使用する場合に特に便利です。
3つのボタンを使用できるようにする必要があります。
LV_KEY_ENTER エンコーダボタンの押下または押下をシミュレートします
LV_KEY_LEFT エンコーダを左に回すシミュレーションを行います
LV_KEY_RIGHT エンコーダを右に回すシミュレーションを行います
- 他のキーはフォーカスされたウィジェットに渡されます
キーを押したままにすると、で指定された期間でエンコーダの前進をシミュレートしますindev_drv.long_press_rep_time 。
indev_drv 。タイプ = LV_INDEV_TYPE_ENCODER ;
indev_drv 。read_cb = エンコーダーwith_keys_read ;
...
void エンコーダ_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 {
データ->状態 = LV_INDEV_STATE_RELEASED ;
/ *エンコーダーがある場合は、オプションでenc_diffを使用することもできます* /
data- >enc_diff = enc_get_new_moves ();
}
}
|
- 戻る : Previous
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)
To assign buttons to coordinates use lv_indev_set_button_points(my_indev, points_array) .
points_array should look like const lv_point_t points_array[] = { {12,30},{60,90}, ...}
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;
...
void 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*/
}
|
ボタンとは、画面の特定の座標に割り当てられた、画面の横にある外部の「ハードウェア」ボタンを意味します。ボタンが押されると、割り当てられた座標の押下をシミュレートします。(タッチパッドと同様)
ボタンを座標に割り当てるには、を使用しますlv_indev_set_button_points(my_indev, points_array) 。
points_array 次のようになりますconst lv_point_t points_array[] = { {12,30},{60,90}, ...}
重要:points_arrayはスコープ外に出ることはできません。グローバル変数または関数内の静的変数として宣言します。
indev_drv 。タイプ = LV_INDEV_TYPE_BUTTON ;
indev_drv 。read_cb = button_read ;
...
void 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を保存します*/
データ->状態 = LV_INDEV_STATE_PRESSED ; /*押された状態を設定します*/
} else {
データ->状態 = LV_INDEV_STATE_RELEASED ; /*リリース状態を設定します*/
}
データ-> btn = last_btn ; /*最後のボタンを保存します*/
}
|
- 戻る : Previous
Other features
Parameters
英文
|
自動翻訳
|
The default value of the following parameters can be changed in lv_indev_drv_t :
scroll_limit Number of pixels to slide before actually scrolling the object.
scroll_throw Scroll throw (momentum) slow-down in [%]. Greater value means faster slow-down.
long_press_time Press time to send LV_EVENT_LONG_PRESSED (in milliseconds)
long_press_rep_time Interval of sending LV_EVENT_LONG_PRESSED_REPEAT (in milliseconds)
read_timer pointer to the lv_timer which reads the input device. Its parameters can be changed by lv_timer_...() functions. LV_INDEV_DEF_READ_PERIOD in lv_conf.h sets the default read period.
|
次のパラメータのデフォルト値は、lv_indev_drv_t で変更できます。
scroll_limit オブジェクトを実際にスクロールする前にスライドするピクセル数。
scroll_throw [%]でスロースロー(勢い)をスクロールします。値が大きいほど、速度が速くなります。
long_press_time :LV_EVENT_LONG_PRESSED を送信するのに押す時間(ミリ秒単位)
long_press_rep_time :LV_EVENT_LONG_PRESSED_REPEAT を送信する間隔(ミリ秒単位)
read_timer :入力デバイスを読み取るlv_timer へのポインタ。そのパラメータはlv_timer_...() 関数によって変更できます。lv_conf.h の中のLV_INDEV_DEF_READ_PERIOD では、デフォルトの読み取り期間を設定します。
|
- 戻る : Previous
Feedback
英文
|
自動翻訳
|
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 of its type).
This allows generating feedback for the user, e.g. to play a sound on LV_EVENT_CLICKED .
|
read_cb コールバックに加えて、lv_indev_drv_t の中のfeedback_cb で指定することもできます。
feedback_cb は、任意のタイプのイベントが(そのタイプに関係なく)入力デバイスによって送信されたときに呼び出されます。
これにより、ユーザーにフィードバックを生成できます。
たとえば、LV_EVENT_CLICKED でサウンドを再生できます。
|
- 戻る : Previous
Associating with a display
英文
|
自動翻訳
|
Every input device is associated with a display.
By default, a new input device is added to the last display created or explicitly selected (using lv_disp_set_default() ).
The associated display is stored and can be changed in disp field of the driver.
|
すべての入力デバイスはディスプレイに関連付けられています。
デフォルトでは、(lv_disp_set_default() を使用して)作成または明示的に選択された最後のディスプレイに新しい入力デバイスが追加されます。
関連する表示が保存され、ドライバーのdisp フィールドで 変更できます。
|
- 戻る : Previous
Buffered reading
英文
|
自動翻訳
|
By default, LVGL calls read_cb periodically.
Because of this intermittent polling there is a chance that some user gestures are missed.
To solve this you can write an event driven driver for your input device that buffers measured data.
In read_cb you can report the buffered data instead of directly reading the input device.
Setting the data->continue_reading flag will tell LVGL there is more data to read and it should call read_cb again.
|
デフォルトでは、LVGLはread_cb を定期的に呼び出します。
この断続的なポーリングのために、一部のユーザージェスチャが見落とされる可能性があります。
これを解決するために、測定データをバッファリングする入力デバイス用のイベント駆動型ドライバーを作成できます。
read_cb では、入力デバイスを直接読み取る代わりに、バッファリングされたデータをレポートできます。
data->continue_reading フラグを設定すると、LVGLに読み取るデータがさらにあることが通知され、read_cb を再度呼び出す必要があります。
|
- 戻る : Previous
Further reading
英文
|
自動翻訳
|
|
- 独自のドライバーのテンプレートのlv_port_indev_template.c 。
- [1]より高いレベルの入力デバイス機能についてさらに学ぶためのINdev機能。
|
- 戻る : Previous
API
英文
|
自動翻訳
|
@description Input Device HAL interface layer header file
Typedefs
typedef struct _lv_indev_drv_t lv_indev_drv_t
- Initialized by the user and registered by 'lv_indev_add()'
typedef struct _lv_indev_proc_t _lv_indev_proc_t
- Run time data of input devices Internally used by the library, you should not need to touch it.
typedef struct _lv_indev_t lv_indev_t
- The main input device descriptor with driver, runtime data ('proc') and some additional information
|
@description入力デバイスHALインターフェイスレイヤーヘッダーファイル
Typedef
typedef struct _ lv_indev_drv_t lv_indev_drv_t
- ユーザーによって初期化され、「lv_indev_add()」によって登録されます
typedef struct _ lv_indev_proc_t _lv_indev_proc_t
- 入力デバイスの実行時データライブラリによって内部的に使用されるため、ライブラリに触れる必要はありません。
typedef struct _ lv_indev_t lv_indev_t
- ドライバー、ランタイムデータ(「proc」)、およびいくつかの追加情報を含むメイン入力デバイス記述子
|
- 戻る : Previous
Enums
英文
|
自動翻訳
|
enum lv_indev_type_t
- Possible input device types Values:
- enumerator LV_INDEV_TYPE_NONE
- Uninitialized state
- enumerator LV_INDEV_TYPE_POINTER
- Touch pad, mouse, external button
- enumerator LV_INDEV_TYPE_KEYPAD
- Keypad or keyboard
- enumerator LV_INDEV_TYPE_BUTTON
- External (hardware button) which is assigned to a specific point of the screen
- enumerator LV_INDEV_TYPE_ENCODER
- Encoder with only Left, Right turn and a Button
enum lv_indev_state_t
- States for input devices
- Values:
- enumerator LV_INDEV_STATE_RELEASED
- enumerator LV_INDEV_STATE_PRESSED
|
列挙型lv_indev_type_t
- 可能な入力デバイスタイプ 値:
- 列挙子LV_INDEV_TYPE_NONE
- 初期化されていない状態
- 列挙子LV_INDEV_TYPE_POINTER
- タッチパッド、マウス、外部ボタン
- 列挙子LV_INDEV_TYPE_KEYPAD
- キーパッドまたはキーボード
- 列挙子LV_INDEV_TYPE_BUTTON
- 画面の特定のポイントに割り当てられている外部(ハードウェアボタン)
- 列挙子LV_INDEV_TYPE_ENCODER
- 左折、右折、ボタンのみのエンコーダ
列挙型lv_indev_state_t
- 入力デバイスの状態
- 値:
- 列挙子LV_INDEV_STATE_RELEASED
- 列挙子LV_INDEV_STATE_PRESSED
|
- 戻る : Previous
Functions
英文
|
自動翻訳
|
void lv_indev_drv_init(struct _lv_indev_drv_t *driver)
- 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
- driver -- pointer to driver variable to initialize
lv_indev_t *lv_indev_drv_register(struct _lv_indev_drv_t *driver)
- Register an initialized input device driver.
- Parameters
- driver -- pointer to an initialized 'lv_indev_drv_t' variable (can be local variable)
- Returns
- pointer to the new input device or NULL on error
void lv_indev_drv_update(lv_indev_t *indev, struct _lv_indev_drv_t *new_drv)
- Update the driver in run time.
- Parameters
- indev -- pointer to an input device. (return value of
lv_indev_drv_register )
- new_drv -- pointer to the new driver
void lv_indev_delete(lv_indev_t *indev)
- Remove the provided input device. Make sure not to use the provided input device afterwards anymore.
- Parameters
- indev -- pointer to delete
lv_indev_t *lv_indev_get_next(lv_indev_t *indev)
- Get the next input device.
- Parameters
- indev -- pointer to the current input device. NULL to initialize.
- Returns
- the next input device or NULL if there are no more. Provide the first input device when the parameter is NULL
void _lv_indev_read(lv_indev_t *indev, lv_indev_data_t *data)
- Read data from an input device.
- Parameters
- indev -- pointer to an input device
- data -- input device will write its data here
struct lv_indev_data_t
- #include <lv_hal_i'ndev.h>
- Data structure passed to an input driver to fill
- Public Members
- lv_point_t point
- For LV_INDEV_TYPE_POINTER the currently pressed point
- uint32_t key
- For LV_INDEV_TYPE_KEYPAD the currently pressed key
- uint32_t btn_id
- For LV_INDEV_TYPE_BUTTON the currently pressed button
- int16_t enc_diff
- For LV_INDEV_TYPE_ENCODER number of steps since the previous read
- lv_indev_state_t state
- LV_INDEV_STATE_REL or LV_INDEV_STATE_PR
- bool continue_reading
- If set to true, the read callback is invoked again
struct _lv_indev_drv_t
- #include <lv_hal_i'ndev.h>
- Initialized by the user and registered by 'lv_indev_add()'
- Public Members
- lv_indev_type_t type
- < Input device type Function pointer to read input device data.
- void (*read_cb)(struct _lv_indev_drv_t *indev_drv, lv_indev_data_t *data)
- void (*feedback_cb)(struct _lv_indev_drv_t*, uint8_t)
- Called when an action happened on the input device.
- The second parameter is the event from
lv_event_t
- void *user_data
- struct _lv_disp_t *disp
- < Pointer to the assigned display Timer to periodically read the input device
- lv_timer_t *read_timer
- Number of pixels to slide before actually drag the object
- uint8_t scroll_limit
- Drag throw slow-down in [%].
- Greater value means faster slow-down
- uint8_t scroll_throw
- At least this difference should be between two points to evaluate as gesture
- uint8_t gesture_min_velocity
- At least this difference should be to send a gesture
- uint8_t gesture_limit
- Long press time in milliseconds
- uint16_t long_press_time
- Repeated trigger period in long press [ms]
- uint16_t long_press_repeat_time
struct _lv_indev_proc_t
- #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
- lv_indev_state_t state
- Current state of the input device.
- uint8_t long_pr_sent
- uint8_t reset_query
- uint8_t disabled
- uint8_t wait_until_release
- lv_point_t act_point
- Current point of input device.
- lv_point_t last_point
- Last point of input device.
- lv_point_t last_raw_point
- Last point read from read_cb.
- lv_point_t vect
- Difference between
act_point and last_point .
- lv_point_t scroll_sum
- lv_point_t scroll_throw_vect
- lv_point_t scroll_throw_vect_ori
- struct _lv_obj_t *act_obj
- struct _lv_obj_t *last_obj
- struct _lv_obj_t *scroll_obj
- struct _lv_obj_t *last_pressed
- lv_area_t scroll_area
- lv_point_t gesture_sum
- lv_dir_t scroll_dir
- lv_dir_t gesture_dir
- uint8_t gesture_sent
- struct _lv_indev_proc_t::[anonymous]::[anonymous] pointer
- lv_indev_state_t last_state
- uint32_t last_key
- struct _lv_indev_proc_t::[anonymous]::[anonymous] keypad
- union _lv_indev_proc_t::[anonymous] types
- uint32_t pr_timestamp
- Pressed time stamp
- uint32_t longpr_rep_timestamp
- Long press repeat time stamp
struct _lv_indev_t
- #include <lv_h'al_indev.h> The main input device descriptor with driver, runtime data ('proc') and some additional information Public Members
- struct _lv_indev_drv_t *driver
- _lv_indev_proc_t proc
- struct _lv_obj_t *cursor
- Cursor for LV_INPUT_TYPE_POINTER
- struct _lv_group_t *group
- Keypad destination group
- const lv_point_t *btn_points
- Array points assigned to the button ()screen will be pressed here by the buttons
|
void lv_indev_drv_init(struct _ lv_indev_drv_t * driver)
- 入力デバイスドライバーをデフォルト値で初期化します。これは、メモリジャンクではなく、フィールドに既知の値を確実に持つために使用されます。その後、フィールドを設定できます。
- パラメーター
- driver-初期化するドライバー変数へのポインター
lv_indev_t * lv_indev_drv_register(struct _ lv_indev_drv_t * driver)
- 初期化された入力デバイスドライバを登録します。
- パラメーター
- driver-初期化された'lv_indev_drv_t'変数へのポインター(ローカル変数にすることができます)
- 戻り値
- 新しい入力デバイスへのポインタ、またはエラーの場合はNULL
void lv_indev_drv_update(lv_indev_t * indev、struct _lv_indev_drv_t * new_drv)
- 実行時にドライバーを更新します。
- パラメーター
- indev--入力デバイスへのポインタ。(の戻り値
lv_indev_drv_register )
- new_drv--新しいドライバへのポインタ
void lv_indev_delete(lv_indev_t * indev)
- 付属の入力デバイスを取り外します。その後、付属の入力デバイスを使用しないように注意してください。
- パラメーター
- indev--削除するポインタ
lv_indev_t * lv_indev_get_next( lv_indev_t * indev)
- 次の入力デバイスを取得します。
- パラメーター
- indev--現在の入力デバイスへのポインタ。初期化するにはNULL。
- 戻り値
- 次の入力デバイス。それ以上ない場合はNULL。パラメータがNULLの場合、最初の入力デバイスを提供します
void _lv_indev_read(lv_indev_t * indev、lv_indev_data_t * data)
- 入力デバイスからデータを読み取ります。
- パラメーター
- indev-入力デバイスへのポインタ
- data-入力デバイスはここにデータを書き込みます
struct lv_indev_data_t
- #include <lv_hal_i'ndev.h>
- 入力ドライバーに渡されて入力されるデータ構造
- パブリックメンバー
- lv_point_tポイント
- LV_INDEV_TYPE_POINTERの場合、現在押されているポイント
- uint32_tキー
- LV_INDEV_TYPE_KEYPADの場合、現在押されているキー
- uint32_t btn_id
- LV_INDEV_TYPE_BUTTONの場合、現在押されているボタン
- int16_t enc_diff
- LV_INDEV_TYPE_ENCODERの場合、前回の読み取り以降のステップ数
- lv_indev_state_t状態
- LV_INDEV_STATE_RELまたはLV_INDEV_STATE_PR
- bool continue_reading
- trueに設定すると、読み取りコールバックが再度呼び出されます
struct _lv_indev_drv_t
- #include <lv_hal_i'ndev.h>
- ユーザーによって初期化され、「lv_indev_add()」によって登録されます
- パブリックメンバー
- lv_indev_type_tタイプ
- <入力デバイスタイプ入力デバイスデータを読み取るための関数ポインタ。
- void(* read_cb)(struct _ lv_indev_drv_t * indev_drv、lv_indev_data_t * data)
- void(* Feedback_cb)(struct _ lv_indev_drv_t *、uint8_t)
- 入力デバイスでアクションが発生したときに呼び出されます。
- 2番目のパラメータはからのイベントです
lv_event_t
- void * user_data
- struct _ lv_disp_t * disp
- <入力デバイスを定期的に読み取るための割り当てられたディスプレイタイマーへのポインタ
- lv_timer_t * read_timer
- オブジェクトを実際にドラッグする前にスライドするピクセル数
- uint8_t scroll_limit
- [%]でスロースローダウンをドラッグします。
- 値が大きいほど、速度が速くなります
- uint8_t scroll_throw
- ジェスチャーとして評価するには、少なくともこの違いは2つのポイントの間にある必要があります
- uint8_tジェスチャー_min_velocity
- 少なくともこの違いは、ジェスチャーを送信することです
- uint8_tジェスチャー制限
- ミリ秒単位の長押し時間
- uint16_t long_press_time
- 長押しで繰り返されるトリガー期間[ms]
- uint16_t long_press_repeat_time
struct _lv_indev_proc_t
- #include <lv_hal_indev.h>入力デバイスの実行時データライブラリによって内部的に使用されるため、ライブラリに触れる必要はありません。
- パブリックメンバー
- lv_indev_state_t状態
- 入力デバイスの現在の状態。
- uint8_t long_pr_sent
- uint8_t reset_query
- uint8_tが無効
- uint8_t wait_until_release
- lv_point_t act_point
- 入力デバイスの現在のポイント。
- lv_point_t last_point
- 入力デバイスの最後のポイント。
- lv_point_t last_raw_point
- read_cbから読み取られた最後のポイント。
- lv_point_t vect
- 入力デバイスを登録するには、
act_point との違いlast_point 。
- lv_point_t scroll_sum
- lv_point_t scroll_throw_vect
- lv_point_t scroll_throw_vect_ori
- struct _ lv_obj_t * act_obj
- struct _ lv_obj_t * last_obj
- struct _ lv_obj_t * scroll_obj
- struct _ lv_obj_t * last_pressed
- lv_area_t scroll_area
- lv_point_tジェスチャー_sum
- lv_dir_t scroll_dir
- lv_dir_tジェスチャー_dir
- uint8_tジェスチャー_送信済み
- struct _ lv_indev_proc_t :: [anonymous]::[anonymous]ポインタ
- lv_indev_state_t last_state
- uint32_t last_key
- struct _ lv_indev_proc_t :: [anonymous]::[anonymous]キーパッド
- union _ lv_indev_proc_t ::[匿名]タイプ
- uint32_t pr_timestamp
- 押されたタイムスタンプ
- uint32_t longpr_rep_timestamp
- 長押しリピートタイムスタンプ
struct _lv_indev_t
- #include <lv_h'al_indev.h >ドライバー、ランタイムデータ('proc')、およびいくつかの追加情報を含むメイン入力デバイス記述子パブリックメンバー
- struct _ lv_indev_drv_t * driver
- _lv_indev_proc_t proc
- struct _ lv_obj_t * cursor
- LV_INPUT_TYPE_POINTERのカーソル
- struct _ lv_group_t * group
- キーパッドの宛先グループ
- const lv_point_t * btn_points
- ボタン()画面に割り当てられた配列ポイントは、ここでボタンによって押されます
|
- 戻る : Previous