Aaron Trevena wrote:

  Hi,

I'm trying to set entries in AcceleratorTable to something other than
a button or menuitem - surely there is a way to do this ?

  Not sure what you mean, but while you need to bind accelerators
with EVT_MENU, there is no requirement there is an actual menu item.

What I want to do is add some hotkeys to specific internal functions
to implement some emacs-like keybindings, I could make this work with
keydown event handling,
but that's a bit slow, tedious and hacky.

    $self->SetAcceleratorTable
      ( Wx::AcceleratorTable->new
        ( [ wxACCEL_ALT, 'P', $ID_ACCEL_SEARCH ],
          ...
          ) );

    EVT_MENU( $self, $ID_ACCEL_SEARCH,
              sub { $self->_controls->set_focus_text } );


  And I have no menu item (and the button I use for search
has a separate ID and event binding).

HTH
Mattia

Reply via email to