Author Topic: Keybindings not working in 1.0.2?  (Read 3395 times)

jdykstra

  • Newbie
  • *
  • Posts: 4
    • View Profile
Keybindings not working in 1.0.2?
« on: September 10, 2010, 02:29:46 »
I'm using gmusicbrowser on Ubuntu Lucid, and I've had no luck getting keybindings to work.  Is this a known problem?

I've tried adding keybindings via the settings window, and by adding the KeyBindings property to the layout I'm using.  In both cases, I see no response to hitting the configured key.

A couple of layouts included with the package use escape as a keybinding to close the window.  I've tried modifying one of them to look for a different key, and once I do, escape no longer closes the window, but neither does my newly-configured key. 

Here's the test property I added to my own layout:

Keybindings   = Ctrl-n EnqueueSelected

(I know that Ctrl-q will do the EnqueueSelected action--I was just using this as a test.)

What am I doing wrong?

Quentin Sculo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1082
    • View Profile
Re: Keybindings not working in 1.0.2?
« Reply #1 on: September 10, 2010, 03:13:21 »
2 things are wrong about that line you added in the layout :
- it's KeyBindings not Keybindings
- the syntax used in the layouts for the keybinding is "c-n" (c for ctrl, a for alt, w for windows key)

Then there are more subtle problems :(

The keybindings only work if there are not used first by the widget that has the focus, it's particularly a problem for keys without modifiers (crtl, alt, win).
But even those with modifiers are sometimes affected, I just noticed that ctrl-n is used in gtk treeviews (used in SongList) to move the row cursor down, so that might explain why it didn't work for you.
I don't know if I should do something about this ctrl-n (and ctrl-p), maybe a way to disable them ? They are not implemented in SongTree btw.
Other keybindings used in SongList/SongTree : ctrl-f, ctrl-g, ctrl-a

Also, there was a bug in v1.0.2 where EnqueueSelected didn't work with SongTree :( it is fixed in the v1.0.x git branch along with a handful of bugs, but I don't know if I'll release a v1.0.3, it is also fixed in v1.1.x. So if you tested that on a layout with a SongTree, that might be the problem

Finally a stupid reason, I sometime forget to click on the "add shortcut" button :)

A precision, these shortcuts only work if a gmb layout window has the focus. For global keybindings, see the FAQ.

Hope that helps.

jdykstra

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Keybindings not working in 1.0.2?
« Reply #2 on: September 10, 2010, 03:46:47 »
Thanks for the fast reply!

- the syntax used in the layouts for the keybinding is "c-n" (c for ctrl, a for alt, w for windows key)

Ah.  Someone might want to update the layout documentation, which says "Key names are as shown in the key binding tab in the settings dialog." 

The keybindings only work if there are not used first by the widget that has the focus, it's particularly a problem for keys without modifiers (crtl, alt, win).
But even those with modifiers are sometimes affected, I just noticed that ctrl-n is used in gtk treeviews (used in SongList) to move the row cursor down, so that might explain why it didn't work for you.
I don't know if I should do something about this ctrl-n (and ctrl-p), maybe a way to disable them ? They are not implemented in SongTree btw.
Other keybindings used in SongList/SongTree : ctrl-f, ctrl-g, ctrl-a

You're getting these from the code?  I couldn't find any other way to determine which keybindings were already present.

A precision, these shortcuts only work if a gmb layout window has the focus. For global keybindings, see the FAQ.

What's a gmb layout window?  I'm afraid I don't know GNOME.

Thanks for the help!

Quentin Sculo

  • Administrator
  • Hero Member
  • *****
  • Posts: 1082
    • View Profile
Re: Keybindings not working in 1.0.2?
« Reply #3 on: September 10, 2010, 03:57:28 »
Ah.  Someone might want to update the layout documentation, which says "Key names are as shown in the key binding tab in the settings dialog."
Oops, I'll fix it.

You're getting these from the code?  I couldn't find any other way to determine which keybindings were already present.
I know about ctrl-f (find), ctrl-g (next match), ctrl-a (select all) because there are mostly standard (gtk apps, firefox, ...), and because I had to reimplement them in SongTree.
Others by trying them :)

What's a gmb layout window?  I'm afraid I don't know GNOME.
Sorry, gmb is gmusicbrowser, and by "layout window" I mean windows defined by a layout, not the dialogs.

jdykstra

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Keybindings not working in 1.0.2?
« Reply #4 on: September 10, 2010, 18:54:26 »
Thanks for the fast replies, and thanks for an incredibly useful and flexible music player.  I really appreciate all of the work that's gone into gmusicbrowser.