Is this possible? I have tried the standard of bind all <KeyPress-BackSpace> {}
and tried doing both KeyUp and KeyDown but nothing seems to work. Is this a side effect of how editmode works? or sendkey? or part of how tcl/tk works? or pd? My goal is to get editmode sort of interaction without BackSpace and/or Delete deleting selected objects, so any solution working towards those ends should work.
-
Unbinding Delete and or Backspace
-
@oid you can use 'break' to do it:
bind all <BackSpace> {break}
also related: bindtags https://tcl.tk/man/tcl/TkCmd/bindtags.htmedit: actually for me it also works if I do
bind all <KeyPress-BackSpace> { }
with it on separate lines. I have no idea why it works but I guess there needs to be something in the brackets. just using an empty string didn't work either.
tcl being tcl, but from discussions seems like it shouldn't have to be..
edit2: you can usebind all <BackSpace> { }
orbind all <BackSpace> {;}
-
@seb-harmonik.ar said:
tcl being tcl, but from discussions seems like it shouldn't have to be..
Perhaps this has something to do with the KeyUp and KeyRelease bindings going to sendkey which sends all KeyUp and KeyDown events to sendkey? Key codes 8 and 127 are essentially bound twice on linux and sendkey is left to figure it out.
While this works it did create an unforeseen hiccup, [key] and [keyname] no longer get these keys because sendkey, but [receivecanvas] still gets them but only the release which is slightly irksome but not a huge deal
Edit: Yup, it is the generic bindings for all KeyPress and KeyRelease events which were the issue, it seems without something (even whitespace) to bind too it will not unbind those, if you do bind all {} for KeyPress-Delete, KeyRelease-Delete and Delete it works.
-
@oid yeah originally I tried sending to the #key, #keyup, and #keyname symbols like
pdsend "#key 8"
but of course it throws an error if there are no[key]
objects.. -
@seb-harmonik.ar I just went with
bind all <BackSpace> {::pd_bindings::sendkey %W 1 7 "" 1 7}
and turned the backspace into an ascii bell which makes everything work and should not cause issues. Weirdly still get the KeyRelease event for BackSpace instead of Bel but nothing gets deleted and everything works with just a change of an 8 to a 7 in my patch.