lv_port_win_codeblocks
lv_port_win_codeblocks copied to clipboard
Keyboard not working in pc simulator
Hi, I try to run the simulator on PC, i use codeblocks-20.03mingw-setup.exe this file to install codeblock, yet after i clone this project and run it. I found that the keyboard not working on the demo, but I can use mouse to click and drag the widgets. But it does not response to any key pressed on my keyboard.
And I try to install the same version codeblocks on another pc, the same problem.
So is this simulator not support keyboard or some other problem? I watch some learning video on youtube, on the simulator inside the video, the keyboard works. And also I try the visual studio version simulator, keyboard works. So just problem on codeblocks?
Mail have been received, thank you.
This issue or pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Mail have been received, thank you.
Hello, I have also encountered the same issue. Have you resolved it?
@WiseMCU 没解决,项目用vs搞定了
#include "lv_drivers/win32drv/win32drv.h"
.....
{
lv_group_t * g = lv_group_create();
lv_indev_set_group(lv_win32_keypad_device_object, g); // keyboard
lv_indev_set_group(lv_win32_encoder_device_object, g); // Mouse wheel (Simulate encoder effect)
}
- Click here to view the complete code
- Docs: https://docs.lvgl.io/master/overview/indev.html#groups
#include "lv_drivers/win32drv/win32drv.h" ..... { lv_group_t * g = lv_group_create(); lv_indev_set_group(lv_win32_keypad_device_object, g); // keyboard lv_indev_set_group(lv_win32_encoder_device_object, g); // Mouse wheel (Simulate encoder effect) }
- Click here to view the complete code
- Docs: https://docs.lvgl.io/master/overview/indev.html#groups
Thanks,it works in codeblocks
here is a simple example:
#include "my_gui.h"
#include "lvgl.h"
#include "lv_drivers/win32drv/win32drv.h"
static void lv_example_textarea(void)
{
lv_group_t * g = lv_group_create();
lv_group_set_default(g);
lv_indev_set_group(lv_win32_keypad_device_object, g);
lv_obj_t *textarea_name = lv_textarea_create(lv_scr_act());
lv_obj_set_width(textarea_name, 400);
lv_obj_set_style_text_font(textarea_name, &lv_font_montserrat_30, LV_PART_MAIN);
lv_obj_align(textarea_name, LV_ALIGN_CENTER, 0, 0 );
}
void my_gui(void)
{
lv_example_textarea();
}