You are not logged in.

#1 2009-03-07 18:26:55

Redrazor39
Member
Registered: 2008-12-23
Posts: 108

What is the Fn key in xmonad keycodes?

I would like to assign some keyboard shortcuts with the Fn key right in xmonad.hs, but I don't know which one is the Fn key.

This website has the xmonad keycodes I'm talking about: http://www.haskell.org/haskellwiki/Xmonad/Key_codes

I know my actual keycodes (the number ones), but I don't know how to assign them to run commands. s1 and s2 are buttons on my laptop, mouse search button is a button on my mouse (that should be for windows search, but I don't care what I set it to, really).

s1 = keycode 159
s2 = keycode 151
Mute (Fn + F2) = keycode 160
Lower Volume (Fn + F3) = keycode 174
Raise Volume (Fn + F4) = keycode 176
Brightness Down (Fn + F5)= keycode 101
Brightness Up (Fn + F6) = keycode 212
Mouse Search Button = keycode 229
Sleep (Fn + F12) = keycode 165

This is where in my xmonad.hs I want to set my shortcuts (because I can just assign them to run commands):

} `additionalKeys`
        [ ((mod1Mask .|. controlMask, xK_End), spawn "sudo shutdown -h now")
        , ((controlMask, xK_Print), spawn "scrot -s")
        , ((0, xK_Print), spawn "scrot")

Notice the "mod1Mask", "xK_Print", etc. What I want to know is which one (out of all of those on the website above) is for the Fn key or if there is one "xK_Print", etc. thing for Fn combinations, such as Fn + F12.

I know that probably sounded confusing, but hopefully someone can help. I would really prefer doing this in xmonad.hs (and NOT use keytouch; keytouch doesn't seem to like my laptop for some reason). All I need to know is the Fn key or if I can bind the three digit keycodes in xmonad.hs to run commands.

Offline

#2 2009-03-07 19:49:54

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,490

Re: What is the Fn key in xmonad keycodes?

Usually the Fn is not directly seen by the OS. It is a key that is present to give an hardware emulation of some keys. In my laptop Fn+I emulate the 5 key in the keypad; while pressing this combinaison the OS simply see that i have pressed the 5 key on the numpad without seing that I have pressed a combinaison of keys.

You can see the keycode of keys with the xev command (under X). To see directly what the kernel see; you can use the showkey command in a console (a real console not an xterm).

Offline

#3 2009-03-07 19:53:21

andre.ramaciotti
Member
From: Brazil
Registered: 2007-04-06
Posts: 649

Re: What is the Fn key in xmonad keycodes?

Is there a way to use keycodes directly in XMonad or I have to use the keysym number?


(lambda ())

Offline

Board footer

Powered by FluxBB