lc-soft/LCUI

Keyboard Input Doesn't Work (Windows x64) #284

CycloneRing posted onGitHub

Describe the bug Hello @lc-soft, I really liked your gui library, I have an issue and I'm not sure if this is a bug, Anyhow I couldn't fix it myself in more than 1 week, I hope you can help me to solve it. I tried to merge lcui and lcui design to a static build on windows, It works perfectly so far the only problem is keyboard input doesn't work on text inputs, I checked keyboard functions and all of them receiving input but still it doesn't work, none of the source codes are manipulated and they are original.

To Reproduce Steps to reproduce the behavior:

  1. Download LCUI and Dependencies
  2. Configuring Projects to Static and MT
  3. Build & Run

Environment :

  • LCUI version: Latest
  • Build tools: Visual Studio 2019 x64 Build Tools
  • OS and version: Windows 10 Latest Update

Update 1 :

  • Even TextEdit_OnKeyDown works but TextEdit_OnTextInput never gets called.

Here is the full source code : LCUI-Static-Win64.zip


The processing flow of textinput event is as follows:

WIN_ProcessEvents() -> WndProc() -> WM_CHAR -> WinIME_OnChar() -> LCUIIME_Commit() -> LCUI_TEXTINPUT -> OnTextInput() -> LCUI_WEVENT_TEXTINPUT -> TextEdit_OnTextInput()

I'll take the time to test it.

posted by lc-soft about 3 years ago

I'll take the time to test it.

@lc-soft Thanks! I just noticed issue is from lcui 2.2.0.

  1. I downloaded lcui source from https://github.com/lc-soft/LCUI/archive/refs/tags/v2.2.0.zip
  2. I built it without any changes
  3. I replaced the dll in lc-design-demo and still inputs not working.

Still the provided build at https://github.com/lc-soft/LCUI/archive/refs/tags/ works fine, I'm not sure what's wrong maybe it's from my vs compiler or windows sdk, No idea :(

posted by CycloneRing about 3 years ago

The cause of problem is that you have modified the Windows SDK version in the project configuration. The LCUI project configuration is using Visual Studio 2017 - Windows XP (v141_xp) toolset.

image

LCUI has no input method support for UWP (Universal Windows Platform), so the Win32 input method is not registered when the WINAPI_FAMILY_APP macro is defined, but this is not correct, it should be changed to:

image

posted by lc-soft about 3 years ago

Oh thank you, I'm not using UWP, just regular C++ not for xp, It fixed the issue, Cheers 🥂 I'm closing the issue but since it's related to keyboard, Can we add tab support to lcui? I noticed Tab doesn't switch keys and inputs.

posted by CycloneRing about 3 years ago

Yes, you can add it, but I recommend that you create a new issue describing all the details of this feature before you plan to do it.

posted by lc-soft about 3 years ago

Thanks, I try it myself if I couldn't I make a new issue. 祝您度过愉快的一天!

posted by CycloneRing about 3 years ago

Fund this Issue

$0.00
Funded

Pull requests