Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15
I have a HP Pavillion zv5450CA laptop and I am running windows XP & Suse Linux 9.3. I have shortcut buttons on my laptop that run: internet, media player, a ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2005
    Location
    Delta, BC, Canada
    Posts
    32

    Using shortcut buttons on laptops


    I have a HP Pavillion zv5450CA laptop and I am running windows XP & Suse Linux 9.3. I have shortcut buttons on my laptop that run: internet, media player, a folder, volume +/-/mute. is there any way I can assign these buttons to a function when running linux? They currently do nothing whiel in Linux.

  2. #2
    Linux Guru loft306's Avatar
    Join Date
    Oct 2003
    Location
    The DairyLand
    Posts
    1,666
    you will have to map them in your keymap file if they arent run from the bios
    there is an app called xev that will when run and u put your mouse in the box will let you aquire the key number then add this to the keymap file with the apropriate command
    ~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

  3. #3
    Linux Engineer psic's Avatar
    Join Date
    Nov 2004
    Location
    Ljubljana, Slovenia
    Posts
    1,205
    Quote Originally Posted by loft306
    then add this to the keymap file with the apropriate command
    How would one do this? I've got the key numbers...
    Stumbling around the 'net:
    www.cloudyuseful.com

  4. #4
    Linux Guru Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,252
    I use an app called LinEAK that makes setting all of this up pretty easy:

    http://lineak.sourceforge.net

    Your laptop isn't currently supported, but it's pretty easy to write a definition file for it.


    I know that there's another way to do all of this, but the instructions I've seen for it seem pretty complicated (then again, I have never used them). I dunno how to walk you through it, but others here may.


    If you don't want to write a def file for LinEAK, but want to use it anyway, tell me the keys, the keycodes (from xev), and the commands you want associated with each key, and I'll write you a definition and config file.

  5. #5
    Linux Engineer psic's Avatar
    Join Date
    Nov 2004
    Location
    Ljubljana, Slovenia
    Posts
    1,205
    Thanks for the help, Cabhan, I've installed Lineak but the list of keyboards is just so long. I've got a laptop on which I'd like to get the email, internet, 'windows' and 'menu' (opposite of the windows key, across the spacebar) to work. I've not a clue as to the keyboard itself, and the laptop is an older model (some unknown manufacturer who just put components together). So do I just load one of the keyboards and edit the file? Can you maybe just give an example for a couple of keys?

    I'd rather map them to the keyboard file, it just seems a bit more natural (easier?) than using lineak, so for now I'm googling around. If anyone can explain this, please do.
    Stumbling around the 'net:
    www.cloudyuseful.com

  6. #6
    Linux Guru Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,252
    Yeah, I'd be interested in knowing how the keyboard map goes, but I've found LinEAK to work for me, and I'm lazy.

    Anywho, here's what the definition file for my keyboard looks like (I wrote it myself):

    Code:
    [LTCDLX500] # Contributed by Alex Brick
     ## This stuff will initialize some keys that are not supported by default.
     ## "e01f 161" is the Eject Key
     ## "e075 219" is the Status Key
     ## "e055 144" is the My Documents Key
     RAWCOMMAND[SETKEYCODE] = "e01f 161 e075 219 e055 144 e011 216"
       brandname = "Logitech"
       modelname = "Cordless Desktop LX 500"
     [KEYS]
       Back                  = 234
       Calc                  = 161
       Eject|Close           = 204
       Home                  = 178
       Next                  = 153
       Mail                  = 236
       Media                 = 237
       Messenger             = 121
       Mute                  = 160
       MyDocs                = 198
       Play|Pause            = 162
       Previous              = 144
       Search                = 229
       Sleep                 = 223
       Status                = 195
       Stop                  = 164
       VolumeDown            = 174
       VolumeUp              = 176
       Webcam                = 187
     [END KEYS]
    [END LTCDLX500]
    # end Logitech Cordless Desktop LX 500
    Each of these (with the exceptions of the ones named at the top) was discovered using xev. The ones at the top: the hexadecimal numbers were discovered using "dmesg", and I looked in /usr/include/linux/input.h for the corresponding keycode. After setting the keycode, I used xev to determine what it was being read as.

    My LinEAK configuration file is:

    Code:
    # Global settings
    KeyboardType            = LTCDLX500
    CdromDevice             = /dev/cdrom
    MixerDevice             = /dev/mixer
    
    # Specific keys of your keyboard
    Back            = "fbrun"
    Calc            = "kcalc"
    Home            = "rox"
    Eject           = "EAK_OPEN_TRAY"
    Close           = "EAK_CLOSE_TRAY"
    Next            = "xmms -f"
    Mail            = "firefox http://www.gmail.com"
    Media           = "Eterm --select-trailing-spaces off --buttonbar off --scrollbar no"
    Messenger       = "gaim"
    Mute            = "EAK_MUTE"
    MyDocs          = "oowriter"
    Play|Pause      = "xmms -t"
    Previous        = "xmms -r"
    Search          = "kfind"
    Sleep           = "xlock"
    Status          = "ksysguard"
    Stop            = "xmms -s"
    VolumeDown      = "EAK_VOLDOWN"
    VolumeUp        = "EAK_VOLUP"
    Webcam          = "firefox"
    So you see, each key named in the config file corresponds to a name in the definition file. And the commands are directly assigned.


    It's not too tough once you do the first one. If you're interested, let me know. Otherwise, good luck.

  7. #7
    Linux Engineer psic's Avatar
    Join Date
    Nov 2004
    Location
    Ljubljana, Slovenia
    Posts
    1,205
    Wow, thanks a lot. It's late (one thirty in the morning), so I'm going to try this out tomorrow. It seems simple enough, so I hope I don't have any problems. The keymap thing looks complicated from what I found on google, so this is what I'll be going with for now.
    Stumbling around the 'net:
    www.cloudyuseful.com

  8. #8
    Just Joined!
    Join Date
    Aug 2005
    Location
    Ottawa, Canada
    Posts
    14
    Well, quick question on this issue - I am using an od Toshiba Satellite 1800 with SuSe 9.3

    I tried doing this and accessing the media keys on the front of the computer (back, forward, play, pause, stop, cd, and the music button) and also the Internet, Shortcut1 and Shortcut 2 buttons at the top.

    When Using xev, none of those keys pressed did anything - any thoughts on this - and Lineak didnt have my keyboard listed that I could find (maybe I am blind)

    Any help would be great - and I apologize for hijacking this thread

  9. #9
    Linux Engineer psic's Avatar
    Join Date
    Nov 2004
    Location
    Ljubljana, Slovenia
    Posts
    1,205
    Ok, I loaded some generic logitech keyboard and changed the settings, but it's not working yet. I started out with the .def file, and changed the numbers for four keys which I plan on using. I deleted the rest (perhaps I shouldn't have?). I then went to the .conf file, where I assigned the commands (firefox, sylpheed, ...). I tried running lineakd -k, as well as rebooting, neither did anything.
    Stumbling around the 'net:
    www.cloudyuseful.com

  10. #10
    Just Joined!
    Join Date
    Sep 2005
    Location
    Delta, BC, Canada
    Posts
    32
    How do I get to this Xev and when I went on linleak, i don't know what keyboard i have. I have a laptop and device manager tells me nothing

Page 1 of 2 1 2 LastLast

Posting Permissions

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