BartoszCichecki / LenovoLegionToolkit

Lightweight Lenovo Vantage and Hotkeys replacement for Lenovo Legion laptops.
GNU General Public License v3.0
5.54k stars 249 forks source link

Keyboard shortcuts as Action trigger #1478

Open Ace-Radom opened 2 weeks ago

Ace-Radom commented 2 weeks ago

Version

2.24.1

OS

Windows 11 23H2

Device

Legion R9000p 2021H

Is your feature request related to a problem?

As a coder myself I'm pretty used to use groups of shortcuts instead of moving mouse or touchpad to control most of the behaviors of my laptop, especially when it's a bit inconvenient to move my hand away from the keyboard while coding, which breaks my workflow.

Now llt already has the ability to run actions from tray menu but as I mentioned, it's not always so comfortable to open tray menu when someone types a lot on keyboard at that time or is in full-screen. Opening tray menu breaks the rhythm and if this happens so often, it's a bit annoying to me.

How would you like the problem to be solved?

Adding a global keyboard shortcut listener and make it as a action trigger would simply solve this problem. It isn't hard and I'm happy to work on it, therefore I'd like to know if it would be considered.

What alternatives have you considered?

PowerToys+llt CLI, but that's absolutly not a good solution.

Additional information

No response

BartoszCichecki commented 2 weeks ago

If you would like to give it a shot, I won't say no. It does seem like a potentially useful feature. There is already a MacroRecorder in Macro project that could be useful for recording key combinations that later can be assigned to Quick Actions.

Alternatively, it could be a simpler solution: just run a Quick Action with a Ctrl+Alt+ shortcut - number would be the index of Quick Action in the tray menu (which is the same order as the Quick Actions list inside LLT).

First one would be nicer, second would arguably be just as useful with less code. Risk is that Ctrl+Alt+ might already be assigned to some other app, but that is in general a risk with all shortcuts, especially global ones. The modifier keys (e.g. Ctrl+Alt) could be configurable to give users some flexibility.

Let me know what you think.

Also, there is also a low level keyboard hook that can be used for that feature.

Ace-Radom commented 2 weeks ago

I would prefer the first one. Codes in Macro project seems to be (and should be) useful, I'll take a closer look tomorrow and see which design of the user interface would be better.

There are two reasons I don't really want to use the second one as the solution. One is as you've already mentioned, a combine of Ctrl/Alt+Num is a really common keyboard shortcut and yeah, there are nearly always one or two assigned to other apps. Second is it'll be much harder to remember the index than a key may in a specific keyboard area (for example I always use I O P for shortcuts since my fingers are always there) or have relations with what the action does (P for performance), and changing orders may also break habits.

BartoszCichecki commented 2 weeks ago

I am fine with both options. 👍