Skip to content

Command: macros #56

@casey-c

Description

@casey-c

A long term (low-priority) feature would be to enable macros - a sequence of keypresses that can be repeated on a whim whenever desired. So the user can record doing something like RALB; which would add a conditional A → B to the graph. And the user could just repeat that as desired wherever they wanted. For example, they could add it once and record the macro to produce:

┌─────────┐
│   ┌───┐ │
│ A │ B │ │
│   └───┘ │
└─────────┘

and then move the cursor into the inner cut. Then they can press the macro keybind to repeat that operation, putting another RALB; inside the inner cut:

┌─────────────────────┐
│   ┌───────────────┐ │
│   │   ┌─────────┐ │ │
│   │   │   ┌───┐ │ │ │
│ A │ B │ A │ B │ │ │ │
│   │   │   └───┘ │ │ │
│   │   └─────────┘ │ │
│   └───────────────┘ │
└─────────────────────┘

This enables the user to have a long, complicated sequence of keypresses shortened down into a single macro call. If it's not clear, the user doesn't have to retype RALB again to put it the second time. They just hit a key, say the number 1, to rerun the first saved macro.

While kind of a useless example, I'm sure there are some very creative uses of macros out there. And macro support is one of the benefits of the command pattern - since we've already got the command pattern created, we just need to implement a function that starts a macro, adds any new command to a list, and stops / saves the macro on another keypress.

This can be done inside the commandInvoker class rather easily I believe. It's just a matter of taking a day to implement it, finding some good selection of keybinds to work with macros, and making sure things get properly copied. Definitely doable and not too difficult either.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions