Page MenuHome

Cannot use Chinese input or Japanese input
Needs Triage, NormalPublic

Description

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: rBb2a0f6927508
Worked: (newest version of Blender that worked as expected)

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

Event Timeline

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: rBc36938297753
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).

Omar Emara (OmarSquircleArt) changed the task status from Needs Triage to Needs Information from User.Feb 24 2022, 12:25 PM

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
Omar Emara (OmarSquircleArt) changed the task status from Needs Information from User to Needs Triage.Mar 13 2022, 11:35 AM
Omar Emara (OmarSquircleArt) changed the task status from Needs Triage to Needs Information from User.Mar 21 2022, 1:29 PM

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/

nagadomi (nagadomi) added a comment.EditedMar 22 2022, 12:26 AM

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
Omar Emara (OmarSquircleArt) changed the task status from Needs Information from User to Needs Triage.Mar 26 2022, 12:18 PM

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...