Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

keybindings & keyconfig #668

Closed
droopy4096 opened this Issue · 9 comments

3 participants

@droopy4096

I'm using keyconfig and reconfigured keys to my liking in TB, however using Conversations it brings back old keybindings.

Would it not be better to query for a current keybinding to certain actions and use them rather than hard-wire those? I understand that some keybindings are "unique" but for example "A" is used for Archive in Conversations while my TB is reconfigured to use "A" for reply all. Tying to existing keybindings sounds like a more scalable solution to me.

@protz
Owner
@droopy4096

ok, how about disabling all or some blocks of overrides? Even if it's a bulky enumeration of all singular overrides to disable it would go a long way towards making great add-on work for more people.

@protz
Owner
@droopy4096

It is "easy" to modify an XPI file and get what I wanted. However next update to Conversations will wipe out my customizations, unless I rename it too. It essentially cuts me off your updates :(

@blerner

If KeyListener.prototype.keybindings (Messages.js, line 244) were exposed, you'd be able to do this easily and modularly. (This was actually part of the reason I'd proposed the rewrite to use the keybindings dictionary in the first place -- I'd like to remove the "A" key altogether :-p)

@protz
Owner
@blerner

No, I meant more as one of the EXPORTED_SYMBOLS at the top of the file, along with Message and MessageFromGloda and such:

var EXPORTED_SYMBOLS = [ ..., 'ConversationKeybindings' ];

KeyListener.prototype = {
 ...
  keybindings = { ... }
  ...
}

const ConversationKeybindings = KeyListener.prototype.keybindings;

By sharing the pointer between KeyListener.prototype.keybindings and ConversationKeybindings, you don't have to expose KeyListener if you didn't want to, but could still allow other extensions to tweak keybindings:

// Eliminate 'A' => Archive
delete ConversationKeybindings.Generic.A;
// or change Archive from 'A' to 'Shift+X'
ConversationKeybindings.Generic.X = ConversationKeybindings.Generic.A;
ConversationKeybindings.Generic.X[0].shiftKey = true;
delete ConversatioKeybindings.Generic.A;

If you wanted to allow extensions to add wholly-new functionality, then you'd need to change the func field of the keybindings from names of functions to pointers to the functions themselves. Slightly less encapsulated, but more customizable. Think of it as another of your message hooks :)

@protz
Owner

If I were to see a pull request that implements this and bundles a sample plugin that allows one to customize the key bindings, I would definitely click the "merge pull request" button ;-)

@blerner blerner referenced this issue
Merged

Custom keys #676

@protz
Owner

The "merge pull request" button has been clicked, I'm therefore closing the issue. Any build labeled "-master" from http://jonathan.xulforum.org/files/gcv-nightlies/ contains the fix.

@protz protz closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.