flowblade icon indicating copy to clipboard operation
flowblade copied to clipboard

Setting Backspace as keyboard shortcut causes traceback

Open mtlynch opened this issue 7 months ago • 2 comments

Preface: Thanks for making this great software and offering it as FOSS!

When I go to Edit > Keyboard shortcuts and create my own custom shortcuts group, it seems to fail if I try to specify backspace as a key. Here's what I see in the traceback:

Traceback (most recent call last):
  File "/nix/store/gcq20sia2q84gnkiaz9a4b6jkm3gjg6l-flowblade-2.22/flowblade/Flowblade/shortcutsdialog.py", line 391, in <lambda>
    self.kb_input.connect("key-press-event", lambda w,e: self.kb_input_listener(e))
                                                         ~~~~~~~~~~~~~~~~~~~~~~^^^
  File "/nix/store/gcq20sia2q84gnkiaz9a4b6jkm3gjg6l-flowblade-2.22/flowblade/Flowblade/shortcutsdialog.py", line 433, in kb_input_listener
    error = self.set_shortcut_callback(self.code, event, self.shortcut_label)
  File "/nix/store/gcq20sia2q84gnkiaz9a4b6jkm3gjg6l-flowblade-2.22/flowblade/Flowblade/keyevents.py", line 954, in change_single_shortcut
    shortcut_info_str = shortcuts.get_shortcut_info_for_keyname_and_modlist(key_val_name, mods_list)
  File "/nix/store/gcq20sia2q84gnkiaz9a4b6jkm3gjg6l-flowblade-2.22/flowblade/Flowblade/shortcuts.py", line 204, in get_shortcut_info_for_keyname_and_modlist
    key_name = _key_names[key_val_name]
               ~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'backspace'

This is flowblade 2.22 on NixOS (Linux).

mtlynch avatar Aug 28 '25 19:08 mtlynch

Backspace does seem to be used occasionally as keyboard shortcut so I will have to add support for it.

Flowblade does not have any advanced system making sure that keys' default functions will keep working when they are set to be used as shortcut, so setting Backspace as shortcut anywhere else other then Timeline will likely disable it when inputting text. However, I just got an idea on how this could be fixed, so maybe we get some improvement here too.

jliljebl avatar Sep 08 '25 06:09 jliljebl

We started porting keyboard shortcuts to a new per widget based system instead of our current manually focus managed global shortcuts system.

Once that is done all non-global shortcuts can be made to use Backspace but global shortcuts remain an open question, we would need to somehow make sure that text widgets consume Backspace before global shortcuts are attempted, let's see things go, perhaps Gtk handles that for us automatically.

jliljebl avatar Oct 07 '25 06:10 jliljebl