[wxPython] StyledTextCtrl passing key events up

In the included demo, the CmdKeyAssign method is used to make the CTRL+B key zoom in

self.CmdKeyAssign(ord(‘B’), wxSTC_SCMOD_CTRL, wxSTC_CMD_ZOOMIN)

I’m trying to have the CTRL+T key get handled byown method. But Scintilla catches it and does that line swap thing. So I tried disabling it with CmdKeyClear; and adding a menu accelerator to call my method, it didnt’ work.

Is there a way to assign a specific method using the CmdKeyAssign method? or what is the correct way to do this…

I want CTRL+T to call my own method.

Thank you


Ahmad Baitalmal
BitBuilder

web: http://www.bitbuilder.com


Ahmad Baitalmal:

I'm trying to have the CTRL+T key get handled byown method. But
Scintilla catches it and does that line swap thing. So I tried
disabling it with CmdKeyClear; and adding a menu accelerator to call my
method, it didnt' work.

   "didnt' work" does not explain what happens.

Is there a way to assign a specific method using the CmdKeyAssign
method?

   No, CmdKeyAssign is just for the Scintilla command key table which maps
keys to internal commands.

I want CTRL+T to call my own method.

   I don't know how to do this.

   Neil

Ahmad Baitalmal wrote:

I'm trying to have the CTRL+T key get handled byown method. But Scintilla catches it and does that line swap thing. So I tried disabling it with CmdKeyClear; and adding a menu accelerator to call my method, it didnt' work.

Is there a way to assign a specific method using the CmdKeyAssign method? or what is the correct way to do this..

Catch the wxSTC's EVT_KEY_DOWN event and if the key is Ctrl-T then do your thing, otherwise call event.Skip() so wxSTC will still get the event.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!