Cannot use Chinese input or Japanese input #87578

Open
opened 2021-04-17 07:59:37 +02:00 by SunYufang · 29 comments

System Information
Operating system: Linux-5.4.0-70-generic-x86_64-with-glibc2.31 64 Bits
Graphics card: GeForce GTX 970/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 450.102.04

Blender Version
Broken: version: 2.93.0 Beta, branch: master, commit date: 2021-04-16 16:41, hash: b2a0f69275
Worked: 2.92 (#issuecomment-224988, #issuecomment-225000)

Short description of error
Cannot use Chinese input or Japanese input

Exact steps for others to reproduce the error
When I use Chinese or Japanese input, I get a warning like this on the console

Bad keycode lookup. Keysym 0x0 Status: XLookupNone
'' 0x7fca129c0900 0x7fca36c513c0

**System Information** Operating system: Linux-5.4.0-70-generic-x86_64-with-glibc2.31 64 Bits Graphics card: GeForce GTX 970/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 450.102.04 **Blender Version** Broken: version: 2.93.0 Beta, branch: master, commit date: 2021-04-16 16:41, hash: `b2a0f69275` Worked: 2.92 ([#issuecomment-224988](https://projects.blender.org/blender/blender/issues/87578#issuecomment-224988), [#issuecomment-225000](https://projects.blender.org/blender/blender/issues/87578#issuecomment-225000)) **Short description of error** Cannot use Chinese input or Japanese input **Exact steps for others to reproduce the error** When I use Chinese or Japanese input, I get a warning like this on the console Bad keycode lookup. Keysym 0x0 Status: XLookupNone '' 0x7fca129c0900 0x7fca36c513c0
Author

Added subscriber: @Sun_Xiao_Fang

Added subscriber: @Sun_Xiao_Fang

#92068 was marked as duplicate of this issue

#92068 was marked as duplicate of this issue

#91239 was marked as duplicate of this issue

#91239 was marked as duplicate of this issue
smithmachinist725 commented 2021-04-17 10:35:36 +02:00 (Migrated from localhost:3001)

Added subscriber: @smithmachinist725

Added subscriber: @smithmachinist725
smithmachinist725 commented 2021-04-17 10:35:36 +02:00 (Migrated from localhost:3001)

This comment was removed by @smithmachinist725

*This comment was removed by @smithmachinist725*
Member

Added subscribers: @EitanSomething, @PratikPB2123

Added subscribers: @EitanSomething, @PratikPB2123
Member

This comment was removed by @PratikPB2123

*This comment was removed by @PratikPB2123*

Added subscriber: @mont29

Added subscriber: @mont29

Added subscriber: @nagadomi-4

Added subscriber: @nagadomi-4

I have encountered the same problem. This problem does not occur in 2.92.0.

System Information
Operating system: Linux-5.4.0-72-generic-x86_64-with-glibc2.31 64 Bits
Graphics card: GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 460.73.01
Ubuntu 20.04, GNOME, ibus-mozc

Blender Version
Broken: version: 2.93.0 Beta, branch: master, commit date: 2021-05-28 16:16, hash: c369382977
Worked: 2.92.0

Short description of error

Typing into any text field using the Japanese IME does not work.
Copying and pasting Japanese characters worked.

Terminal output:

Bad keycode lookup. Keysym 0x0 Status: XLookupNone
'' 0x7f36271a1a00 0x7f364d841900
I have encountered the same problem. This problem does not occur in 2.92.0. **System Information** Operating system: Linux-5.4.0-72-generic-x86_64-with-glibc2.31 64 Bits Graphics card: GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 460.73.01 Ubuntu 20.04, GNOME, ibus-mozc **Blender Version** Broken: version: 2.93.0 Beta, branch: master, commit date: 2021-05-28 16:16, hash: `c369382977` Worked: 2.92.0 **Short description of error** Typing into any text field using the Japanese IME does not work. Copying and pasting Japanese characters worked. Terminal output: ``` Bad keycode lookup. Keysym 0x0 Status: XLookupNone '' 0x7f36271a1a00 0x7f364d841900 ```

The cause may be different, but it's the same situation as https://developer.blender.org/T55998 (No crashing).

The cause may be different, but it's the same situation as https://developer.blender.org/T55998 (No crashing).

Added subscribers: @sbchild, @Garek

Added subscribers: @sbchild, @Garek
Member

Added subscribers: @lbmzorx, @mano-wii

Added subscribers: @lbmzorx, @mano-wii
Member

Added subscriber: @OmarEmaraDev

Added subscriber: @OmarEmaraDev
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

To try to reproduce reliably, I am simulating a key press using xdotool, but I am not able to reproduce the issue. Can you provide the UTF-8 codes for any of the characters you are typing?
Can you also open Blender with --debug-events and check to confirm that the key events corresponds to the keys you intended to enter?

Execute the following the chosen unicode and select the Blender window.

 xdotool selectwindow windowactivate click 1 key U4E00
To try to reproduce reliably, I am simulating a key press using `xdotool`, but I am not able to reproduce the issue. Can you provide the UTF-8 codes for any of the characters you are typing? Can you also open Blender with `--debug-events` and check to confirm that the key events corresponds to the keys you intended to enter? Execute the following the chosen unicode and select the Blender window. ``` xdotool selectwindow windowactivate click 1 key U4E00 ```

xdotool selectwindow windowactivate click 1 key U4E00

This command reproduces the problem in my env.

m_event_do_handlers: Handling event
wmEvent  type:260 / WINDOW_DEACTIVATE, val:2 / RELEASE,
         prev_type:171 / UNKNOWN, prev_val:2 / RELEASE,
         shift:0, ctrl:0, alt:0, oskey:0, keymodifier:0, is_repeat:0,
         mouse:(972,735), ascii:'', utf8:'', pointer:0x7eff8eb03648
Bad keycode lookup. Keysym 0x0 Status: XLookupNone
'' 0x7eff906b4e80 0x7effbb63c400

wm_event_do_handlers: Handling event
wmEvent  type:171 / UNKNOWN, val:1 / PRESS,
         prev_type:171 / UNKNOWN, prev_val:2 / RELEASE,
         shift:0, ctrl:0, alt:0, oskey:0, keymodifier:0, is_repeat:0,
         mouse:(972,735), ascii:'', utf8:'', pointer:0x7eff8eb05588

wm_event_do_handlers: Handling event
wmEvent  type:171 / UNKNOWN, val:2 / RELEASE,
         prev_type:171 / UNKNOWN, prev_val:1 / PRESS,
         shift:0, ctrl:0, alt:0, oskey:0, keymodifier:0, is_repeat:0,
         mouse:(972,735), ascii:'', utf8:'', pointer:0x7eff8eb05588

wm_event_do_handlers: Handling event
wmEvent  type:260 / WINDOW_DEACTIVATE, val:2 / RELEASE,
         prev_type:171 / UNKNOWN, prev_val:2 / RELEASE,
         shift:0, ctrl:0, alt:0, oskey:0, keymodifier:0, is_repeat:0,
         mouse:(1443,606), ascii:'', utf8:'', pointer:0x7eff8eb036e8
>xdotool selectwindow windowactivate click 1 key U4E00 This command reproduces the problem in my env. ``` m_event_do_handlers: Handling event wmEvent type:260 / WINDOW_DEACTIVATE, val:2 / RELEASE, prev_type:171 / UNKNOWN, prev_val:2 / RELEASE, shift:0, ctrl:0, alt:0, oskey:0, keymodifier:0, is_repeat:0, mouse:(972,735), ascii:'', utf8:'', pointer:0x7eff8eb03648 Bad keycode lookup. Keysym 0x0 Status: XLookupNone '' 0x7eff906b4e80 0x7effbb63c400 wm_event_do_handlers: Handling event wmEvent type:171 / UNKNOWN, val:1 / PRESS, prev_type:171 / UNKNOWN, prev_val:2 / RELEASE, shift:0, ctrl:0, alt:0, oskey:0, keymodifier:0, is_repeat:0, mouse:(972,735), ascii:'', utf8:'', pointer:0x7eff8eb05588 wm_event_do_handlers: Handling event wmEvent type:171 / UNKNOWN, val:2 / RELEASE, prev_type:171 / UNKNOWN, prev_val:1 / PRESS, shift:0, ctrl:0, alt:0, oskey:0, keymodifier:0, is_repeat:0, mouse:(972,735), ascii:'', utf8:'', pointer:0x7eff8eb05588 wm_event_do_handlers: Handling event wmEvent type:260 / WINDOW_DEACTIVATE, val:2 / RELEASE, prev_type:171 / UNKNOWN, prev_val:2 / RELEASE, shift:0, ctrl:0, alt:0, oskey:0, keymodifier:0, is_repeat:0, mouse:(1443,606), ascii:'', utf8:'', pointer:0x7eff8eb036e8 ```
Member

Changed status from 'Needs User Info' to: 'Needs Triage'

Changed status from 'Needs User Info' to: 'Needs Triage'
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

On Xorg 21.1.3 and latest Blender, there is a value in the UTF8 member, I get:

wmEvent type:171/UNKNOWN, val:1/PRESS, prev_type:1/LEFTMOUSE, prev_val:2/RELEASE, modifier={}, keymodifier:0, flag:{}, mouse:(422,218), ascii:'', utf8:'一', pointer:0x7ff06e52a768

wmEvent type:171/UNKNOWN, val:2/RELEASE, prev_type:171/UNKNOWN, prev_val:1/PRESS, modifier={}, keymodifier:0, flag:{}, mouse:(422,218), ascii:'', utf8:'', pointer:0x7ff07dffc828

Can you try on the latest version of Blender and if possible Xorg? https://builder.blender.org/

On Xorg 21.1.3 and latest Blender, there is a value in the UTF8 member, I get: ``` wmEvent type:171/UNKNOWN, val:1/PRESS, prev_type:1/LEFTMOUSE, prev_val:2/RELEASE, modifier={}, keymodifier:0, flag:{}, mouse:(422,218), ascii:'', utf8:'一', pointer:0x7ff06e52a768 wmEvent type:171/UNKNOWN, val:2/RELEASE, prev_type:171/UNKNOWN, prev_val:1/PRESS, modifier={}, keymodifier:0, flag:{}, mouse:(422,218), ascii:'', utf8:'', pointer:0x7ff07dffc828 ``` Can you try on the latest version of Blender and if possible Xorg? https://builder.blender.org/

Does it mean that the version of xorg required by Blender is very high and will not work on Ubuntu LTS?
I am wondering if this is a problem specific to my env or if it does not work with all popular Linux distributions.

I will try it in the next week.

Does it mean that the version of xorg required by Blender is very high and will not work on Ubuntu LTS? I am wondering if this is a problem specific to my env or if it does not work with all popular Linux distributions. I will try it in the next week.

I clean-installed Ubuntu 21.10 on another machine. Japanese input does not work with the same error. 2.93.8 and 3.1.0.
xorg version is xorg-server 2:1.20.13-1ubuntu1.1 and unable to upgrade in normal way.

Additional.

With Blender 2.92, Japanese input works fine,
but with xdotool(above command) I get the same error(Bad keycode lookup. Keysym 0x0 Status: XLookupNone) and cannot input char.
testing using xdotool may not work.

Below is the --debug-events log with Blender 2.92.
Using IME(ibus-mozc)


wm_event_do_handlers: Handling event
wmEvent  type:162 / NUMPAD_MINUS, val:2 / RELEASE,
         prev_type:1 / LEFTMOUSE, prev_val:1 / PRESS,
         shift:0, ctrl:0, alt:0, oskey:0, keymodifier:0, is_repeat:0,
         mouse:(688,732), ascii:'', utf8:'', pointer:0x7f6030b7f3a8

wm_event_do_handlers: Handling event
wmEvent  type:171 / UNKNOWN, val:1 / PRESS,
         prev_type:1 / LEFTMOUSE, prev_val:2 / RELEASE,
         shift:0, ctrl:0, alt:0, oskey:0, keymodifier:0, is_repeat:0,
         mouse:(688,732), ascii:'', utf8:'ー', pointer:0x7f6030b7f3a8

wm_event_do_handlers: Handling event
wmEvent  type:220 / RET, val:2 / RELEASE,
         prev_type:162 / NUMPAD_MINUS, prev_val:2 / RELEASE,
         shift:0, ctrl:0, alt:0, oskey:0, keymodifier:0, is_repeat:0,
         mouse:(688,732), ascii:'', utf8:'', pointer:0x7f6030b7f3a8

Using xdotool,

Bad keycode lookup. Keysym 0x0 Status: XLookupNone
'' 0x7f6030a8ec00 0x7f60624cba00

wm_event_do_handlers: Handling event
wmEvent  type:171 / UNKNOWN, val:1 / PRESS,
         prev_type:171 / UNKNOWN, prev_val:1 / PRESS,
         shift:0, ctrl:0, alt:0, oskey:0, keymodifier:0, is_repeat:0,
         mouse:(548,736), ascii:'', utf8:'', pointer:0x7f6030b7f1c8

wm_event_do_handlers: Handling event
wmEvent  type:171 / UNKNOWN, val:2 / RELEASE,
         prev_type:220 / RET, prev_val:2 / RELEASE,
         shift:0, ctrl:0, alt:0, oskey:0, keymodifier:0, is_repeat:0,
         mouse:(548,736), ascii:'', utf8:'', pointer:0x7f6030b7f1c8

I clean-installed Ubuntu 21.10 on another machine. Japanese input does not work with the same error. 2.93.8 and 3.1.0. xorg version is `xorg-server 2:1.20.13-1ubuntu1.1` and unable to upgrade in normal way. Additional. With Blender 2.92, Japanese input works fine, but with xdotool(above command) I get the same error(`Bad keycode lookup. Keysym 0x0 Status: XLookupNone`) and cannot input char. testing using xdotool may not work. Below is the --debug-events log with Blender 2.92. Using IME(ibus-mozc) ``` wm_event_do_handlers: Handling event wmEvent type:162 / NUMPAD_MINUS, val:2 / RELEASE, prev_type:1 / LEFTMOUSE, prev_val:1 / PRESS, shift:0, ctrl:0, alt:0, oskey:0, keymodifier:0, is_repeat:0, mouse:(688,732), ascii:'', utf8:'', pointer:0x7f6030b7f3a8 wm_event_do_handlers: Handling event wmEvent type:171 / UNKNOWN, val:1 / PRESS, prev_type:1 / LEFTMOUSE, prev_val:2 / RELEASE, shift:0, ctrl:0, alt:0, oskey:0, keymodifier:0, is_repeat:0, mouse:(688,732), ascii:'', utf8:'ー', pointer:0x7f6030b7f3a8 wm_event_do_handlers: Handling event wmEvent type:220 / RET, val:2 / RELEASE, prev_type:162 / NUMPAD_MINUS, prev_val:2 / RELEASE, shift:0, ctrl:0, alt:0, oskey:0, keymodifier:0, is_repeat:0, mouse:(688,732), ascii:'', utf8:'', pointer:0x7f6030b7f3a8 ``` Using xdotool, ``` Bad keycode lookup. Keysym 0x0 Status: XLookupNone '' 0x7f6030a8ec00 0x7f60624cba00 wm_event_do_handlers: Handling event wmEvent type:171 / UNKNOWN, val:1 / PRESS, prev_type:171 / UNKNOWN, prev_val:1 / PRESS, shift:0, ctrl:0, alt:0, oskey:0, keymodifier:0, is_repeat:0, mouse:(548,736), ascii:'', utf8:'', pointer:0x7f6030b7f1c8 wm_event_do_handlers: Handling event wmEvent type:171 / UNKNOWN, val:2 / RELEASE, prev_type:220 / RET, prev_val:2 / RELEASE, shift:0, ctrl:0, alt:0, oskey:0, keymodifier:0, is_repeat:0, mouse:(548,736), ascii:'', utf8:'', pointer:0x7f6030b7f1c8 ```
Member

Changed status from 'Needs User Info' to: 'Needs Triage'

Changed status from 'Needs User Info' to: 'Needs Triage'

Added subscriber: @pica

Added subscriber: @pica

As a workaround to this nasty bug I use this bash function:

输入倒剪贴板() {
while true
  do
    read ZHONGWEN
    echo ${ZHONGWEN} | xsel -b
  done
}

When called inside a dedicated terminal that I launch alongside blender, it automatically copies to the clipboard the text that I input (chinese or otherwise), and that text is then pasted into blender with the traditional Ctrl+V paste shortcut.

Of course this is barely a temporary hack, and I hope this regression will be corrected, as chinese input worked perfectly in previous blender 2.91 version if I remember correctly...

As a workaround to this nasty bug I use this bash function: ``` 输入倒剪贴板() { while true do read ZHONGWEN echo ${ZHONGWEN} | xsel -b done } ``` When called inside a dedicated terminal that I launch alongside blender, it automatically copies to the clipboard the text that I input (chinese or otherwise), and that text is then pasted into blender with the traditional Ctrl+V paste shortcut. Of course this is barely a temporary hack, and I hope this regression will be corrected, as chinese input worked perfectly in previous blender 2.91 version if I remember correctly...
Member

This looks identical to #95410
@lichtwerk , can you check?

This looks identical to #95410 @lichtwerk , can you check?
YimingWu added
Status
Confirmed
Interest
Core
and removed
Status
Needs Triage
labels 2023-05-02 08:06:09 +02:00

I added setlocation (LC_CTYPE, ""); in line 423 of my local source intern/ghost/intern/GHOST_SystemX11. cc recompile and it will work fine.

bool GHOST_SystemX11::openX11_IM()

{
  if (!m_display) {
    return false;
  }

  /* set locale modifiers such as `@im=ibus` specified by XMODIFIERS. */
  setlocale(LC_CTYPE,"");//New
  XSetLocaleModifiers("");

  m_xim = XOpenIM(m_display, nullptr, (char *)GHOST_X11_RES_NAME, (char *)GHOST_X11_RES_CLASS);
  if (!m_xim) {
    return false;
  }
I added `setlocation (LC_CTYPE, "");` in line 423 of my local source `intern/ghost/intern/GHOST_SystemX11. cc` recompile and it will work fine. ```c bool GHOST_SystemX11::openX11_IM() { if (!m_display) { return false; } /* set locale modifiers such as `@im=ibus` specified by XMODIFIERS. */ setlocale(LC_CTYPE,"");//New XSetLocaleModifiers(""); m_xim = XOpenIM(m_display, nullptr, (char *)GHOST_X11_RES_NAME, (char *)GHOST_X11_RES_CLASS); if (!m_xim) { return false; } ```

I tried
LANG=C LC_ALL=C ./blender
but it did not work.
I don't know, maybe it's something different from setlocale in the source code.

I tried `LANG=C LC_ALL=C ./blender ` but it did not work. I don't know, maybe it's something different from setlocale in the source code.

I added setlocation (LC_CTYPE, ""); in line 423 of my local source intern/ghost/intern/GHOST_SystemX11. cc recompile and it will work fine.

bool GHOST_SystemX11::openX11_IM()

{
  if (!m_display) {
    return false;
  }

  /* set locale modifiers such as `@im=ibus` specified by XMODIFIERS. */
  setlocale(LC_CTYPE,"");//New
  XSetLocaleModifiers("");

  m_xim = XOpenIM(m_display, nullptr, (char *)GHOST_X11_RES_NAME, (char *)GHOST_X11_RES_CLASS);
  if (!m_xim) {
    return false;
  }

It works for me. Thanks

> I added `setlocation (LC_CTYPE, "");` in line 423 of my local source `intern/ghost/intern/GHOST_SystemX11. cc` recompile and it will work fine. > ```c > bool GHOST_SystemX11::openX11_IM() > > { > if (!m_display) { > return false; > } > > /* set locale modifiers such as `@im=ibus` specified by XMODIFIERS. */ > setlocale(LC_CTYPE,"");//New > XSetLocaleModifiers(""); > > m_xim = XOpenIM(m_display, nullptr, (char *)GHOST_X11_RES_NAME, (char *)GHOST_X11_RES_CLASS); > if (!m_xim) { > return false; > } > ``` It works for me. Thanks
Campbell Barton added the
Interest: X11
label 2024-03-20 04:08:20 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
11 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#87578
No description provided.