> > To be able to present a different ui (i.e. keyboard-driven) if the
> > user triggers the event via the keyboard. Emacs gives you a file
> > dialog if you select Open from the file menu, but uses the minibuffer
> > if you hit C-X C-F.
>
> These are obviously different commands then. If the UI presented isn't
> the same, then the menu shouldn't show the same hotkey.
You're not an emacs user, and so from that perspective I do see your
point. In emacs, it *is* the same command, but has different
presentations. But, hearing your confusion, I may include an option
to operate as a non-emacs user might expect.
It's not the same command, and it's not the same command in emacs. It
does *a different thing*. That makes it a different command.
It doesn't matter what you dispatch on to tell the difference - emacs
might dispatch on context, while a wxPython implementation would
dispatch based on the command ID, but you're still dispatching on
something, and you're still doing different things.
A similar difference can be found in "Find..." vs "Find Next". "Find
Next" will either search to the next instance of the search term, or
(if there is no search term) it will open the "Find" dialog so you can
enter one. If there's no search term, the two commands behave
identically and you might be confused into thinking they're the same
thing - but they aren't. They're two distinct commands, because the
second has different behavior and dispatches based on different
context.
> Use a wxAcceleratorTable for your keyboard shortcuts, with different
> IDs than the menu events.
Thanks, that's a useful tidbit. I hadn't run across the
wxAcceleratorTable before.
If you're specifically trying to implement emacs style keybindings,
there was a post a while ago (maybe a year?) with a custom keybinding
scheme that managed 2-stage keybindings. If I can find the post I'll
reply with a link.
···
On 10/8/07, Rob McMullen <rob.mcmullen@gmail.com> wrote:
On 10/8/07, Chris Mellon <arkanes@gmail.com> wrote:
> On 10/8/07, Rob McMullen <rob.mcmullen@gmail.com> wrote: