Re: Keybinding changes in 3.8?



On Wed, May 22, 2013 at 1:15 PM, Clemens <clemens lab21 org> wrote:
global.display.add_keybinding is no longer availabe in 3.8.

That is wrong, the function still exists and is unchanged with regard
to previous versions. The issue here is that it is no longer
enough[0], you are also expected to specify when the keybinding should
be allowed - the easiest way is to use Main.wm.addKeybinding(), which
is a convenience wrapper around global.display.add_keybinding() and
Main.wm.allowKeybinding().


    if (Main.wm.addKeybinding && Shell.KeyBindingMode) { // introduced in
3.7.5
 [...]
    } else if (Main.wm.addKeybinding && Main.KeybindingMode) { // introduced
in 3.7.2
 [...]
    } else {

Up to you of course, but I don't think it is worth supporting old
unstable releases - I doubt there are actual users who run those
versions after a stable release, so you are probably cluttering your
code for nothing.


[0] Technically that's not true - global.display.add_keybinding() does
register the binding as it did before, but it will always be filtered
out unless Main.wm.allowKeybinding() has been called as well for it.


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