ns_bookmarks: IME ready
Posted by: mark307
Date: December 23, 2005 03:17PM

In Japan, users input Japanese charactor with IME (Imput Method Editor).

On edit bookmarks dialog, I can't input a text with IME. On default, when IME is enabled, I push enter key, then IME sends text to window. But edit bookmarks dialog hooks enter key, then I can't send text to dialog with IME.

solution: If IME is enabled, ignore enter key.

patch:

--- ns_bookmarks_edit.cpp.orig Fri Dec 31 06:57:48 2004
+++ ns_bookmarks_edit.cpp Fri Dec 23 06:31:50 2005
@@ -28,6 +28,7 @@
#include "resource.h"
#include "wininet.h" // for INTERNET_MAX_URL_LENGTH
#include "windows.h" // for hook functions
+#include "imm.h"

#include "defines.h"

@@ -130,6 +131,8 @@

BOOL fEatKeystroke = false;
BOOL fakedKey = false;
+ BOOL fIME = false;
+ HIMC hIMC = (HIMC) NULL;
HWND hasFocus = GetFocus();
HWND hTree = GetDlgItem(hEditWnd, IDC_TREE_BOOKMARK);

@@ -146,6 +149,12 @@

int searching = 0;

+ hIMC = ImmGetContext(hasFocus);
+ if (hIMC) {
+ fIME = ImmGetOpenStatus(hIMC);
+ ImmReleaseContext(hasFocus, hIMC);
+ }
+
if (wParam == VK_ESCAPE && !bTracking) {
fEatKeystroke = true;
if (len == 0)
@@ -478,7 +487,7 @@
}
}
}
- else if (hasFocus == GetDlgItem(hEditWnd, IDC_TITLE) && wParam == VK_RETURN) {
+ else if (hasFocus == GetDlgItem(hEditWnd, IDC_TITLE) && wParam == VK_RETURN && ! fIME) {
fEatKeystroke = true;
if (IsWindowEnabled(GetDlgItem(hEditWnd, IDC_URL))) {
SetFocus(GetDlgItem(hEditWnd, IDC_URL));
@@ -503,7 +512,7 @@
else if ((hasFocus == GetDlgItem(hEditWnd, IDC_URL) ||
hasFocus == GetDlgItem(hEditWnd, IDC_DESC) ||
hasFocus == GetDlgItem(hEditWnd, IDC_NICK)) &&
- wParam == VK_RETURN) {
+ wParam == VK_RETURN && ! fIME) {
fEatKeystroke = true;
SetFocus(GetDlgItem(hEditWnd, IDC_TREE_BOOKMARK));
}

Re: ns_bookmarks: IME ready
Posted by: Dorian
Date: December 23, 2005 06:18PM

Patch should be posted in the mailing list.

Re: ns_bookmarks: IME ready
Posted by: mark307
Date: December 24, 2005 09:51AM

I'm very sorry. I have not known the rule.

I want to read legal of the forum. Would you tell me where it is on?
Thanks.

Re: ns_bookmarks: IME ready
Posted by: guenter
Date: December 24, 2005 02:23PM

Mark -

You did not break a rule
as far as i understand he wanted to tell You a better place to pass on Your info.

The list: You can joind dev mailing list.

http://lists.sourceforge.net/lists/listinfo/kmeleon-dev

If You do not want to join You can also send it without being member
- it will be passed on when approved by person that guards the list from spam.

else I can send it for You if You want me to. just tell me here or send me a mail
via: http://home.htp-tel.de/sterntaler/mailme.html at that place You find my mail.
and animated pictures from Nippon ; - )

& Seasons greetings: best wishes & many presents today and a good New Year

p. s. & we all very much appreciate Your work.
many of us here do not speak English well.
so there is always some missunderstanding.
we are here to inform each other.
so he told You the best place to post.

Re: ns_bookmarks: IME ready
Posted by: mark307
Date: December 24, 2005 03:07PM

I'm very stupid. I found this forum spoils all indent and makes a patch nothing.

I'm little afraid of joining ML still. So I posted usual site.
http://rapidshare.de/files/9751238/ns_bookmarks_edit.zip.html

@guenter
Thank you for your kind consideration.

Merry Christmas.

Re: ns_bookmarks: IME ready
Posted by: guenter
Date: December 24, 2005 05:35PM

@mark307,

Forum: some times it does break things (macros and code)
some times it does not. - we are all often surprised.

First I also had the idea that i should not join because I am no dev.
But our dev ML is not a list only for developers.
Mailing list is for all that are interested in info about it.
It is even open for plain and simple forum people like me.

As far as i know only Dorian and You make c code for k-m at them moment -
so when he has seen this ... it will probably go into his code.

ML: You can also send a mail without joining. It only takes longer.
I would send it for You if You give me permission or tell me to do it.

Re: ns_bookmarks: IME ready
Posted by: Dorian
Date: December 24, 2005 07:29PM

Yeah, it's not really a rule, but official dev doesn't look at this forum, so it's better to post in the mailing list to keep trace of it.

Re: ns_bookmarks: IME ready
Posted by: mark307
Date: December 25, 2005 09:02AM

Thank you for your invitation.
To tell the truth, I don't have any confidence to follow a discussion in ML.
In forum, I can skip messages and leave easy.

@guenter
Thank you for your proposal. You may re-post this patch to everywhere, of cource. I don't insist on my rights about the patch.

Thanks.

P.S. Do anyone tell me why disable BTS on sf.net?

Re: ns_bookmarks: IME ready
Posted by: Dorian
Date: January 27, 2006 09:28PM

Are you sure of your patch ? ImmGetOpenStatus always return TRUE for me; the return key never work.

Re: ns_bookmarks: IME ready
Posted by: mark307
Date: January 28, 2006 09:14AM

Perhaps this patch works well only with CJK version windows. I'll study more.

If you have interest in the function, I recommend the page About Input Method Editor (MSDN).

Thanks.

Re: ns_bookmarks: IME ready
Posted by: mark307
Date: January 29, 2006 08:37AM

I could not know yet why ImmGetOpenStatus returns always true on yours.
But I found other implementation. Would you try this pseudo patch?

- fIME = ImmGetOpenStatus(hIMC);
+ fIME = (ImmGetCompositionString(hIMC, GCS_COMPSTR, NULL, 0) > 0) ? TRUE : FALSE;

Thanks.

Re: ns_bookmarks: IME ready
Posted by: Dorian
Date: January 29, 2006 02:42PM

It works now . Thank

Re: ns_bookmarks: IME ready
Posted by: mark307
Date: January 30, 2006 02:08PM

Thank you for your work, Dorian. I really respect you.
I'm waiting for next release of your product with expectation.
Thanks.

K-Meleon forum is powered by Phorum.