add scope checking to key bindings

partly covers #79