Thread: unpleasant characters

unpleasant characters

From
Euler Taveira de Oliveira
Date:
Hi,

I saw a complain about unpleasant characters (listed above) that are generated
by Fx while using SQL Editor. I made an ugly patch to solve the issue. It is a
wxGTK 2.8.10 (debug and unicode build). I didn't test if it affects other
plataforms or versions. Maybe the right fix could be coding OnChar() to ignore
Fx key strokes (or other unpleasant characters)?

F2 = ŕ
F3 = Ŗ
F4 = ŗ
F8 = ś
F9 = Ŝ
F11 = Ş
F12 = ş


--
  Euler Taveira de Oliveira
  http://www.timbira.com/
Index: pgadmin/ctl/ctlSQLBox.cpp
===================================================================
--- pgadmin/ctl/ctlSQLBox.cpp    (revisão 8098)
+++ pgadmin/ctl/ctlSQLBox.cpp    (cópia de trabalho)
@@ -335,6 +335,10 @@
             break;
     }

+    // Ignore F1-F12 keys
+    if (event.GetKeyCode() >= WXK_F1 && event.GetKeyCode() <= WXK_F12)
+        return;
+
     // Block comment/uncomment
     if (event.GetKeyCode() == 'K')
     {

Re: unpleasant characters

From
Dave Page
Date:
On Mon, Dec 14, 2009 at 12:35 PM, Euler Taveira de Oliveira
<euler@timbira.com> wrote:
> Hi,
>
> I saw a complain about unpleasant characters (listed above) that are generated
> by Fx while using SQL Editor. I made an ugly patch to solve the issue. It is a
> wxGTK 2.8.10 (debug and unicode build). I didn't test if it affects other
> plataforms or versions. Maybe the right fix could be coding OnChar() to ignore
> Fx key strokes (or other unpleasant characters)?

Hi Euler,

Do you know if this will have any unpleasant side-effects in Japan or
other regions with what we would consider to be unusual keyboard
layouts?


--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com

Re: unpleasant characters

From
Euler Taveira de Oliveira
Date:
Dave Page escreveu:
> Do you know if this will have any unpleasant side-effects in Japan or
> other regions with what we would consider to be unusual keyboard
> layouts?
>
>
As I said, I don't know if we'll have problems with it; but if they map Fx key
to some character, they have trouble using our shortcuts anyway. Could Hiroshi
or someone else confirm this? If we have problems, I'm afraid the only path is
coding OnChar() (which would be a pain in the neck because we'll have to
maintain code that IMHO is WX responsibility).

I noticed that even if we don't event.Skip() on OnKeyDown() event (the patch)
the shortcut is executed (for example F5) maybe because it is caught by
OnKeyUp(), another key event, or another object? I don't know how events are
handled in WX but somehow OnKeyDown() are processed _before_ OnChar() so the
character are not printed. Also, it didn't prevent another object (wxMenu) to
capture that event too.

Did you reproduce the problem?


--
  Euler Taveira de Oliveira
  http://www.timbira.com/

Re: unpleasant characters

From
Ian Barwick
Date:
Hi

A long-time lurker writes:

2009/12/14 Euler Taveira de Oliveira <euler@timbira.com>:
> Dave Page escreveu:
>> Do you know if this will have any unpleasant side-effects in Japan or
>> other regions with what we would consider to be unusual keyboard
>> layouts?
>>
>>
> As I said, I don't know if we'll have problems with it; but if they map Fx key
> to some character, they have trouble using our shortcuts anyway. Could Hiroshi
> or someone else confirm this?

The function keys on Japanese keyboards (I am typing on one right now)
are not used for any special Japanese characters. They can be used when
inputting Japanese to modify the input string, but any keypresses should be
caught by the IME and not passed through to the underlying application.
When inputting SQL, the keyboard would effectively be the same as a US
keyboard. The same applies, AFAIK, to other East Asian languages.

I also happen to have a Thai keyboard knocking around and the function
keys are not used for anything special there either.

HTH

Ian Barwick

Re: unpleasant characters

From
Dave Page
Date:
On Mon, Dec 14, 2009 at 2:02 PM, Euler Taveira de Oliveira
<euler@timbira.com> wrote:
> Dave Page escreveu:
>> Do you know if this will have any unpleasant side-effects in Japan or
>> other regions with what we would consider to be unusual keyboard
>> layouts?
>>
>>
> As I said, I don't know if we'll have problems with it; but if they map Fx key
> to some character, they have trouble using our shortcuts anyway. Could Hiroshi
> or someone else confirm this? If we have problems, I'm afraid the only path is
> coding OnChar() (which would be a pain in the neck because we'll have to
> maintain code that IMHO is WX responsibility).
>
> I noticed that even if we don't event.Skip() on OnKeyDown() event (the patch)
> the shortcut is executed (for example F5) maybe because it is caught by
> OnKeyUp(), another key event, or another object? I don't know how events are
> handled in WX but somehow OnKeyDown() are processed _before_ OnChar() so the
> character are not printed. Also, it didn't prevent another object (wxMenu) to
> capture that event too.
>
> Did you reproduce the problem?

Nope - cannot reproduce any problem here, but then my Windows machine
is running in vmware fusion which may not be helping matters.

Anyone else?

--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com

Re: unpleasant characters

From
Dave Page
Date:
On Mon, Dec 14, 2009 at 3:07 PM, Ian Barwick <barwick@gmail.com> wrote:
> Hi
>
> A long-time lurker writes:
>
> 2009/12/14 Euler Taveira de Oliveira <euler@timbira.com>:
>> Dave Page escreveu:
>>> Do you know if this will have any unpleasant side-effects in Japan or
>>> other regions with what we would consider to be unusual keyboard
>>> layouts?
>>>
>>>
>> As I said, I don't know if we'll have problems with it; but if they map Fx key
>> to some character, they have trouble using our shortcuts anyway. Could Hiroshi
>> or someone else confirm this?
>
> The function keys on Japanese keyboards (I am typing on one right now)
> are not used for any special Japanese characters. They can be used when
> inputting Japanese to modify the input string, but any keypresses should be
> caught by the IME and not passed through to the underlying application.
> When inputting SQL, the keyboard would effectively be the same as a US
> keyboard. The same applies, AFAIK, to other East Asian languages.
>
> I also happen to have a Thai keyboard knocking around and the function
> keys are not used for anything special there either.

Thanks for the info Ian, that's good to know.


--
Dave Page
EnterpriseDB UK: http://www.enterprisedb.com