Find the answer to your Linux question:
Results 1 to 9 of 9
How do i find the keycode for a spacific keyboard key & or the whole KB. i ask because i need to give life to the R 'ctrl' and 'alt' ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Guru loft306's Avatar
    Join Date
    Oct 2003
    Location
    The DairyLand
    Posts
    1,666

    How do i find the keycode .......


    How do i find the keycode for a spacific keyboard key & or the whole KB.
    i ask because i need to give life to the R 'ctrl' and 'alt' on a dvorak KB
    ~Mike ~~~ Forum Rules
    Testing? What's that? If it compiles, it is good, if it boots up, it is perfect. ~ Linus Torvalds
    http://loft306.org

  2. #2
    Linux Guru sarumont's Avatar
    Join Date
    Apr 2003
    Location
    /dev/urandom
    Posts
    3,682
    Open up an xterm and type the command 'xev'. This will monitor all your inputs and tell you everything about them. Just keep an eye on the terminal when you hit the buttons you want to check and you will see the keycode.
    "Time is an illusion. Lunchtime, doubly so."
    ~Douglas Adams, The Hitchhiker's Guide to the Galaxy

  3. #3
    Linux Enthusiast scientica's Avatar
    Join Date
    Sep 2003
    Location
    South- or "Mid-" Sweden
    Posts
    742
    How can I assign a funcion/command for a key? (like the "windows button" and the "popup menu button")?
    Regards Scienitca (registered user #335819 - http://counter.li.org )
    --
    A master is nothing more than a student who knows something of which he can teach to other students.

  4. #4
    Linux Guru loft306's Avatar
    Join Date
    Oct 2003
    Location
    The DairyLand
    Posts
    1,666
    you need to edit the apropriate keyboard map archive located->
    Code:
    file&#58;/usr/share/kbd/keymaps/i386/ <filename>
    and u can find out which one u need to edit from
    Code:
    file&#58;/etc/X11/Xf86config
    • Section "InputDevice"
      Driver "keyboard"
      Identifier "Keyboard[0]"
      Option "MapName" "Generic keyboard [ pc101 ]"
      Option "Protocol" "Standard"
      Option "XkbLayout" "dvorak"
      Option "XkbModel" "pc101"
      Option "XkbRules" "xfree86"
      EndSection
    ~Mike ~~~ Forum Rules
    Testing? What's that? If it compiles, it is good, if it boots up, it is perfect. ~ Linus Torvalds
    http://loft306.org

  5. #5
    Linux Guru sarumont's Avatar
    Join Date
    Apr 2003
    Location
    /dev/urandom
    Posts
    3,682
    scientia: You can also use xmodmap or xbindkeys.
    "Time is an illusion. Lunchtime, doubly so."
    ~Douglas Adams, The Hitchhiker's Guide to the Galaxy

  6. #6
    Linux Enthusiast scientica's Avatar
    Join Date
    Sep 2003
    Location
    South- or "Mid-" Sweden
    Posts
    742
    Thanks sarumont! (it took me a while to get it working thougt, but now it's 'perfect' -- it's customization than in windows , now one of my "windows keys" opens GNU emcas )
    Regards Scienitca (registered user #335819 - http://counter.li.org )
    --
    A master is nothing more than a student who knows something of which he can teach to other students.

  7. #7
    Linux Guru sarumont's Avatar
    Join Date
    Apr 2003
    Location
    /dev/urandom
    Posts
    3,682
    Just foi, what prog did you use to bind them?

    And a side note: I've seen keyboards with a little penguin on the "windows keys" instead of a windows symbol. And they were all hooked up to puters running Windows at a LAN party.
    "Time is an illusion. Lunchtime, doubly so."
    ~Douglas Adams, The Hitchhiker's Guide to the Galaxy

  8. #8
    Linux Enthusiast scientica's Avatar
    Join Date
    Sep 2003
    Location
    South- or "Mid-" Sweden
    Posts
    742
    Quote Originally Posted by sarumont
    Just foi, what prog did you use to bind them?

    And a side note: I've seen keyboards with a little penguin on the "windows keys" instead of a windows symbol. And they were all hooked up to puters running Windows at a LAN party.
    I've only seen pics of the "Tux Key"

    I use xmodmap, after some xev'ing I also bound a few other keys, I made a fix_keys bash script:
    Code:
    #!/bin/bash
    # 115 = left winkey, 116 = right winkey
    xmodmap -e 'keycode 115 = Super_L'
    xmodmap -e 'keycode 116 = Super_R'
    xmodmap -e 'keycode 0x75 = Menu'
    # www
    xmodmap -e 'keycode 178 = XF86HomePage'
    # e-mail
    xmodmap -e 'keycode 236 = XF86Mail'
    # Stop
    xmodmap -e 'keycode 164 = XF86AudioStop'
    # Play/Pause
    xmodmap -e 'keycode 162 = XF86AudioPlay'
    # Previous
    xmodmap -e 'keycode 144 = XF86AudioPrev'
    # Next
    xmodmap -e 'keycode 153 = XF86AudioNext'
    # Mute
    xmodmap -e 'keycode 160 = XF86AudioMute'
    # Vol -
    xmodmap -e 'keycode 174 = XF86AudioLowerVolume'
    # Vol +
    xmodmap -e 'keycode 176 = XF86AudioRaiseVolume'
    # power = 222, Sleep = 223, Wake up = 227
    xmodmap -e 'keycode 227 = XF86WakeUp'
    (I've also made a ~/.Xmodmap, but it's untested -- haven't restarted X)
    Code:
    keycode 0x73 = Super_L
    keycode 0x74 = Super_R
    keycode 0x75 = Menu
    keycode 178 = XF86HomePage
    keycode 236 = XF86Mail
    keycode 164 = XF86AudioStop
    keycode 162 = XF86AudioPlay
    keycode 144 = XF86AudioPrev
    keycode 153 = XF86AudioNext
    keycode 160 = XF86AudioMute
    keycode 174 = XF86AudioLowerVolume
    keycode 176 = XF86AudioRaiseVolume
    keycode 227 = XF86WakeUp
    then I used the IceWM's 'keys' config file to bind it, I first assigned F13,F14 to the WinKeys and added "actions" for them.
    Untill I made some diging in the IceWM CVS (-headace-), and found out that they use Super_L and Super_R for the windows keys -- there is a config option that enables IceWM to use Super_L (Win_L) as shortcu to the IceWM menu, Super_R (Win_R) opens the window list. And menu does the same as right clicking (in some apps, like X-Chat , alas not in MFB).

    Then I had to fight with the keyboard layout (changed from pc102 to pc109 (pc104, or was it pc105 -- didn't work, some keys didn't listen then)).
    Regards Scienitca (registered user #335819 - http://counter.li.org )
    --
    A master is nothing more than a student who knows something of which he can teach to other students.

  9. #9
    Just Joined!
    Join Date
    Feb 2004
    Location
    Ontario, Canada
    Posts
    19
    Can anyone tell my how I can get the windows key to open the KDE menu? I found a place for configuring keyboard shortcuts but it will only let me use the Windows key + something else (ie Win+1 or Win+F1 or something like that). Also, I can't get xev to read my volume control buttons. I use them by pressing Fn+End,Pg Up, or Pg Dn. This is on a Dell notebook. I even changed my keyboard layout to Dell Inspiron (I don't know if they're the same but should be similar).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •