Bloc icon indicating copy to clipboard operation
Bloc copied to clipboard

Use KMKeyCombination instead of BlKeyCombination?

Open tinchodias opened this issue 3 years ago • 8 comments

My impression is that they represent the same concepts and are built in a similar way.

But it's not only changing one class by another, of course. This is how 'Bloc-Events-KeyBinding' looks in Calypso:

Screen Shot 2021-03-24 at 13 48 32

tinchodias avatar Mar 24 '21 16:03 tinchodias

and you can add the classes BlKeyCombinationVisitor, BlKeyCombinationConverterCNF, BlKeyCombinationConverterDNF to compute DNF and CNF. It seems to me that it is over-engineered in the context of key binding. At least these classes should not be in Bloc but in a separate package. I would be more in favor of re-using KM

plantec avatar Apr 06 '22 14:04 plantec

@plantec

I browsed and debugged a bit the Keymapping package (KM). I think it covers the functionality of DNF and CNF logical structures to express key combinations. Unless I missed something.

But also, KM seems to have much better support to:

  • define alternatives for each OS platform
  • print (convert to string) the current keybinding, which is very useful to show it in menus

My impression was that it's very possible to switch to KM.

BUT, this is kind of the first time I dig into this package so I may be missing something.

tinchodias avatar Apr 07 '22 20:04 tinchodias

@plantec do you have any new opinion about this idea?

tinchodias avatar Oct 18 '22 23:10 tinchodias

Hi,

I found this issue because I wanted to open one to say the same thing and I found this one!

I personally think that we should indeed is KM and not redo a keymapping system. Duplicating this kind of system will only lead to more bugs in the future. If KM misses some things we should improve it IMO.

I don't know how hard it would be to migrate and how this would impact the code of Bloc users, but migrating to KM seems to be the right move to me.

jecisc avatar Jan 24 '24 10:01 jecisc

ok for switching to KM but no time now to do it in Toplo

plantec avatar Jan 24 '24 16:01 plantec

@jecisc thanks for looking at this issue. Could you show us some example of what should be changed in Toplo in the case of migrating to KM?

tinchodias avatar Jan 24 '24 17:01 tinchodias