Page 1 of 3 123 LastLast
Results 1 to 10 of 87

Thread: HOWTO : Create a custom keyboard shortcut

Hybrid View

  1. #1
    Join Date
    Jun 2005
    Location
    France
    Beans
    7,100
    Distro
    Ubuntu 10.04 Lucid Lynx

    HOWTO : Create a custom keyboard shortcut

    The goal of this small HOWTO is to create a custom keyboard shortcut to run a software (like xmms, 3ddesk, ...) or what command line you want (xkill, transset 0.5, ...). Personally i use this trick to launch xkill, different values of transset and also alltray.

    A- Using xbindkeys, works for each desktop (KDE, GNOME, XFCE, ...)

    1- First install xbindkeys :
    Code:
    sudo apt-get install xbindkeys
    2- Install xbindkeys-config, it's a GTK frontend for xbindkeys so it' easy to configure xbindkeys with that.
    Code:
    sudo apt-get install xbindkeys-config
    3- Configuration
    Launch xbindkeys :
    Code:
    xbindkeys
    Then launch the GUI :
    Code:
    xbindkeys-config
    And then enjoy how it's easy to configure shortcuts with this GUI



    B- Using metacity (the default GNOME window manager)
    In the example i give, i want to start xkill (graphical kill) using "Alt + a" shortcut.
    You will see some screenshots from aysiu at the bottom of the post.


    1- Open GConf editor (Applications -> System Tools -> Configuration Editor), go to apps -> metacity -> keybinding_commands, and now choose a command, for my example I choose command_1. Edit command_1 writing xkill in order to run xkill (or every command you want to launch like in a terminal).

    2- In the same directory go to global_keybindings. Edit command_1 (or the command you choose in part 1) with the wanted shortcut like that : <Alt>a (to use the windows key just edit the field with Super_L)


    Misc
    If you are looking for the name a key, the tool xev will help you. Just type xev in a terminal then you will see an output for each key you hit.
    There are some output exemples of xev in this thread.

    that's all !

    Enjoy
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by frodon; December 16th, 2005 at 01:15 PM. Reason: Add xbindkeys guide !!

  2. #2
    Join Date
    Jun 2005
    Location
    Australia
    Beans
    1,837

    Re: HOWTO : Create a custom keyboard shortcut

    I like this one.

  3. #3
    Join Date
    Jul 2005
    Location
    Freckleton, UK
    Beans
    31
    Distro
    Kubuntu 6.10 Edgy

    Re: HOWTO : Create a custom keyboard shortcut

    Great!

    I've been using xbindkeys... Ah well you learn something new everyday.

  4. #4
    Join Date
    Aug 2005
    Beans
    992

    Re: HOWTO : Create a custom keyboard shortcut

    anyway to make a keyboard shortcut that'll show hidden files in nautilus? I'd like to change from control-H to something easier...

  5. #5
    Join Date
    Apr 2005
    Beans
    645
    Distro
    Dapper Drake Testing/

    Re: HOWTO : Create a custom keyboard shortcut

    Great TIP Thx,
    I would like to add that i've added another shortcut <Alt>z to killall xkill in case you changed your mind and want to quit xkill without killing something..
    and i have a question, on my laptop Fn + F6 suppose to lock my screen ( lock PC) but it does eject the DVD-ROM, anyone knows how to change this?

    Thanks
    [My Blog] | [My Sites] | [My Ubuntu Guides]

    doc.gwos.org, the real successor of Ubuntu Guide

  6. #6
    Join Date
    Jun 2005
    Location
    France
    Beans
    7,100
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO : Create a custom keyboard shortcut

    You can manage that in System > Preferences > keyboard shortcut in the desktop section. There is an eject field and a lock screen field to specify keyboard shortcuts.

    Happy to know that you like this small TIP

  7. #7
    Join Date
    Nov 2005
    Location
    France/Germany
    Beans
    22
    Distro
    Ubuntu 6.06

    Re: HOWTO : Create a custom keyboard shortcut

    How to use the key between Ctrl and Alt ? You know the key with a flag ?

    I would create a win+E shortcut to launch nautilus.

  8. #8
    Join Date
    Jun 2005
    Location
    France
    Beans
    7,100
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO : Create a custom keyboard shortcut

    I think you should enter <Super_L>e, however run "xev" in a terminal it will tell you the keysim of each key you hit.

  9. #9
    Join Date
    Nov 2005
    Location
    France/Germany
    Beans
    22
    Distro
    Ubuntu 6.06

    Re: HOWTO : Create a custom keyboard shortcut

    <Super_L> doesn't work, but I finally found how to do the trick :

    use <Mod4> to create a shortcut with the Windows key.

    It would be good to add a table with such equivalents in the wiki.
    Last edited by Hebus95; November 29th, 2005 at 08:44 PM.

  10. #10
    Join Date
    Jun 2005
    Location
    France
    Beans
    7,100
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: HOWTO : Create a custom keyboard shortcut

    Happy that you found what you was looking for

    With my keyboard Super_L works but it might be different for some keyboards.
    I don't think a table is needed in the wiki because xev is a tool which allow you to know the keysim of each key of the keyboard, then all you have to do to know the keysim (even for multimedie buttons) is to run xev and hit the wanted key.
    Last edited by frodon; November 29th, 2005 at 09:16 PM.

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

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