Allok
Allok

Reputation: 745

What is the name of "Fn" key for Awesome wm?

For example:

awful.key({"Shift", }, "Left", volwidget.down)

How to find out what to write instead of "Shift" to use "Fn" key?

Upvotes: 11

Views: 8619

Answers (3)

Kes
Kes

Reputation: 333

I use the Fn key in both Awesome & Openbox WM's.
In Openbox there is the concept of keychains and it works flawlessly.
Press and release the Fn key followed by some other key and the action associated with the second key is executed.

The Fn key in Openbox and in Awesome is XF86WakeUp on my Thinkpads. It may be different on your machine.

xmodmap -pke | grep XF86WakeUp
gives output
keycode 151 = XF86WakeUp NoSymbol XF86WakeUp

In Awesome the Fn key also works with the following example code

-- open edit ".vimrc"

awful.key({ "XF86WakeUp" }, "v", function ()

awful.util.spawn("termite -e 'nvim /home/.vimrc'") end,

{description = "Edit .vimrc", group = "Code"}),

But in Awesome it does not release the v key after it is pressed. So every subsequent press of the v key causes vim to open.

What this shows is that the Fn key can be used in Awesome WM.

I just don't know how to get it to release the second key pressed!

Upvotes: 0

wdv4758h
wdv4758h

Reputation: 348

you can use xmodmap -pke to show the keycode, then you will get something like this :

...
keycode 121 = XF86AudioMute NoSymbol XF86AudioMute
keycode 122 = XF86AudioLowerVolume NoSymbol XF86AudioLowerVolume
keycode 123 = XF86AudioRaiseVolume NoSymbol XF86AudioRaiseVolume
keycode 124 = XF86PowerOff NoSymbol XF86PowerOff
keycode 125 = KP_Equal NoSymbol KP_Equal
keycode 126 = plusminus NoSymbol plusminus
keycode 127 = Pause Break Pause Break
keycode 128 = XF86LaunchA NoSymbol XF86LaunchA
keycode 129 = KP_Decimal KP_Decimal KP_Decimal KP_Decimal
...

You can see that the keycode of XF86AudioLowerVolume is 122, so you can write your code like this :

awful.key({ }, "#122", volwidget.down)

Upvotes: 11

Allok
Allok

Reputation: 745

I've found the solution: the program xev.
If it runs, it doesn't show a Fn code. Actually it doesn't have to: X can't see that key.

Anyhow, it shows you the codes for "hot" keys, like Fn+LeftArrow (for volume down). In my case the name for that is XF86AudioLowerVolume and I can use it as such in configuration files.

Upvotes: 11

Related Questions