Mac, wxWidgets C++: Can not confirm single Kanji Character in single line wxTextCtrl.

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
Alka Dua
In need of some credit
In need of some credit
Posts: 1
Joined: Wed Jun 16, 2021 2:08 pm

Mac, wxWidgets C++: Can not confirm single Kanji Character in single line wxTextCtrl.

Post by Alka Dua »

Hi,

This issue is specific to Mac Single line wxTextCtrl(wxTE_MULTILINE style is not defined for control) Steps to reproduce:
1. Enter a single Hiragana Japanese character in a wxTextCtrl
2. Press enter

Result: character is not confirmed
Expected: Character should be confirmed

The issue does not happen when multiple characters are entered. I debugged wxWidgets code and found following difference in single character and multiple character handling:

bool wxWidgetCocoaImpl::DoHandleCharEvent(NSEvent *event, NSString *text)
{
...
...
// if we have exactly one character resulting from the event, then
// set the corresponding modifiers and raw data from the nsevent
// otherwise leave these at defaults, as they probably would be incorrect
// anyway (IME input)

if ( event != nil && length == 1)
{
SetupKeyEvent(wxevent,event,text);
}
else
{
...
..
result = peer->OSXHandleKeyEvent(wxevent) || result;
}
}
return result;
}


Further in class wxTextCtrl, EVT_CHAR is handled. In this function, there is a code to prevent the processing of Enter key when the control is not Multiline.

void wxTextCtrl::OnChar(wxKeyEvent& event)

These two chunks of code prevent the processing of enter key in case of single kanji character from IME.

This is a wxWidgets defect. Single Kanji characters can be confirmed in native Mac applications. Even wxTextCtrl on Windows OS confirms single Kanji characters. Please fix this defect on Mac.

Thank you
Alka Dua
User avatar
doublemax
Moderator
Moderator
Posts: 19114
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Mac, wxWidgets C++: Can not confirm single Kanji Character in single line wxTextCtrl.

Post by doublemax »

I can't test this as i don't work under OSX, but it indeed sounds like bug.

Please open a ticket at http://trac.wxwidgets.org/

Thanks.
Use the source, Luke!
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7458
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Mac, wxWidgets C++: Can not confirm single Kanji Character in single line wxTextCtrl.

Post by ONEEYEMAN »

Hi,
First of all - are you trying to enter Kanji or Hiragana character? Google says it is 2 different alphabets...
Second - are you able to reproduce it in a text sample (from wxWidgets distribution)?
Third - what OSX version are you testing on? Is it in VM or a real hardware?
Fourth - I presume you have installed everything required as you wrote you are able to do it in the native OSX application?
Fifth - Are you testing on the Japanese version of OSX or an English/US one?

When you create a ticket, as suggested by doublemax - pleasze put an answers to all those questions.

Also, please mention the wxWidgets version and how did you build it - namely what was the configure line you used?

Thank you.
Post Reply