[wxPython] Bug in handling of ctl + character

Hi Robin,

As of 2.3.3pre6, when the Ctrl key is down KeyEvent.GetKeyCode() returns the
position of the pressed key in the alphabet, not the ascii code of the
character in question. For example:

Ctl-a returns 1 instead of 97
Ctl-z returns 26 instead of 122
ctl-A returns 1 instead of 65 (case gets folded too!).

This is clearly wrong since these codes occupy the same space as control
codes for backspace, tab, etc.

Ummm, the ASCII codes for the control characters ARE the "position of the
pressed key in the alphabet". That is, the ASCII code for ctrl-A is 1. The
ASCII code for ctrl-Z is 26. Backspace is ctrl-H. Tab is ctrl-I.

There are no ASCII codes for shifted control keys. Ctrl-A is 1, Shift-A is 65,
unshifted-A is 97.

Is this a wxPython bug, or should I go ahead and enter this as wxWindows bug
over on SourceForge?

I think you should avoid doing so, since this behavior is correct, unless this
represents a change from PREVIOUS versions.

···

On Tue, 3 Sep 2002 12:04:45 -0700, "Tim Hochberg" <tim.hochberg@ieee.org> wrote:

--
- Tim Roberts, timr@probo.com
  Providenza & Boekelheide, Inc.

Ummm, the ASCII codes for the control characters ARE the "position of the
pressed key in the alphabet". That is, the ASCII code for ctrl-A is 1.

The

ASCII code for ctrl-Z is 26. Backspace is ctrl-H. Tab is ctrl-I.

There are no ASCII codes for shifted control keys. Ctrl-A is 1, Shift-A

is 65,

unshifted-A is 97.

Really? You learn something new every day.

>Is this a wxPython bug, or should I go ahead and enter this as wxWindows

bug

>over on SourceForge?

I think you should avoid doing so, since this behavior is correct, unless

this

represents a change from PREVIOUS versions.

Not from 2.3.3pre5; the reason I noticed was that code I wrote to work with
that version broke when run under 2.3.3pre6. It's quite possible that that
version was an aberration though.

I guess I'll just sit tight and see what the final behavior is -- I don't
really care which behavior this has as long as it stays put.

-tim

···

----- Original Message -----
From: "Tim Roberts" <timr@probo.com>