Add custom coloring of keys
This commit is contained in:
40
main.c
40
main.c
@@ -157,6 +157,13 @@ static void shutdown_btn_clicked_cb(lv_event_t *event);
|
|||||||
*/
|
*/
|
||||||
static void shutdown_mbox_value_changed_cb(lv_event_t *event);
|
static void shutdown_mbox_value_changed_cb(lv_event_t *event);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle LV_EVENT_DRAW_PART_BEGIN events from the keyboard widget.
|
||||||
|
*
|
||||||
|
* @param event the event object
|
||||||
|
*/
|
||||||
|
static void keyboard_draw_part_begin_cb(lv_event_t *event);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle LV_EVENT_VALUE_CHANGED events from the keyboard widget.
|
* Handle LV_EVENT_VALUE_CHANGED events from the keyboard widget.
|
||||||
*
|
*
|
||||||
@@ -262,6 +269,38 @@ static void shutdown_mbox_value_changed_cb(lv_event_t *event) {
|
|||||||
lv_msgbox_close(mbox);
|
lv_msgbox_close(mbox);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void keyboard_draw_part_begin_cb(lv_event_t *event) {
|
||||||
|
lv_obj_t *obj = lv_event_get_target(event);
|
||||||
|
lv_btnmatrix_t *btnm = (lv_btnmatrix_t *)obj;
|
||||||
|
lv_obj_draw_part_dsc_t *dsc = lv_event_get_param(event);
|
||||||
|
|
||||||
|
if (dsc->part != LV_PART_ITEMS) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lv_btnmatrix_get_selected_btn(obj) == dsc->id) { /* key is held down */
|
||||||
|
if ((btnm->ctrl_bits[dsc->id] & SQ2LV_CTRL_MOD_INACTIVE) == SQ2LV_CTRL_MOD_INACTIVE) {
|
||||||
|
dsc->rect_dsc->bg_color = lv_palette_lighten(LV_PALETTE_TEAL, 1);
|
||||||
|
} else if ((btnm->ctrl_bits[dsc->id] & SQ2LV_CTRL_MOD_ACTIVE) == SQ2LV_CTRL_MOD_ACTIVE) {
|
||||||
|
dsc->rect_dsc->bg_color = lv_palette_lighten(LV_PALETTE_TEAL, 1);
|
||||||
|
} else if ((btnm->ctrl_bits[dsc->id] & SQ2LV_CTRL_NON_CHAR) == SQ2LV_CTRL_NON_CHAR) {
|
||||||
|
dsc->rect_dsc->bg_color = lv_palette_darken(LV_PALETTE_BLUE_GREY, 3);
|
||||||
|
} else {
|
||||||
|
dsc->rect_dsc->bg_color = lv_palette_lighten(LV_PALETTE_BLUE_GREY, 1);
|
||||||
|
}
|
||||||
|
} else { /* key is not held down */
|
||||||
|
if ((btnm->ctrl_bits[dsc->id] & SQ2LV_CTRL_MOD_INACTIVE) == SQ2LV_CTRL_MOD_INACTIVE) {
|
||||||
|
dsc->rect_dsc->bg_color = lv_palette_darken(LV_PALETTE_BLUE_GREY, 4);
|
||||||
|
} else if ((btnm->ctrl_bits[dsc->id] & SQ2LV_CTRL_MOD_ACTIVE) == SQ2LV_CTRL_MOD_ACTIVE) {
|
||||||
|
dsc->rect_dsc->bg_color = lv_palette_main(LV_PALETTE_TEAL);
|
||||||
|
} else if ((btnm->ctrl_bits[dsc->id] & SQ2LV_CTRL_NON_CHAR) == SQ2LV_CTRL_NON_CHAR) {
|
||||||
|
dsc->rect_dsc->bg_color = lv_palette_darken(LV_PALETTE_BLUE_GREY, 4);
|
||||||
|
} else {
|
||||||
|
dsc->rect_dsc->bg_color = lv_palette_main(LV_PALETTE_BLUE_GREY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void keyboard_value_changed_cb(lv_event_t *event) {
|
static void keyboard_value_changed_cb(lv_event_t *event) {
|
||||||
lv_obj_t *kb = lv_event_get_target(event);
|
lv_obj_t *kb = lv_event_get_target(event);
|
||||||
|
|
||||||
@@ -480,6 +519,7 @@ int main(void) {
|
|||||||
lv_keyboard_set_textarea(keyboard, textarea);
|
lv_keyboard_set_textarea(keyboard, textarea);
|
||||||
// lv_btnmatrix_set_popovers(keyboard, true);
|
// lv_btnmatrix_set_popovers(keyboard, true);
|
||||||
lv_obj_remove_event_cb(keyboard, lv_keyboard_def_event_cb);
|
lv_obj_remove_event_cb(keyboard, lv_keyboard_def_event_cb);
|
||||||
|
lv_obj_add_event_cb(keyboard, keyboard_draw_part_begin_cb, LV_EVENT_DRAW_PART_BEGIN, NULL);
|
||||||
lv_obj_add_event_cb(keyboard, keyboard_value_changed_cb, LV_EVENT_VALUE_CHANGED, NULL);
|
lv_obj_add_event_cb(keyboard, keyboard_value_changed_cb, LV_EVENT_VALUE_CHANGED, NULL);
|
||||||
lv_obj_add_event_cb(keyboard, keyboard_ready_cb, LV_EVENT_READY, NULL);
|
lv_obj_add_event_cb(keyboard, keyboard_ready_cb, LV_EVENT_READY, NULL);
|
||||||
lv_obj_set_pos(keyboard, 0, 0);
|
lv_obj_set_pos(keyboard, 0, 0);
|
||||||
|
@@ -25,8 +25,8 @@ static const char * const keycaps_lower_us[] = { \
|
|||||||
static const lv_btnmatrix_ctrl_t attributes_lower_us[] = { \
|
static const lv_btnmatrix_ctrl_t attributes_lower_us[] = { \
|
||||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||||
2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||||
LV_KEYBOARD_CTRL_BTN_FLAGS | 3, 2, 2, 2, 2, 2, 2, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 3, \
|
SQ2LV_CTRL_MOD_INACTIVE | 3, 2, 2, 2, 2, 2, 2, 2, SQ2LV_CTRL_NON_CHAR | 3, \
|
||||||
LV_KEYBOARD_CTRL_BTN_FLAGS | 3, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 7, 2, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 3 \
|
SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 2, 7, SQ2LV_CTRL_NON_CHAR | 2, 2, SQ2LV_CTRL_NON_CHAR | 3 \
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int num_modifiers_lower_us = 0;
|
static const int num_modifiers_lower_us = 0;
|
||||||
@@ -59,8 +59,8 @@ static const char * const keycaps_upper_us[] = { \
|
|||||||
static const lv_btnmatrix_ctrl_t attributes_upper_us[] = { \
|
static const lv_btnmatrix_ctrl_t attributes_upper_us[] = { \
|
||||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||||
2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||||
LV_KEYBOARD_CTRL_BTN_FLAGS | 3, 2, 2, 2, 2, 2, 2, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 3, \
|
SQ2LV_CTRL_MOD_ACTIVE | 3, 2, 2, 2, 2, 2, 2, 2, SQ2LV_CTRL_NON_CHAR | 3, \
|
||||||
LV_KEYBOARD_CTRL_BTN_FLAGS | 3, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 7, 2, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 3 \
|
SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 2, 7, SQ2LV_CTRL_NON_CHAR | 2, 2, SQ2LV_CTRL_NON_CHAR | 3 \
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int num_modifiers_upper_us = 0;
|
static const int num_modifiers_upper_us = 0;
|
||||||
@@ -93,8 +93,8 @@ static const char * const keycaps_numbers_us[] = { \
|
|||||||
static const lv_btnmatrix_ctrl_t attributes_numbers_us[] = { \
|
static const lv_btnmatrix_ctrl_t attributes_numbers_us[] = { \
|
||||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||||
2, 2, 2, 2, 2, 2, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 3, \
|
2, 2, 2, 2, 2, 2, 2, SQ2LV_CTRL_NON_CHAR | 3, \
|
||||||
LV_KEYBOARD_CTRL_BTN_FLAGS | 3, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 7, 2, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 3 \
|
SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 2, 7, SQ2LV_CTRL_NON_CHAR | 2, 2, SQ2LV_CTRL_NON_CHAR | 3 \
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int num_modifiers_numbers_us = 0;
|
static const int num_modifiers_numbers_us = 0;
|
||||||
@@ -171,8 +171,8 @@ static const char * const keycaps_lower_de[] = { \
|
|||||||
static const lv_btnmatrix_ctrl_t attributes_lower_de[] = { \
|
static const lv_btnmatrix_ctrl_t attributes_lower_de[] = { \
|
||||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||||
2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||||
LV_KEYBOARD_CTRL_BTN_FLAGS | 3, 2, 2, 2, 2, 2, 2, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 3, \
|
SQ2LV_CTRL_MOD_INACTIVE | 3, 2, 2, 2, 2, 2, 2, 2, SQ2LV_CTRL_NON_CHAR | 3, \
|
||||||
LV_KEYBOARD_CTRL_BTN_FLAGS | 3, LV_KEYBOARD_CTRL_BTN_FLAGS | 3, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 7, 2, 2, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 3 \
|
SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_MOD_INACTIVE | 3, SQ2LV_CTRL_NON_CHAR | 2, 7, SQ2LV_CTRL_NON_CHAR | 2, 2, 2, SQ2LV_CTRL_NON_CHAR | 3 \
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int num_modifiers_lower_de = 0;
|
static const int num_modifiers_lower_de = 0;
|
||||||
@@ -205,8 +205,8 @@ static const char * const keycaps_upper_de[] = { \
|
|||||||
static const lv_btnmatrix_ctrl_t attributes_upper_de[] = { \
|
static const lv_btnmatrix_ctrl_t attributes_upper_de[] = { \
|
||||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||||
2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||||
LV_KEYBOARD_CTRL_BTN_FLAGS | 3, 2, 2, 2, 2, 2, 2, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 3, \
|
SQ2LV_CTRL_MOD_ACTIVE | 3, 2, 2, 2, 2, 2, 2, 2, SQ2LV_CTRL_NON_CHAR | 3, \
|
||||||
LV_KEYBOARD_CTRL_BTN_FLAGS | 3, LV_KEYBOARD_CTRL_BTN_FLAGS | 3, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 7, 2, 2, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 3 \
|
SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_MOD_INACTIVE | 3, SQ2LV_CTRL_NON_CHAR | 2, 7, SQ2LV_CTRL_NON_CHAR | 2, 2, 2, SQ2LV_CTRL_NON_CHAR | 3 \
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int num_modifiers_upper_de = 0;
|
static const int num_modifiers_upper_de = 0;
|
||||||
@@ -239,8 +239,8 @@ static const char * const keycaps_numbers_de[] = { \
|
|||||||
static const lv_btnmatrix_ctrl_t attributes_numbers_de[] = { \
|
static const lv_btnmatrix_ctrl_t attributes_numbers_de[] = { \
|
||||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||||
2, 2, 2, 2, 2, 2, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 3, \
|
2, 2, 2, 2, 2, 2, 2, SQ2LV_CTRL_NON_CHAR | 3, \
|
||||||
LV_KEYBOARD_CTRL_BTN_FLAGS | 3, LV_KEYBOARD_CTRL_BTN_FLAGS | 3, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 7, 2, 2, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 3 \
|
SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_MOD_INACTIVE | 3, SQ2LV_CTRL_NON_CHAR | 2, 7, SQ2LV_CTRL_NON_CHAR | 2, 2, 2, SQ2LV_CTRL_NON_CHAR | 3 \
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int num_modifiers_numbers_de = 0;
|
static const int num_modifiers_numbers_de = 0;
|
||||||
@@ -273,8 +273,8 @@ static const char * const keycaps_special_de[] = { \
|
|||||||
static const lv_btnmatrix_ctrl_t attributes_special_de[] = { \
|
static const lv_btnmatrix_ctrl_t attributes_special_de[] = { \
|
||||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||||
LV_KEYBOARD_CTRL_BTN_FLAGS | 3, 2, 2, 2, 2, 2, 2, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 3, \
|
SQ2LV_CTRL_NON_CHAR | 3, 2, 2, 2, 2, 2, 2, 2, SQ2LV_CTRL_NON_CHAR | 3, \
|
||||||
LV_KEYBOARD_CTRL_BTN_FLAGS | 3, LV_KEYBOARD_CTRL_BTN_FLAGS | 3, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 7, 2, 2, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 3 \
|
SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_MOD_ACTIVE | 3, SQ2LV_CTRL_NON_CHAR | 2, 7, SQ2LV_CTRL_NON_CHAR | 2, 2, 2, SQ2LV_CTRL_NON_CHAR | 3 \
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int num_modifiers_special_de = 0;
|
static const int num_modifiers_special_de = 0;
|
||||||
@@ -361,8 +361,8 @@ static const char * const keycaps_lower_es[] = { \
|
|||||||
static const lv_btnmatrix_ctrl_t attributes_lower_es[] = { \
|
static const lv_btnmatrix_ctrl_t attributes_lower_es[] = { \
|
||||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||||
LV_KEYBOARD_CTRL_BTN_FLAGS | 3, 2, 2, 2, 2, 2, 2, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 3, \
|
SQ2LV_CTRL_MOD_INACTIVE | 3, 2, 2, 2, 2, 2, 2, 2, SQ2LV_CTRL_NON_CHAR | 3, \
|
||||||
LV_KEYBOARD_CTRL_BTN_FLAGS | 3, LV_KEYBOARD_CTRL_BTN_FLAGS | 3, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 7, 2, 2, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 3 \
|
SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_MOD_INACTIVE | 3, SQ2LV_CTRL_NON_CHAR | 2, 7, SQ2LV_CTRL_NON_CHAR | 2, 2, 2, SQ2LV_CTRL_NON_CHAR | 3 \
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int num_modifiers_lower_es = 0;
|
static const int num_modifiers_lower_es = 0;
|
||||||
@@ -395,8 +395,8 @@ static const char * const keycaps_upper_es[] = { \
|
|||||||
static const lv_btnmatrix_ctrl_t attributes_upper_es[] = { \
|
static const lv_btnmatrix_ctrl_t attributes_upper_es[] = { \
|
||||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||||
LV_KEYBOARD_CTRL_BTN_FLAGS | 3, 2, 2, 2, 2, 2, 2, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 3, \
|
SQ2LV_CTRL_MOD_ACTIVE | 3, 2, 2, 2, 2, 2, 2, 2, SQ2LV_CTRL_NON_CHAR | 3, \
|
||||||
LV_KEYBOARD_CTRL_BTN_FLAGS | 3, LV_KEYBOARD_CTRL_BTN_FLAGS | 3, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 7, 2, 2, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 3 \
|
SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_MOD_INACTIVE | 3, SQ2LV_CTRL_NON_CHAR | 2, 7, SQ2LV_CTRL_NON_CHAR | 2, 2, 2, SQ2LV_CTRL_NON_CHAR | 3 \
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int num_modifiers_upper_es = 0;
|
static const int num_modifiers_upper_es = 0;
|
||||||
@@ -429,8 +429,8 @@ static const char * const keycaps_numbers_es[] = { \
|
|||||||
static const lv_btnmatrix_ctrl_t attributes_numbers_es[] = { \
|
static const lv_btnmatrix_ctrl_t attributes_numbers_es[] = { \
|
||||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||||
2, 2, 2, 2, 2, 2, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 3, \
|
2, 2, 2, 2, 2, 2, 2, SQ2LV_CTRL_NON_CHAR | 3, \
|
||||||
LV_KEYBOARD_CTRL_BTN_FLAGS | 3, LV_KEYBOARD_CTRL_BTN_FLAGS | 3, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 7, 2, 2, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 3 \
|
SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_MOD_INACTIVE | 3, SQ2LV_CTRL_NON_CHAR | 2, 7, SQ2LV_CTRL_NON_CHAR | 2, 2, 2, SQ2LV_CTRL_NON_CHAR | 3 \
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int num_modifiers_numbers_es = 0;
|
static const int num_modifiers_numbers_es = 0;
|
||||||
@@ -463,8 +463,8 @@ static const char * const keycaps_special_es[] = { \
|
|||||||
static const lv_btnmatrix_ctrl_t attributes_special_es[] = { \
|
static const lv_btnmatrix_ctrl_t attributes_special_es[] = { \
|
||||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||||
LV_KEYBOARD_CTRL_BTN_FLAGS | 3, 2, 2, 2, 2, 2, 2, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 3, \
|
SQ2LV_CTRL_NON_CHAR | 3, 2, 2, 2, 2, 2, 2, 2, SQ2LV_CTRL_NON_CHAR | 3, \
|
||||||
LV_KEYBOARD_CTRL_BTN_FLAGS | 3, LV_KEYBOARD_CTRL_BTN_FLAGS | 3, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 7, 2, 2, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 3 \
|
SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_MOD_ACTIVE | 3, SQ2LV_CTRL_NON_CHAR | 2, 7, SQ2LV_CTRL_NON_CHAR | 2, 2, 2, SQ2LV_CTRL_NON_CHAR | 3 \
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int num_modifiers_special_es = 0;
|
static const int num_modifiers_special_es = 0;
|
||||||
@@ -551,8 +551,8 @@ static const char * const keycaps_lower_fr[] = { \
|
|||||||
static const lv_btnmatrix_ctrl_t attributes_lower_fr[] = { \
|
static const lv_btnmatrix_ctrl_t attributes_lower_fr[] = { \
|
||||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||||
LV_KEYBOARD_CTRL_BTN_FLAGS | 3, 2, 2, 2, 2, 2, 2, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 3, \
|
SQ2LV_CTRL_MOD_INACTIVE | 3, 2, 2, 2, 2, 2, 2, 2, SQ2LV_CTRL_NON_CHAR | 3, \
|
||||||
LV_KEYBOARD_CTRL_BTN_FLAGS | 3, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 7, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 3, LV_KEYBOARD_CTRL_BTN_FLAGS | 3 \
|
SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 2, 7, SQ2LV_CTRL_NON_CHAR | 2, SQ2LV_CTRL_MOD_INACTIVE | 3, SQ2LV_CTRL_NON_CHAR | 3 \
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int num_modifiers_lower_fr = 0;
|
static const int num_modifiers_lower_fr = 0;
|
||||||
@@ -585,8 +585,8 @@ static const char * const keycaps_upper_fr[] = { \
|
|||||||
static const lv_btnmatrix_ctrl_t attributes_upper_fr[] = { \
|
static const lv_btnmatrix_ctrl_t attributes_upper_fr[] = { \
|
||||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||||
LV_KEYBOARD_CTRL_BTN_FLAGS | 3, 2, 2, 2, 2, 2, 2, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 3, \
|
SQ2LV_CTRL_MOD_ACTIVE | 3, 2, 2, 2, 2, 2, 2, 2, SQ2LV_CTRL_NON_CHAR | 3, \
|
||||||
LV_KEYBOARD_CTRL_BTN_FLAGS | 3, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 7, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 3, LV_KEYBOARD_CTRL_BTN_FLAGS | 3 \
|
SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 2, 7, SQ2LV_CTRL_NON_CHAR | 2, SQ2LV_CTRL_MOD_INACTIVE | 3, SQ2LV_CTRL_NON_CHAR | 3 \
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int num_modifiers_upper_fr = 0;
|
static const int num_modifiers_upper_fr = 0;
|
||||||
@@ -619,8 +619,8 @@ static const char * const keycaps_numbers_fr[] = { \
|
|||||||
static const lv_btnmatrix_ctrl_t attributes_numbers_fr[] = { \
|
static const lv_btnmatrix_ctrl_t attributes_numbers_fr[] = { \
|
||||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||||
2, 2, 2, 2, 2, 2, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 3, \
|
2, 2, 2, 2, 2, 2, 2, SQ2LV_CTRL_NON_CHAR | 3, \
|
||||||
LV_KEYBOARD_CTRL_BTN_FLAGS | 3, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 7, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 3, LV_KEYBOARD_CTRL_BTN_FLAGS | 3 \
|
SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 2, 7, SQ2LV_CTRL_NON_CHAR | 2, SQ2LV_CTRL_MOD_INACTIVE | 3, SQ2LV_CTRL_NON_CHAR | 3 \
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int num_modifiers_numbers_fr = 0;
|
static const int num_modifiers_numbers_fr = 0;
|
||||||
@@ -653,8 +653,8 @@ static const char * const keycaps_special_fr[] = { \
|
|||||||
static const lv_btnmatrix_ctrl_t attributes_special_fr[] = { \
|
static const lv_btnmatrix_ctrl_t attributes_special_fr[] = { \
|
||||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||||
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, \
|
||||||
LV_KEYBOARD_CTRL_BTN_FLAGS | 3, 2, 2, 2, 2, 2, 2, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 3, \
|
SQ2LV_CTRL_NON_CHAR | 3, 2, 2, 2, 2, 2, 2, 2, SQ2LV_CTRL_NON_CHAR | 3, \
|
||||||
LV_KEYBOARD_CTRL_BTN_FLAGS | 3, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 7, 2, LV_KEYBOARD_CTRL_BTN_FLAGS | 3, LV_KEYBOARD_CTRL_BTN_FLAGS | 3 \
|
SQ2LV_CTRL_NON_CHAR | 3, SQ2LV_CTRL_NON_CHAR | 2, 7, SQ2LV_CTRL_NON_CHAR | 2, SQ2LV_CTRL_MOD_ACTIVE | 3, SQ2LV_CTRL_NON_CHAR | 3 \
|
||||||
};
|
};
|
||||||
|
|
||||||
static const int num_modifiers_special_fr = 0;
|
static const int num_modifiers_special_fr = 0;
|
||||||
|
@@ -9,6 +9,11 @@
|
|||||||
|
|
||||||
#define SQ2LV_SCANCODES_ENABLED 0
|
#define SQ2LV_SCANCODES_ENABLED 0
|
||||||
|
|
||||||
|
/* Key attributes */
|
||||||
|
#define SQ2LV_CTRL_NON_CHAR (LV_BTNMATRIX_CTRL_NO_REPEAT | LV_BTNMATRIX_CTRL_CLICK_TRIG | LV_BTNMATRIX_CTRL_CHECKED)
|
||||||
|
#define SQ2LV_CTRL_MOD_ACTIVE (LV_BTNMATRIX_CTRL_NO_REPEAT | LV_BTNMATRIX_CTRL_CLICK_TRIG | LV_BTNMATRIX_CTRL_CHECKABLE)
|
||||||
|
#define SQ2LV_CTRL_MOD_INACTIVE (LV_BTNMATRIX_CTRL_NO_REPEAT | LV_BTNMATRIX_CTRL_CLICK_TRIG | LV_BTNMATRIX_CTRL_CHECKABLE | LV_BTNMATRIX_CTRL_CHECKED)
|
||||||
|
|
||||||
/* Layout IDs, values can be used as indexes into the sq2lv_layouts array */
|
/* Layout IDs, values can be used as indexes into the sq2lv_layouts array */
|
||||||
typedef enum {
|
typedef enum {
|
||||||
SQ2LV_LAYOUT_US = 0,
|
SQ2LV_LAYOUT_US = 0,
|
||||||
@@ -23,7 +28,7 @@ typedef struct {
|
|||||||
const int num_keys;
|
const int num_keys;
|
||||||
/* Key caps */
|
/* Key caps */
|
||||||
const char ** const keycaps;
|
const char ** const keycaps;
|
||||||
/* Button matrix attributes */
|
/* Key attributes */
|
||||||
const lv_btnmatrix_ctrl_t * const attributes;
|
const lv_btnmatrix_ctrl_t * const attributes;
|
||||||
/* Number of modifier keys */
|
/* Number of modifier keys */
|
||||||
const int num_modifiers;
|
const int num_modifiers;
|
||||||
|
Submodule squeek2lvgl updated: f2194f3438...e93d853f3d
Reference in New Issue
Block a user