lv_port_win_codeblocks icon indicating copy to clipboard operation
lv_port_win_codeblocks copied to clipboard

Keyboard not working in pc simulator

Open jiabuda opened this issue 2 years ago • 6 comments

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?

jiabuda avatar Feb 11 '23 12:02 jiabuda

Mail have been received, thank you.

chanvenjoe avatar Feb 11 '23 12:02 chanvenjoe

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.

stale[bot] avatar Apr 20 '23 02:04 stale[bot]

Mail have been received, thank you.

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

WiseMCU avatar May 21 '23 14:05 WiseMCU

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

jiabuda avatar Aug 23 '23 08:08 jiabuda

#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)
}

100ask avatar Apr 05 '24 12:04 100ask

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

jd3096-mpy avatar May 20 '24 14:05 jd3096-mpy