Re: Keybinding changes in 3.8?




forgot the include gnome-shell-list...

hi,

global.display.add_keybinding is no longer availabe in 3.8. Here is the code i use the add/remove
binding. (this_utils is a helper class to access the settings)

  _addKeyBinding: function(key, handler) {
    this._bindings.push(key);

if (Main.wm.addKeybinding && Shell.KeyBindingMode) { // introduced in 3.7.5
      Main.wm.addKeybinding(key,
        this._utils.getSettingsObject(), Meta.KeyBindingFlags.NONE,
        Shell.KeyBindingMode.NORMAL | Shell.KeyBindingMode.MESSAGE_TRAY,
        handler
      );
} else if (Main.wm.addKeybinding && Main.KeybindingMode) { // introduced in 3.7.2
      Main.wm.addKeybinding(key,
        this._utils.getSettingsObject(), Meta.KeyBindingFlags.NONE,
        Main.KeybindingMode.NORMAL | Main.KeybindingMode.MESSAGE_TRAY,
        handler
      );
    } else {
      global.display.add_keybinding(
        key,
        this._utils.getSettingsObject(),
        Meta.KeyBindingFlags.NONE,
        handler
      );
    }
  },


and to remove the bindings again:

    let size = this._bindings.length;

    for(let i = 0; i<size; i++) {
      if (Main.wm.removeKeybinding) {// introduced in 3.7.2
        Main.wm.removeKeybinding(this._bindings[i]);
      } else {
        global.display.remove_keybinding(this._bindings[i]);
      }
    }
    this._bindings = [];


hope that helps

Am 22.05.2013 12:28, schrieb Tim Cuthbertson:
Hi Folks,

I haven't been following GS development much lately, so please forgive
me if this has been discussed already (I searched but couldn't find
anything, so pointers would be good).

I'm the author of shellshape[1][2], and multiple users are telling me
that keyboard shortcuts are broken[3] in 3.8. My extension by default
uses <super> as the modifier key for most of its custom shortcuts.

Are there known changes I need to make for my extension to make use of
keybindings in 3.8? Or is this a bug / unknown breakage? Or is it
ubuntu's fault?

[1]: https://extensions.gnome.org/extension/294/shellshape/
[2]: http://gfxmonk.net/shellshape/
[3]: https://github.com/gfxmonk/shellshape/issues/113


Thanks,
  - Tim.
_______________________________________________
gnome-shell-list mailing list
gnome-shell-list gnome org
https://mail.gnome.org/mailman/listinfo/gnome-shell-list


--
00:56 <soreau> Maybe Canonical is just a division of Microsoft hired to try and take down Linux
00:56 <RAOF> Our secret is out!!!!!111111



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]