emulate funny character input

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

emulate funny character input

Postby paulkatto » Thu Jan 22, 2015 3:58 pm

Hi,

I am trying to insert some thai text from a "virtual keyboard" into the cef browser. E.g. I want to emulate keyboard events like "หด้ดเหดเ". What I've done so far was something like this:

std::wstring s = L"หด้ดเหดเ";
n = s.length();
for( i=0; i<n; i++){
CefKeyEvent ki;
ki.character = s[i];
ki.is_system_key = false;
//ki.native_key_code = s[i];
ki.windows_key_code = s[i];
ki.type = KEYEVENT_CHAR;
blabla->GetBrowser()->GetHost()->SendKeyEvent(ki);
}

Unfortunately in the browser I get quite some garbage like this:¢ᄌᆱ¢ᄌヤ¢ᄍノ¢ᄌヤ¢ᄍタ¢ᄌᆱ¢ᄌヤ¢ᄍタ¢ᄌᆱ¢ᄌチ¢ᄌヤ¢ᄌヤ¢ᄌヤ¢ᄌᆱ¢ᄌᄈ¢ᄍニ

So I wonder how I can send some thai/chinese/japanese/hebrew/whatever unicode character to the browser !?!
paulkatto
Mentor
 
Posts: 64
Joined: Wed Sep 12, 2012 3:39 am

Re: emulate funny character input

Postby magreenblatt » Thu Jan 22, 2015 9:49 pm

What OS and CEF version?
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: emulate funny character input

Postby paulkatto » Fri Jan 23, 2015 3:21 am

os is win7 64x, cef verison:

#define CHROME_VERSION_MAJOR 33
#define CHROME_VERSION_MINOR 0
#define CHROME_VERSION_BUILD 1750
#define CHROME_VERSION_PATCH 170

Thank you.
paulkatto
Mentor
 
Posts: 64
Joined: Wed Sep 12, 2012 3:39 am

Re: emulate funny character input

Postby magreenblatt » Fri Jan 23, 2015 10:26 am

You need to determine the correct virtual key codes. Here's an example: https://code.google.com/p/chromiumembed ... est.cc#560
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: emulate funny character input

Postby paulkatto » Fri Jan 23, 2015 1:46 pm

thanks a lot for the link to the code, very clear. I've solved it now. Part of the problem was my encoding, it was no proper unicode (my incoming string).
paulkatto
Mentor
 
Posts: 64
Joined: Wed Sep 12, 2012 3:39 am


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 76 guests