BartoszCichecki / LenovoLegionToolkit

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

Disable action keys when a modifier key is pressed #1018

Closed gawtDamn closed 1 year ago

gawtDamn commented 1 year ago

Rules

Version

2.17.0 beta 5

OS

Win11 2022 H2

Device

Legion 5 pro 16ARH7H

Is your feature request related to a problem?

I want to be able to use the action keys (shortcuts?) that are assigned to the F-keys (by having the Fn-lock enabled), but I also want to be able to use Alt+F4 to close windows without having to also hold down the function key to disable the function lock. Lenovo should handle this natively, since none of the Fn-action keys are intended to work with modifiers, but they're slacking off.

How would you like the problem to be solved?

My notional way to address this is when any modifier key is being pressed, such as Ctrl, or Alt, or Win, or Shift, it is treated as the Fn key being pressed as well, which temporarily disables the FN-lock. If this can actually be accomplished, it would probably require turning off the "Safe Fn" functionality (not sure I have the proper name there, I think it is only available in the BIOS) that treats the Fn key as the Ctrl key to reduce typing errors.

I have no idea if this is feasible, or if the function-row shortcuts are handled entirely inside the BIOS / EC. If it is handled entirely inside the BIOS/EC, the only way that this idea might be feasible would be for LLT to intercept keyboard presses, and quickly command the turn-off of the FN-lock every time the Alt/ctrl/shift key is pressed, which would probably be hard to do or just generally terrible. Also, it would probably make the FN-lock indicator on the ESC key briefly turn off then on every time one of those keys is pressed, which would also be generally terrible.

If there is no non-terrible way to do this, please close the ticket.

What alternatives have you considered?

Current alternative is using slower methods of closing windows, or CRL+W for the programs that allow that.

Other potential alternatives would be windows hotkey programs, that map various key combinations to macros. The issue with that in this case is the F4 key is mapped to the microhpone must/unmute, and that can't be used as an input to those programs.

Additional information

No response

BartoszCichecki commented 1 year ago

Huh, that is an actually interesting idea! I need to try out different things to see it can be done nicely, so no promises here, but seriously - great idea!

BartoszCichecki commented 1 year ago

That was actually pretty easy and will be available in next release! Thanks for a great idea.