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

Chrome control without focusing #3

Merged
merged 5 commits into from Mar 18, 2023
Merged

Conversation

dpcalfola
Copy link
Owner

< New Shortcut >
Shortcuts for media control in Chrome
Ctrl + Option + J or K : Play/Pause
Ctrl + Option + H : Backward
Ctrl + Option + L : Forward

Shortcuts for tab control in Chrome
        Ctrl + Option + [ or ] : move left/right tab

< Why I make this feature >
I make this feature for watching development lecture video in Chrome

Previously, I had to focus on the Chrome window to control media
then switch back to the IDE window
It is so uncomfortable and required the use of mouse

With this feature,
Chrome could be controlled
while maintaining the activated window such as IDE

This feature works any media in Chrome including YouTube, Netflix, Udemy, and more

Mapping the shortcut key to H/J/K/L for intuitive control:
    Left arrow: Backward
    Right arrow: Forward
    Up or Down arrow: Play/Pause


And add tab control shortcuts:
    Ctrl + Option + [ or ] : move left/right tab

< How it works >
When shortcut key is pressed, the following steps are executed:
1. Activate Chrome window
2. Simulate the key press event
- Ctrl + Option + H/J/K/L
- H: Left arrow
- L: Right arrow
- J or K: Space bar
- Ctrl + Option + [ or ]
- [ or ]: opt + cmd + left/right arrow (These are Chrome default shortcut to move tab)
3. Activate the previous window

Consequentially, working window is going to be not changed although Chrome is controlled

Since this feature simulates the key press event,
the tap that need to control media should be activated in Chrome

This is why the tab control shortcuts are included
To move to the media tab before controlling media - Play/Pause, Backward, Forward

dpcalfola and others added 5 commits March 18, 2023 23:03
    * Shortcuts for media control in Chrome
        Ctrl + Option + J or K : Play/Pause
        Ctrl + Option + H : Backward
        Ctrl + Option + L : Forward

    * Why I make this feature:
        I make this feature for watching development lecture video in Chrome

        Previously, I had to focus on the Chrome window to control media
        then switch back to the IDE window
        It is so uncomfortable and required the use of mouse

        With this feature,
        Chrome could be controlled
        while maintaining the activated window such as IDE

        This feature works any media in Chrome including YouTube, Netflix, Udemy, and more

        And I also mapped the shortcut key to H/J/K/L for intuitive control:
            Left arrow: Backward
            Right arrow: Forward
            Up or Down arrow: Play/Pause

    * How it works:
        When shortcut key is pressed, the following steps are executed:
            1. Activate Chrome window
            2. Simulate the key press event
                - Ctrl + Option + H/J/K/L
                    - H: Left arrow
                    - L: Right arrow
                    - J or K: Space bar
            3. Activate the previous window

        Since this feature simulates the key press event,
        the tap that need to control media should be activated in Chrome
    Every Chrome control function shares the same code
        1. Activate the Chrome window
        2. Simulate the key press event
        3. Activate the previous window

    to avoid repeating the same code, I create a new function called 'controlChrome()'
    which receives the 'keys' (a list) as an argument

    Then, I bind each function to call `controlChrome()` with the respective `keys` argument.
    This allows `controlChrome()` to execute the same code for each function:
        1. Activate the Chrome window
        2. Simulate the key press event (`keys`)
        3. Activate the previously focused window

Modify > An argument of SimulateKeyPress()

    To receive combination keys as an argument
        'key' -> 'table.unpack(list: {keys})'
    * Shortcuts for tab control in Chrome without focusing
        Ctrl + Option + [ or ] : move left/right tab
    Update the version and last update date
        version: v0.206a -> v0.21
        Code & Manual date: 2023-02-17 -> 2023-03-19

    Describe about new feature "Google Chrome control without focusing"
        - Chrome media and tab control shortcuts without focusing
@dpcalfola dpcalfola merged commit 10c0f98 into main Mar 18, 2023
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.

None yet

1 participant