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

Activate a Hotkey #52

Open
thewaliii opened this issue Jun 22, 2024 · 2 comments
Open

Activate a Hotkey #52

thewaliii opened this issue Jun 22, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@thewaliii
Copy link

It would be nice to run a combination of shortcut keys. For example
fTFmkUb 1

Certain applications execute specific commands when a hotkey is pressed. Therefore, it would be helpful if WinXCorner could activate any command by triggering a hotkey.

@vhanla vhanla added the enhancement New feature or request label Jun 23, 2024
@vhanla
Copy link
Owner

vhanla commented Jul 3, 2024

A WIP that has a simple pseudo script parser for doing this
imagen

The hotkeys will be as follows:
_control or control or control_ where _ means hold or release (prefixed, appended) and without it, a full key press. This will be useful if you have a sequence of hotkeys to do, like _control+k+control_+_control+_b for VSCode for instance, that will do a ctrl+k then ctrl+b to toggle the sidebar.

There is more, it will check for windows on foreground/currently focused, or globally, whether by only its classname or with titlebar text too. The conditional pseudo script will be as follows:

! = follows sequence of hotkeys as mentioned above
# = follows [classname,title] there title is optional to match with current focused window
@ = follows [classname,title] there title is optional to match with any opened window

So #[classname,title]:(sequence of hotkeys)?(optional sequence of hotkeys in case condition is not met)

For instance the following will check if current window is VSCode's and will invoke ctrl+k ctrl+b sequence of hotkeys, other wise if not on VSCode, just invoke the Start Menu.

#[Chrome_WidgetWin_1]:(_control+k+control_+_control+_b)?(win)

E.g. #[conditional match]:(hotkey if match)?(hotkey if not)

Another example for Windows 10: This will check if Alt+Tab's window is visible, if so, it will hide it, otherwise it will invoke it, as a faster alternative to Task View.
#[MultitaskingViewFrame]:(escape)?(_control+_alt+tab)

It still needs some adjustments, but this is what I came up with for this interesting feature.

I pushed the code here tonight, I still need to fix some things about the UI.

@SKHasmukh
Copy link

can you give me the command for alt+esc key , so I can copy and paste it. It would be great if there is short video of how to write custom command. I am newbie, I tried writing my own but it did not work. Windows 11 Home edition amd ryzen 7 4800H. Thanks👏

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

3 participants