When IME is On, passing key inputs excluding caret operation to IME. (Windows) #89831

Open
opened 2021-07-13 09:06:19 +02:00 by Takahiro Shizuki · 9 comments

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: Intel(R) Iris(TM) Graphics 5100 Intel 4.3.0 - Build 20.19.15.4531

Blender Version
Broken: version: 3.0.0 Alpha, branch: master (modified), commit date: 2021-07-11 05:31, hash: 2289e26fa3
Worked: (newest version of Blender that worked as expected)

Short description of error
In Translation set "Japanese", Interface is "checked, with input box,
When IME(Roma-ji) opend input puts a first letter to input box. (ex. 「あ」->「aあ」, 「か」->「kか」)

blender-japanese_input_ime_bug.PNG

I don't know how to post my modified branch's source yet.
So I paste the modifed hunks.

/* passing key inputs excluding caret operation (move, select) and deleting to IME */
if ((!ctrl_pressed && !alt_pressed) &&
(raw.data.keyboard.VKey != VK_BACK
&& raw.data.keyboard.VKey != VK_RETURN
&& raw.data.keyboard.VKey != VK_SHIFT
&& raw.data.keyboard.VKey != VK_CONTROL
&& raw.data.keyboard.VKey != VK_ESCAPE
&& raw.data.keyboard.VKey != VK_END
&& raw.data.keyboard.VKey != VK_HOME
&& raw.data.keyboard.VKey != VK_LEFT
&& raw.data.keyboard.VKey != VK_UP
&& raw.data.keyboard.VKey != VK_RIGHT
&& raw.data.keyboard.VKey != VK_DOWN
&& raw.data.keyboard.VKey != VK_DELETE)) {
if (window->getImeInput()->GetOpenStatus(window->getHWND())) {
return NULL;
}
}

GHOST_ImeWin32.h:271
/* Retrieve the open status of IMM. */
bool GetOpenStatus(HWND window_handle);
GHOST_ImeWin32.cpp:385
bool GHOST_ImeWin32::GetOpenStatus(HWND window_handle)
{

bool result = false;
HIMC imm_context = ::ImmGetContext(window_handle);
if (imm_context) {
result = ::ImmGetOpenStatus(imm_context);
}
return result;

}

**System Information** Operating system: Windows-10-10.0.19041-SP0 64 Bits Graphics card: Intel(R) Iris(TM) Graphics 5100 Intel 4.3.0 - Build 20.19.15.4531 **Blender Version** Broken: version: 3.0.0 Alpha, branch: master (modified), commit date: 2021-07-11 05:31, hash: `2289e26fa3` Worked: (newest version of Blender that worked as expected) **Short description of error** In Translation set "Japanese", Interface is "checked, with input box, When IME(Roma-ji) opend input puts a first letter to input box. (ex. 「あ」->「aあ」, 「か」->「kか」) ![blender-japanese_input_ime_bug.PNG](https://archive.blender.org/developer/F10222789/blender-japanese_input_ime_bug.PNG) I don't know how to post my modified branch's source yet. So I paste the modifed hunks. ---- ```GHOST_SystemWin32.cpp:1222 ``` /* passing key inputs excluding caret operation (move, select) and deleting to IME */ if ((!ctrl_pressed && !alt_pressed) && (raw.data.keyboard.VKey != VK_BACK && raw.data.keyboard.VKey != VK_RETURN && raw.data.keyboard.VKey != VK_SHIFT && raw.data.keyboard.VKey != VK_CONTROL && raw.data.keyboard.VKey != VK_ESCAPE && raw.data.keyboard.VKey != VK_END && raw.data.keyboard.VKey != VK_HOME && raw.data.keyboard.VKey != VK_LEFT && raw.data.keyboard.VKey != VK_UP && raw.data.keyboard.VKey != VK_RIGHT && raw.data.keyboard.VKey != VK_DOWN && raw.data.keyboard.VKey != VK_DELETE)) { if (window->getImeInput()->GetOpenStatus(window->getHWND())) { return NULL; } } ``` ``` ``` GHOST_ImeWin32.h:271 /* Retrieve the open status of IMM. */ bool GetOpenStatus(HWND window_handle); ``` ``` GHOST_ImeWin32.cpp:385 bool GHOST_ImeWin32::GetOpenStatus(HWND window_handle) { ``` bool result = false; HIMC imm_context = ::ImmGetContext(window_handle); if (imm_context) { result = ::ImmGetOpenStatus(imm_context); } return result; ``` } ``` ----
Takahiro Shizuki self-assigned this 2021-07-13 09:06:19 +02:00
Author
Member

Added subscriber: @sntulix

Added subscriber: @sntulix
Takahiro Shizuki changed title from When IME is On, passing key inputs excluding caret operation to IME. to When IME is On, passing key inputs excluding caret operation to IME. (Windows) 2021-07-13 09:10:44 +02:00
Member

Added subscriber: @Harley

Added subscriber: @Harley
Member

The following is a patch against current master. I made only a few changes:

  • "GetOpenStatus" name changed to "is_open"
  • Comments changed.
  • processKeyEvent "If" conditions changed (because C++ short-circuits).

But you could submit this here if you like: https:*developer.blender.org/differential/diff/create/ or I can do so and you can then commandeer it. Or I can help in other ways. Just ask .

IMEopen.diff

The following is a patch against current master. I made only a few changes: - "GetOpenStatus" name changed to "is_open" - Comments changed. - processKeyEvent "If" conditions changed (because C++ short-circuits). But you could submit this here if you like: https:*developer.blender.org/differential/diff/create/ or I can do so and you can then commandeer it. Or I can help in other ways. [Just ask ](https:*developer.blender.org/p/harley/). [IMEopen.diff](https://archive.blender.org/developer/F10224323/IMEopen.diff)
Author
Member

Hi, harley.

Thank you.
I modified some and import your changes, and send the patch.
https://developer.blender.org/D11929

Best Regards.
sntulix

Hi, harley. Thank you. I modified some and import your changes, and send the patch. https://developer.blender.org/D11929 Best Regards. sntulix

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Author
Member

This is a long log.

win10-msime-japanese-romaji
win10-msime-japanese-romaji.PNG

win10-atok-japanese-romaji
win10-atok-japanese-romaji.PNG

win10-atok-japanese-hankaku-print_no_letter
win10-atok-japanese-hankaku-print_no_letter.PNG

win10-atok-japanese-zenei
win10-atok-japanese-zenei.PNG

win10-google_ime-japanese-romaji
win10-google_ime-japanese-romaji.PNG

win10-google_ime-japanese-hankaku
win10-google_ime-japanese-hankaku.PNG

win10-corvusSKK-japanese-romaji
win10-corvusSKK-japanese-romaji.PNG

win10-corvusSKK-japanese-mode_SKK(hankaku)-print_no_letter
win10-corvusSKK-japanese-mode_SKK(hankaku)-print_no_letter.PNG

win10-msime-chinese-chinese_simplified
win10-msime-chinese-chinese_simplified.PNG

win10-msime-chinese-english-print_no_letter
win10-msime-chinese-english.PNG

win10-msime-korean-hangul
win10-msime-korean-hangul.PNG

win10-msime-korean-english
win10-msime-korean-english.PNG

This is a long log. win10-msime-japanese-romaji ![win10-msime-japanese-romaji.PNG](https://archive.blender.org/developer/F10226515/win10-msime-japanese-romaji.PNG) win10-atok-japanese-romaji ![win10-atok-japanese-romaji.PNG](https://archive.blender.org/developer/F10226517/win10-atok-japanese-romaji.PNG) win10-atok-japanese-hankaku-print_no_letter ![win10-atok-japanese-hankaku-print_no_letter.PNG](https://archive.blender.org/developer/F10226519/win10-atok-japanese-hankaku-print_no_letter.PNG) win10-atok-japanese-zenei ![win10-atok-japanese-zenei.PNG](https://archive.blender.org/developer/F10226521/win10-atok-japanese-zenei.PNG) win10-google_ime-japanese-romaji ![win10-google_ime-japanese-romaji.PNG](https://archive.blender.org/developer/F10226523/win10-google_ime-japanese-romaji.PNG) win10-google_ime-japanese-hankaku ![win10-google_ime-japanese-hankaku.PNG](https://archive.blender.org/developer/F10226525/win10-google_ime-japanese-hankaku.PNG) win10-corvusSKK-japanese-romaji ![win10-corvusSKK-japanese-romaji.PNG](https://archive.blender.org/developer/F10226527/win10-corvusSKK-japanese-romaji.PNG) win10-corvusSKK-japanese-mode_SKK(hankaku)-print_no_letter ![win10-corvusSKK-japanese-mode_SKK(hankaku)-print_no_letter.PNG](https://archive.blender.org/developer/F10226529/win10-corvusSKK-japanese-mode_SKK_hankaku_-print_no_letter.PNG) win10-msime-chinese-chinese_simplified ![win10-msime-chinese-chinese_simplified.PNG](https://archive.blender.org/developer/F10226531/win10-msime-chinese-chinese_simplified.PNG) win10-msime-chinese-english-print_no_letter ![win10-msime-chinese-english.PNG](https://archive.blender.org/developer/F10226533/win10-msime-chinese-english.PNG) win10-msime-korean-hangul ![win10-msime-korean-hangul.PNG](https://archive.blender.org/developer/F10226535/win10-msime-korean-hangul.PNG) win10-msime-korean-english ![win10-msime-korean-english.PNG](https://archive.blender.org/developer/F10226537/win10-msime-korean-english.PNG)

Added subscriber: @hzuika

Added subscriber: @hzuika
Author
Member

note
watching ReactOS's implements of WIN32API (from not Microsoft) for less consumption of cpu clocks .

GetKeyboardLayout()
3fa57b8ff7/modules/rosapps/applications/sysutils/utils/pice/module/utils.c (L191)

ImmGetContext()
3965c93732/dll/win32/imm32/imm.c (L1890)

ImmIsIME()
3965c93732/dll/win32/imm32/imm.c (L2499)

ImmGetOpenStatus()
3965c93732/dll/win32/imm32/imm.c (L2263)

ImmGetConversionStatus()
3965c93732/dll/win32/imm32/imm.c (L1998)

note watching ReactOS's implements of WIN32API (from not Microsoft) for less consumption of cpu clocks . GetKeyboardLayout() https://github.com/reactos/reactos/blob/3fa57b8ff7fcee47b8e2ed869aecaf4515603f3f/modules/rosapps/applications/sysutils/utils/pice/module/utils.c#L191 ImmGetContext() https://github.com/reactos/reactos/blob/3965c9373297284e1986d11735d4a575e54e130f/dll/win32/imm32/imm.c#L1890 ImmIsIME() https://github.com/reactos/reactos/blob/3965c9373297284e1986d11735d4a575e54e130f/dll/win32/imm32/imm.c#L2499 ImmGetOpenStatus() https://github.com/reactos/reactos/blob/3965c9373297284e1986d11735d4a575e54e130f/dll/win32/imm32/imm.c#L2263 ImmGetConversionStatus() https://github.com/reactos/reactos/blob/3965c9373297284e1986d11735d4a575e54e130f/dll/win32/imm32/imm.c#L1998

This issue was referenced by 836aeebf70

This issue was referenced by 836aeebf70776791866c8cc82a0ca2ad7ffb8e4d
Philipp Oeser removed the
Interest
User Interface
label 2023-02-10 09:23:16 +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
5 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#89831
No description provided.