question about accelerator tables

Nathan smith <[email protected]> Sat, 11 Sep 2021 02:26:30 +0100
Newsgroups gmane.comp.python.wxpython
Message-ID <[email protected]>
Hi WX python group,


Quick question, can accelerator tables be defined on two objects at the 
same time?

That is to say, could I bind one to the frame, and one to the panel, and 
have both work within a program?


For instance I have the following code currently:


class Mywin(wx.Frame):

  def showpanel(self, panel):

    self.accel_tbl = wx.AcceleratorTable(tbl);
    self.SetAcceleratorTable(self.accel_tbl) # where tbl is the setup of 
some keystrokes for instance, control p to start and stop playback.

    # code here for displaying the panel correctly.


In writing this I'd suppose not though because self in this instance is 
the MyWin class rather than frame or panel.

this being the case, is there a way to fire off an event when any key is 
pressed without necessarily interrupting that keystroke nor stopping 
other events from being fired?

for instance, I'm hoping for a way that if the user presses the control 
key within my program anywhere, it fires an event. I am already using 
tables for something else though, and use the keydown event on several 
ListCtrl's too.

I suppose KeyUp is always an option, but wouldn't I have to bind that to 
*every* widget in order to get it to work?


All the best and I hope my explanation is clear.

Nathan

P.S. Key catching is not for malicious intent, instead I'm hoping to 
catch it for a screen reader related product.

-- 
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/wxpython-users/f136134c-192e-47a4-097f-c100a2fa624f%40gmail.com.