Creating keyboard shortcuts using Fn or Win key in mint 12

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post please read this

Creating keyboard shortcuts using Fn or Win key in mint 12

Postby Cool Name Man on Sun Feb 12, 2012 6:36 am

I run mint 12 on a laptop and I wonder if I can create keyboard shortcuts using the Fn and the Window key. Has anyone figured out how to do that in mint 12? If yes, please share your trick.
Cool Name Man
Level 1
Level 1
 
Posts: 10
Joined: Fri Feb 10, 2012 8:54 am

Linux Mint is funded by ads and donations.
 

Re: Creating keyboard shortcuts using Fn or Win key in mint

Postby xenopeek on Sun Feb 12, 2012 4:42 pm

From the menu open System Tools > System Settings > Keyboard > Shortcuts tab > Custom Shortcuts. Add a shortcut with the + sign. After giving a name and a command to run, you can click the "Disabled" at the right of your new shortcut. Then press a key combination to bind to this command. You can bind the Windows key + a letter for example. I'm not sure you can bind the Fn key with random keys, that depends also on how the keyboard handles this (does it send the Fn keypress, or does it only send the modified key you press with the Fn?).
User avatar
xenopeek
Level 21
Level 21
 
Posts: 15054
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Creating keyboard shortcuts using Fn or Win key in mint

Postby Cool Name Man on Mon Feb 13, 2012 12:11 am

Thanks Vincent Vermeulen, but I tried that before posting. Can't create shortcuts with the windows key.
Cool Name Man
Level 1
Level 1
 
Posts: 10
Joined: Fri Feb 10, 2012 8:54 am

Re: Creating keyboard shortcuts using Fn or Win key in mint

Postby xenopeek on Mon Feb 13, 2012 3:32 am

You can check if your keyboard keypresses are detected at all. First run:
Code: Select all
xinput list

Now take the id from one of the lines listing as keyboard. Probably not the first, but one of the latter. For example, my output is:
Code: Select all
⎡ Virtual core pointer                       id=2   [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                 id=4   [slave  pointer  (2)]
⎜   ↳ Logitech USB-PS/2 Optical Mouse            id=8   [slave  pointer  (2)]
⎣ Virtual core keyboard                      id=3   [master keyboard (2)]
    ↳ Virtual core XTEST keyboard                id=5   [slave  keyboard (3)]
    ↳ Power Button                               id=6   [slave  keyboard (3)]
    ↳ Power Button                               id=7   [slave  keyboard (3)]
    ↳   USB Keyboard                             id=9   [slave  keyboard (3)]
    ↳   USB Keyboard                             id=10   [slave  keyboard (3)]

I need to user id=9. Then run:
Code: Select all
xinput test 9

Try some keypresses with the Windows key to see if it is detected allright. Press Ctrl+C to abort (or just close the terminal). Here is me pressing Windows + A key (Windows key = 133, A = 38):
$ xinput test 9
key release 36
key press 133
key press 38
akey release 38
key release 133
User avatar
xenopeek
Level 21
Level 21
 
Posts: 15054
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Creating keyboard shortcuts using Fn or Win key in mint

Postby Cool Name Man on Mon Feb 13, 2012 8:22 am

Thanks again Vincent. The window key works and is in fact, already a shortcut to launch what the infinity symbol in top left corner does. Here's the output for my desired key-combination win+F1 to launch gedit.
Code: Select all
key press   133
key press   67
key release 67
key release 133

(And yes, I did check whether I was setting the wrong command or something by first setting shift+/ as shortcut, which worked and then trying win+F1, which doesn't.)

The Fn key isn't detected unless it's in combination with the arrow keys. They control brightness and system volume and are working fine. There are other Fn key combinations but they're not being detected.
Cool Name Man
Level 1
Level 1
 
Posts: 10
Joined: Fri Feb 10, 2012 8:54 am

Re: Creating keyboard shortcuts using Fn or Win key in mint

Postby xenopeek on Mon Feb 13, 2012 8:32 am

As suspected, the Fn keys are hardware level key modifiers. They are not sent to the computer as keys, but modify what is sent to the computer for other keys you press in combination. So no sense in proceeding on that.

I'm guessing you are running Linux Mint 12 with Gnome 3 + MGSE, as per default installed? I think I did manage to create a Windows key shortcut on Linux Mint 12, but only when using Cinnamon.
User avatar
xenopeek
Level 21
Level 21
 
Posts: 15054
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands


Return to Other topics

Who is online

Users browsing this forum: No registered users and 4 guests