keybindings: Split out check for filter_keybinding

This is a small code cleanup for clarity.