On Jul 17, 5:00 pm, SegundoBob <[email protected]> wrote:
> Is there some way to assign a shortcut keystroke to a command
> implemented in a plugin that allows a user to change the shortcut
> keystroke assigned to the command?  I don't know any way to do this.  My
> testing indicates that a shortcut specifier in myLeoSettings is silently
> ignored if the command it assigns is defined in a plugin or is not
> defined anywhere.

Now know how a plugin can define a "global" command.  Thank you, Terry
Brown (see his previous posts to this thread).  But I still don't know
how a plugin can set an overridable default binding.

Ideally, a plugin could set a default binding and the user could use
myLeoSettings.leo to delete the binding or reassign the binding to
another command.

I have been unable to realize this ideal.  In my attempts I
encountered the following problems:

There seems to be no way to clear/delete a key binding.

Overriding a binding gives a warning and the attempt to override has
other effect:

Warning: shortcut conflict for <Alt+Shift+C>
                     clone-nav in   all from register-command
                     about-leo in   all from myleosettings.leo

I tried the following call in my plugin:

    c.k.bindKey(pane='all', shortcut='Alt-Shift-c',
callback=self._buttonClicked,  commandName='clone-nav',
_hash='Plugin')

This allows myLeoSettings.leo to override the binding with no error or
warning message, but it leaves two conflicting bindings displayed by
print-bindings.
I know my _hash parameter is wrong because the "binding source" column
is blank, but "plugin" is not a possible "binding source."

When the c.k.bindKey() call is NOT overriden in myLeoSettings.leo,
print-bindings shows the binding, but the binding does nothing.

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/leo-editor?hl=en.

Reply via email to