"[...] Another kind of translation is done when the control key is
pressed: for example, for CTRL-A key press the key down event still
carries the same key code 'A' as usual but the char event will have key
code of 1, the ASCII value of this key combination."
so I would expect to get the key code 1 for the CTRL-a combination, but
it doesn't, it returns 97 instead, the same as 'a'.
Am I missing something or it's a real bug?
(I'm using wxPython 2.6.1.1pre on Ubuntu)
"[...] Another kind of translation is done when the control key is
pressed: for example, for CTRL-A key press the key down event still
carries the same key code 'A' as usual but the char event will have key
code of 1, the ASCII value of this key combination."
so I would expect to get the key code 1 for the CTRL-a combination, but
it doesn't, it returns 97 instead, the same as 'a'.
Am I missing something or it's a real bug?
(I'm using wxPython 2.6.1.1pre on Ubuntu)
I'm using EVT_CHAR in my application, but you can easily verify it
running KeyEvents.py included in the wxPython demo.
···
On Sun, 2006-05-14 at 10:17 -0700, Phil Mayes wrote:
At 10:12 AM 5/14/2006, you wrote:
>Hello, quoting the docs from
>wxPython API Documentation — wxPython Phoenix 4.2.2 documentation
>
>"[...] Another kind of translation is done when the control key is
>pressed: for example, for CTRL-A key press the key down event still
>carries the same key code 'A' as usual but the char event will have key
>code of 1, the ASCII value of this key combination."
>
>so I would expect to get the key code 1 for the CTRL-a combination, but
>it doesn't, it returns 97 instead, the same as 'a'.
>Am I missing something or it's a real bug?
>(I'm using wxPython 2.6.1.1pre on Ubuntu)
Sounds as if you're using EVT_KEY_DOWN. Try using EVT_CHAR.
Here's a screenshot of KeyEvents.py when Ctrl-A is pressed; as you can see, it works for me. If you're seeing 97 where I see 1, it sounds like a real bug. I'm running Windows XP, Python 2.3.5 and wxPython 2.6.2.1.
Phil
···
At 10:26 AM 5/14/2006, you wrote:
On Sun, 2006-05-14 at 10:17 -0700, Phil Mayes wrote:
> At 10:12 AM 5/14/2006, you wrote:
>
> >Hello, quoting the docs from
> >wxPython API Documentation — wxPython Phoenix 4.2.2 documentation
> >
> >"[...] Another kind of translation is done when the control key is
> >pressed: for example, for CTRL-A key press the key down event still
> >carries the same key code 'A' as usual but the char event will have key
> >code of 1, the ASCII value of this key combination."
> >
> >so I would expect to get the key code 1 for the CTRL-a combination, but
> >it doesn't, it returns 97 instead, the same as 'a'.
> >Am I missing something or it's a real bug?
> >(I'm using wxPython 2.6.1.1pre on Ubuntu)
>
> Sounds as if you're using EVT_KEY_DOWN. Try using EVT_CHAR.
I'm using EVT_CHAR in my application, but you can easily verify it
running KeyEvents.py included in the wxPython demo.
On Sun, 2006-05-14 at 11:35 -0700, Phil Mayes wrote:
At 10:26 AM 5/14/2006, you wrote:
Here's a screenshot of KeyEvents.py when Ctrl-A is pressed; as you can see,
it works for me. If you're seeing 97 where I see 1, it sounds like a real
bug. I'm running Windows XP, Python 2.3.5 and wxPython 2.6.2.1.
"[...] Another kind of translation is done when the control key is
pressed: for example, for CTRL-A key press the key down event still
carries the same key code 'A' as usual but the char event will have key
code of 1, the ASCII value of this key combination."
so I would expect to get the key code 1 for the CTRL-a combination, but
it doesn't, it returns 97 instead, the same as 'a'.
Am I missing something or it's a real bug?
(I'm using wxPython 2.6.1.1pre on Ubuntu)
Sounds as if you're using EVT_KEY_DOWN. Try using EVT_CHAR.
I'm using EVT_CHAR in my application, but you can easily verify it
running KeyEvents.py included in the wxPython demo.
This has been fixed in wxGTK. Please try a current version.
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!
Lorenzo Allegrucci wrote:
>>
>>> Hello, quoting the docs from
>>> wxPython API Documentation — wxPython Phoenix 4.2.2 documentation
>>>
>>> "[...] Another kind of translation is done when the control key is
>>> pressed: for example, for CTRL-A key press the key down
event still
>>> carries the same key code 'A' as usual but the char event
will have
>>> key code of 1, the ASCII value of this key combination."
>>>
>>> so I would expect to get the key code 1 for the CTRL-a
combination,
>>> but it doesn't, it returns 97 instead, the same as 'a'.
>>> Am I missing something or it's a real bug?
>>> (I'm using wxPython 2.6.1.1pre on Ubuntu)
>> Sounds as if you're using EVT_KEY_DOWN. Try using EVT_CHAR.
>
> I'm using EVT_CHAR in my application, but you can easily verify it
> running KeyEvents.py included in the wxPython demo.
This has been fixed in wxGTK. Please try a current version.
I tried it on 2.6.3.2 on FC5. I found that it works if CAPS-LOCK is off, but
it returns 65 if CAPS-LOCK is on.
MSW correctly returns 1 in both cases.
Below is the screen shot. It is in text form - I could not figure out how to
save it as an image and transfer it to my MSW machine - but it is a genuine
copy-and-paste.
I confirm the bug has been fixed in wxPython-2.6.3.2, thank you and
sorry for the noise.
···
On Sun, 2006-05-14 at 13:05 -0700, Robin Dunn wrote:
Lorenzo Allegrucci wrote:
> On Sun, 2006-05-14 at 10:17 -0700, Phil Mayes wrote:
>> At 10:12 AM 5/14/2006, you wrote:
>>
>>> Hello, quoting the docs from
>>> wxPython API Documentation — wxPython Phoenix 4.2.2 documentation
>>>
>>> "[...] Another kind of translation is done when the control key is
>>> pressed: for example, for CTRL-A key press the key down event still
>>> carries the same key code 'A' as usual but the char event will have key
>>> code of 1, the ASCII value of this key combination."
>>>
>>> so I would expect to get the key code 1 for the CTRL-a combination, but
>>> it doesn't, it returns 97 instead, the same as 'a'.
>>> Am I missing something or it's a real bug?
>>> (I'm using wxPython 2.6.1.1pre on Ubuntu)
>> Sounds as if you're using EVT_KEY_DOWN. Try using EVT_CHAR.
>
> I'm using EVT_CHAR in my application, but you can easily verify it
> running KeyEvents.py included in the wxPython demo.
This has been fixed in wxGTK. Please try a current version.