trying to use wxStyledTextCtrl, i have just realized that i
cannot type [, ],{ nor }. I am using Python 2.0 and wxPython
2.2.1 on W98. Keyboard is set to Spanish.
(To type those characters, i must press AltGr key. i don't know
if this is important)
I don't have anything but a US keyboard, butI think I have found the
problem. The EVT_CHAR handler is not passing the key to Scintilla if the
alt key is down. I'm assuming that AltGr will also set this flag. I've
made a change to the wxSTC code, but until a new release is made you can try
catching EVT_CHAR with a handler that looks like this as a work around:
> trying to use wxStyledTextCtrl, i have just realized that i
> cannot type [, ],{ nor }. I am using Python 2.0 and wxPython
> 2.2.1 on W98. Keyboard is set to Spanish.
>
> (To type those characters, i must press AltGr key. i don't know
> if this is important)
I don't have anything but a US keyboard, butI think I have found the
problem. The EVT_CHAR handler is not passing the key to Scintilla if the
alt key is down. I'm assuming that AltGr will also set this flag.
I think (not sure) that AltGr is Ctrl + Alt
I've
made a change to the wxSTC code, but until a new release is made you can
try
catching EVT_CHAR with a handler that looks like this as a work around:
does not work for me. I have found another (silly) work around:
def OnChar(self, event):
key = event.KeyCode()
try:
car = chr(key)
if car in '\|@#¬{}?':
self.InsertText(self.GetCurrentPos(), car)
self.CmdKeyExecute(wxSTC_CMD_CHARRIGHT)
except ValueError:
pass
event.Skip()
Note: '\|@#¬{}?' are the characters that must be inserted with AltGr in
Spanish keyboard.
By the way, Robin, your work is impressive, but your response time on this
list is much more. Thanks again.
>
> Note: '\|@#¬{}?' are the characters that must be inserted with AltGr in
> Spanish keyboard.
>
Thanks. I'll change the code to check for these explicitly. Are there any
other characters that need AltGr on other European keyboards?
I'm new on this list, but I feel qualified to abswer that one at least=)
On Swedish keyboards it's @£${}\| AND ~ for combination with any char, i.e. at least ã,õ,Ã,Õ, ñ, Ñ. To get those one hits altgr+~ and then the a,o,A,O.... keys.