You are not logged in.

#1 2024-02-12 13:54:32

longshot
Member
Registered: 2023-03-31
Posts: 24

[SOLVED] switch between function keys and special keys without bios

In windows there is an app called lenovo vantage, that had an option to switch between the use of function keys and special keys, whithin the app without going back to the bios.

what is want to do is a shortcut that toggles the two function, smth like this:

fn + fnN = special key
fn + fnN = FunctionkeyN

cause i have times when i need to use the function keys alot and there is times that special keys are more usable

and Thx.

Last edited by longshot (2024-04-28 15:01:56)


~ A penguin geek who wants to know every file in sysfs

Offline

#2 2024-02-12 14:14:04

Nikolai5
Member
From: North West, England, UK
Registered: 2024-01-27
Posts: 179

Re: [SOLVED] switch between function keys and special keys without bios

It sounds like you have a Lenovo, you may be able to press the fn key while holding the escape key to, in a similar way as caps lock, make the fn key lock on or off as a toggle.

On most keyboards the fn key doesn't send a signal to the OS, its a modifier key the logic of which applies within the keyboard.

At least that's what I've read.


Desktop: Ryzen 7 1800X | AMD 7800XT | KDE Plasma
MacbookPro-2012 | MATE

Offline

#3 2024-02-12 21:32:13

longshot
Member
Registered: 2023-03-31
Posts: 24

Re: [SOLVED] switch between function keys and special keys without bios

yes exactly, sorry for not providing this info before
i use
81Y3 IdeaPad L3 15IML05
Kernel: 6.7.4-arch1-1
i have turned off sxhkd and run xev to see what does fn+esc register and it registers Escape and trying to press e.g. F1 key it registers as :XF86AudioMute
so i guess this isn't valid on my model, i have read on their website that this is only for products branded under think.

is there anyway else to simulate this fn lock key that i don't have?


~ A penguin geek who wants to know every file in sysfs

Offline

#4 2024-02-12 23:41:49

seth
Member
Registered: 2012-09-03
Posts: 58,243

Re: [SOLVED] switch between function keys and special keys without bios

The brute-force method would be to xmodmap the symbols around, ie. eg.

keycode 121 = F1
keycode 67 = XF86AudioMute

You can use "xev -event keyboard" to figure the keycodes and then have a script that checks "xmodmap -pk | awk '/\(F1\)/{print $1}'" for the active mapping and flips it around.


Edit: if you're lucky the fn lock is exposed via the ideapad-laptop sysfs, https://github.com/torvalds/linux/blob/ … pad-laptop

Last edited by seth (2024-02-12 23:54:06)

Offline

#5 2024-02-13 22:35:45

longshot
Member
Registered: 2023-03-31
Posts: 24

Re: [SOLVED] switch between function keys and special keys without bios

I didn't like the brute force method, but I'll use it if there isn't any other option. Thanks

But I'm more interested in what u said later, what is sysfs? hmm

Last edited by longshot (2024-02-13 22:36:08)


~ A penguin geek who wants to know every file in sysfs

Offline

#6 2024-02-13 22:37:14

Trilby
Banned
Registered: 2011-11-29
Posts: 30,330
Website

Re: [SOLVED] switch between function keys and special keys without bios

longshot wrote:

... what is sysfs? hmm

That's your follow-up question?  Is google broken?

What's the output, on your system, of:

ls /sys/bus/platform/devices/VPC2004:*/fn_lock

Last edited by Trilby (2024-02-13 22:38:55)


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#7 2024-02-13 22:38:14

seth
Member
Registered: 2012-09-03
Posts: 58,243

Re: [SOLVED] switch between function keys and special keys without bios

Did you check the link I posted?

ls /sys/bus/platform/devices/VPC2004:*/fn_lock /sys/bus/pci/devices/*/PNP*/VPC2004:*/fn_lock

Offline

#8 2024-02-13 23:15:48

longshot
Member
Registered: 2023-03-31
Posts: 24

Re: [SOLVED] switch between function keys and special keys without bios

Oh sry didn't understand that at first, THANKS ALOT, I've found the file and switching between 1 and 0 changes it state. just wanna ask what is the best way to write to /sys files
i used

 echo -n '1' | doas tee /sys/....../fn_lock 

is there a better way?


~ A penguin geek who wants to know every file in sysfs

Offline

#9 2024-02-13 23:25:30

seth
Member
Registered: 2012-09-03
Posts: 58,243

Re: [SOLVED] switch between function keys and special keys without bios

No. You can skip the "-n" but will have to invoke a sub-process to write a root, tee is a common pattern.

You can add your findings here:
https://wiki.archlinux.org/title/Laptop … Pad_series

And please always remember to mark resolved threads by editing your initial posts subject - so others will know that there's no task left, but maybe a solution to find.
Thanks.

Offline

#10 2024-04-29 11:07:29

longshot
Member
Registered: 2023-03-31
Posts: 24

Re: [SOLVED] switch between function keys and special keys without bios

Done, thx bro


~ A penguin geek who wants to know every file in sysfs

Offline

Board footer

Powered by FluxBB