It kinda bugs me that some layout items steal some keyboard shortcuts, making them useless as global key bindings. For example, SongLists and SongTrees steal both space and ctrl-space, so they are useless as play/pause shortcuts. SongLists even steal ctrl-p, which I use for opening the Settings window.

My suggestion is that all key bindings are grabbed by gmb and checked against the keybindings list before the layout item in focus gets the chance to react to it. If the key or key combination is in the global keybindings list, it should not be passed on to the current layout item in focus. There should be one exception to this: key bindings that are plain letters or space (without ctrl or alt) should not be grabbed when a text field has focus (for example SimpleSearch or inline search in a SongList or SongTree). Typically, you want to be able to type a search string that includes a space, even if you have space as a play/pause shortcut key. This is the way itunes and spotify work and I find it intuitive.

hm, i never thought much about this, but i think i agree with trasdahl on removing "space" from the songlist/tree as "play"-shortcut - i think having "enter" there is a) more common/logical/intuitive and b) sufficient.

ochosi: trasdahl is only suggesting being able to override ctrl-space (and other keys with modifiers) which in a standard gtktreeview toggle selection of the cursor row (I should implement that in SongTree btw)

I think I'm going to add an option for each shortcut instead, to either bypass shortcuts of the focused widget or not.
That way it will also be possible to use non-modified keys as shortcut, for example the azerty keyboard (french) has a "very useful" ² (square) key that doesn't do anything else, that way you could assign it a shortcut that would even work when the search entry has the focus.
What would be nice is that this "bypass" option would be on by default when using a modifier (ctrl/alt/shift/win), and off by default for plain keys. Or maybe only show the option for plain keys. But I'm not sure how it would fit in the gui. Maybe by only showing the option in a column in the list of shortcuts.

Actually, I suggest being able to override any key combination, with or without modifiers. And I argue that there are some widgets (songlists, songtrees) that you would want to override and some you would not (search entries) in some (important) use cases. I see your point with obscure keys and overriding even search entries, but I think that the case of "space" for play/pause is much more common and relevant. Therefore, I suggest that any key combination, with or without modifiers, bypasses all widgets except text entries. I guess a gtk entry doesn't grab many important key combinations with modifiers.

In this way you don't need to add any "bypass" option in the gui.

And btw, I agree with ochosi that "space" by default should be set to play/pause in songlists and songtrees.

Well, this is just my opinion. :)

Maybe, by-passing all widgets except text entries is do-able, though I'm a bit afraid it won't work correctly in some cases.

Overriding space to play/pause would go against basic keyboard navigation (for pressing buttons for example) though of course it would be only for those that choose to add space as a shortcut.

For those that want to test it, here is a small diff that implement that :

As to space in songlists/songtrees, you want to change the default behavior from play_selected to play/pause, or to play_selected/pause ?

Thanks for the patch, squentin! It works pretty much the way I suggested, all shortcuts (with or without modifiers) work everywhere except when a text entry has focus. However, you don't need to disable ALL shortcuts when a text entry has focus, only those that produce text input. So I guess one could check the modifiers in this particular case.

As for space in songlists/songtrees, I would like it if it only meant play/pause, and didn't trigger the activate-function. Activate could be triggered by pressing enter. But of course, it does not need to be the default behavior, it's only my preference. If shortcuts were able to bypass widgets, one could easily achieve this behavior by setting space as a play/pause shortcut in the settings.