Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macro system #278

Open
AsafMah opened this issue Nov 17, 2023 · 8 comments
Open

Macro system #278

AsafMah opened this issue Nov 17, 2023 · 8 comments
Labels
enhancement New feature or request

Comments

@AsafMah
Copy link

AsafMah commented Nov 17, 2023

Basically, a way to insert predefined text in an easy way.
Useful for entering emails, phone numbers, signatures, formatted messages, etc.

I might be a able to work on contributing to it, but I want to know if it's something you'd want to have and how to integrate it.

Here are a few ideas to throw, from other keyboards:

  1. Have a "shortcuts/macros" screen with a button, the user can fill it with their macros
  2. Have "shortcut" macros - which work via the autocorrect mechanism. For example, when typing "em" you will automatically have the expanded email as an auto-suggestion
  3. Assign macros to characters, by adding them to the options when "holding" the character
  4. Have common replacements in the macro. For example, [[date]] could insert today's date.
    a. Could be expended more to include modifiers, char codes, or even full on groovy code

The possibilities are endless obviously.

I want to know if that's an idea you want to explore and if so where should it start.

@AsafMah AsafMah added the enhancement New feature or request label Nov 17, 2023
@Chrizzle
Copy link

Chrizzle commented Nov 18, 2023

My opinion; all of them might be useful!

@Helium314
Copy link
Owner

Have "shortcut" macros - which work via the autocorrect mechanism. For example, when typing "em" you will automatically have the expanded email as an auto-suggestion

Shortcuts can already be defined in the personal dictionary, and this is integrated into the native library. Or did you have something different in mind?

Assign macros to characters, by adding them to the options when "holding" the character

Adjusting these moreKeys is pretty complicated currently, but will be much easier once the simplified layout parsing is fully implemented.

I want to know if that's an idea you want to explore and if so where should it start.

There is a lot of stuff to do already, and I won't have much time for this. But adding such kind of macros sounds useful, at least for some people.

@AsafMah
Copy link
Author

AsafMah commented Nov 24, 2023

Shortcuts can already be defined in the personal dictionary, and this is integrated into the native library. Or did you have something different in mind?
Cool! I didn't know this!

Adjusting these moreKeys is pretty complicated currently, but will be much easier once the simplified layout parsing is fully implemented.

What about adding a "screen" for all personal dictionary shortcuts? where would you start with that?

@Helium314
Copy link
Owner

You mean a screen in the settings, or like clipboard history?

@AsafMah
Copy link
Author

AsafMah commented Nov 27, 2023

@Helium314 Like clipboard history or emojis

@Helium314
Copy link
Owner

I don't really know where to start here. I haven't gotten far in understanding the main view system, though doing some work here is on my todo list.

@e-t-l
Copy link

e-t-l commented Jan 30, 2024

Have common replacements in the macro. For example, [[date]] could insert today's date.
a. Could be expended more to include modifiers, char codes, or even full on groovy code

This goes beyond shortcut replacements and into the territory of variables, which I agree are useful, but could get bloated very quickly. Moreso if real code execution were added. As an alternative, maybe consider making this app [compatible with Tasker/Macrodroid] (https://tasker.joaoapps.com/plugins-intro.html).

I haven't looked thru the dev docs in depth but it looks like it for this purpose, it would basically be adding an intent and receiver. Essentially it might look something like this:

  1. User toggles a setting in OpenBoard to enable tasker macros
  2. This setting allows users to save string variables (e.g. " [[date]] ") and maybe also associate a short description string (e.g. "Today's date in mm/dd/yy")
  3. In Tasker (or Macrodroid, they're interoperable), the user defines a macro function of arbitrary complexity, which boils down to When receive [input string] from OpenBoard, return [output string].
  4. Whenever the user types the predefined input string, OpenBoard broadcasts a tasker intent with that string. Tasker processes it and sends back an intent with the appropriate output string.
  5. OpenBoard replaces the typed input string with the new output string.

@AsafMah
Copy link
Author

AsafMah commented Feb 3, 2024

I actually also worked on a tasker integration - #290

But it seems to be not the direction they want to go on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants