DescriptionAdd flexible keybinding/command system to sk_app.
Viewer demonstrates use: Just create an instance of CommandSet,
register with the window, and add commands. Hopefully, we can keep
all commands in one place, and get some nice side-benefits. With
this framework, if you want to add a new command, you are only
required to add code in ONE place. And you get added to the help
screen, for free.
CommandSet automatically binds 'h' to cycle through the help modes.
(Functional grouping is most useful for general use, but the other
mode is nice to know what a key does, or to find an unused key for
a new feature).
Grouped by function: https://screenshot.googleplex.com/G5h3f52wFKu.png
Alphabetical by key: https://screenshot.googleplex.com/nZiopabLKJ6.png
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1955293002
Committed: https://skia.googlesource.com/skia/+/622c8d5de12f264e496e8d4664a2eea9333922d0
Patch Set 1 #Patch Set 2 : Extract keybinding system as CommandSet. Add grouping and two help modes. #
Total comments: 2
Patch Set 3 : Comment CommandSet. Remove _Key suffix from Window::Key values #Patch Set 4 : Rebase #
Messages
Total messages: 33 (15 generated)
|