lvgl / lv_port_win_codeblocks

Windows PC simulator project for LVGL embedded GUI Library
MIT License
129 stars 79 forks source link

Keyboard not working in pc simulator #34

Open jiabuda opened 1 year ago

jiabuda commented 1 year ago

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?

chanvenjoe commented 1 year ago

Mail have been received, thank you.

stale[bot] commented 1 year ago

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.

WiseMCU commented 1 year ago

Mail have been received, thank you.

Hello, I have also encountered the same issue. Have you resolved it?

jiabuda commented 10 months ago

@WiseMCU 没解决,项目用vs搞定了

100ask commented 3 months ago
#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)
}
jd3096-mpy commented 1 month ago
#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)
}

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();
}