[wxPython] wxStyledTextCtrl / AltGr

Hello

On german keyboards the right alt-key is labled "AltGr". It's necessary
to press this key in order to enter a backslash or brackets. wxPython
(MSW, 2.2.1) seems to translate these "AltGr" key-events into
"alt + control" key-events for some reason.

(Is this a bug or a feature?)

Most widgets work well, but it's currently not possible to
edit sourcecode with a StyledTextCtrl. The function ...

  void wxStyledTextCtrl::OnChar(wxKeyEvent& evt)

doesn't add a key to the textarea if control or alt are down. :frowning:

Is there a solution to this problem?
Is it somehow possible to edit key-events?
(i.e.: I'd like to remove the modifiers.)

Bye

MEMO 09/07/00 17:47:23 (679 Bytes)

Hi all, just started using wxPython on the urging of one of
the senior RAs here, previously used perl-gtk. One of the
good points I found with that toolkit was the amount of help
one could get by going on appropriate IRC channels - are there
any similar channels for wxPython users?

If not, would anyone else be interested if I set one up?

Regards,
Denny

···

----------------------------------------------------------
Denny De La Haye \ www-edc.eng.cam.ac.uk/~djd33
Engineering Design Centre, \ www-edc.eng.cam.ac.uk
Department of Engineering, \ www.eng.cam.ac.uk
University of Cambridge, UK \ www.cam.ac.uk
----------------------------------------------------------
"The more you read, the less everyone else knows"

On german keyboards the right alt-key is labled "AltGr". It's necessary
to press this key in order to enter a backslash or brackets. wxPython
(MSW, 2.2.1) seems to translate these "AltGr" key-events into
"alt + control" key-events for some reason.

(Is this a bug or a feature?)

This was discussed on wx-devel just a few days ago. They seemed to think it
was normal eventhough it seems quite weird to me.

Most widgets work well, but it's currently not possible to
edit sourcecode with a StyledTextCtrl. The function ...

  void wxStyledTextCtrl::OnChar(wxKeyEvent& evt)

doesn't add a key to the textarea if control or alt are down. :frowning:

Is there a solution to this problem?

In theory, you could catch EVT_CHAR, manipulate the event object clearing
the modifier flags if needed and then call event.Skip() to allow the event
to continue into the StyledTextCtrl. Unfortunatly here in reality it's not
currently possible since there are no methods on wxKeyEvent to modify its
members and I didn't include access to its public data members for some
reason. I've just changed this for the next release.

···

--
Robin Dunn
Software Craftsman
robin@AllDunn.com
http://wxpython.org Java give you jitters?
http://wxpros.com Relax with wxPython!