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

Hotkeys and Screen Emulator #4

Open
wants to merge 56 commits into
base: main
Choose a base branch
from
Open

Conversation

mergehez
Copy link

@mergehez mergehez commented Nov 7, 2024

This PR adds support for customizable hotkeys, allowing users to assign specific hotkeys to commands.

Example of usage:

Solo::useTheme('dark')
    ->addCommands([
        // ...
        new Command(name: 'Foo', command: 'echo "See hotkeys below"', autostart: true, customHotKeys: [
            new CustomHotKey(
                key: 'e',
                name: 'echoE',
                callback: fn() => Log::info('pressed "e"...'),
                when: fn(Command $command) => $command->processRunning()
            ),
            new CustomHotKey(key: 'f', name: 'echoF', callback: fn() => Log::info('pressed "f"...')),
        ]),
        // ...
    ])

In this example, pressing 'f' will log a message. echoE is not visible because the command is not running

image

TO-DOs

  • Display a notification or visual feedback when a hotkey is pressed.
  • Add conditional visibility for hotkeys, e.g., only activating specific hotkeys when a command is stopped.
  • (Postponed) Enable users to execute commands directly within the tab.

@aarondfrancis
Copy link
Owner

Oooo I like this. I can pick it up when you're done! Don't wanna step on your toes.

@mergehez
Copy link
Author

mergehez commented Nov 7, 2024

I've completed two out of the three To-Dos.

For the third one, it would require a lot of changes to the Command class. I prefer to postpone this and implement it in a separate pull request.

@aarondfrancis
Copy link
Owner

Ok hold off for a sec, I might monkey with the API a bit on this PR. Thank you for doing this!

@mergehez
Copy link
Author

mergehez commented Nov 7, 2024

You're welcome! Feel free to treat the PR as a concept and make any changes you'd like :)

@aarondfrancis
Copy link
Owner

Ok I accidentally did like 100 things on this branch... so... stay tuned

@aarondfrancis aarondfrancis changed the title New Feature: Custom Hotkeys for Commands Hotkeys and Screen Emulator Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants