How to Create Windows Key Bindings in Linux

Most modern Linux distributions default to standard Windows key bindings, so the Windows key on your keyboard works perfectly fine without needing any work. However, those using very lightweight or even deprecated versions of Debian or Fedora/RHEL will need to make sure a configuration file is present in their home directory. This can also be used to create custom key bindings if at all necessary.

Creating a simple hidden file will fix this problem, and it can be easily removed with the rm command or a graphical file manager if it created any sort of problem. Only do this if you haven’t been able to get Linux to recognize that your Windows or menu keys are there. They’re generally going to be fine in most distributions that aren’t old school style.

Method 1: Create Windows Key Bindings in Redhat-derived (RHEl, Fedora) Distributions

Hold CTRL, ALT and T to open up a graphical terminal and then type cd ~ and push enter to get to your home directory. Type the following commands with return after each line:

cat >> .Xmodmap

keycode 115=F13

keycode 116=F14

keycode 117=F15


After you reach the last line push CTRL+D and then log out and back into your desktop environment to standardize the changes. Of course you’ll need to use your desktop manager or other software to define functions for F13, F14 and F15, which is why you shouldn’t do this if the Windows keys already work.

Method 2: Create Windows Key Bindings in Debian

You’ll also need to hold CTRL, ALT and T to open up a terminal and type cd ~ to get to your home directory before issuing these following commands with a return after each of them:

cat >> .xmodmaprc

keycode 115=F13 #left windows key

keycode 116=F14 #right windows key

keycode 117=F15 #right menu key


Once you reach the end you’ll need to push CTRL+D and then also log out and then back in again. Again you’ll not want to do this if everything seems to be working fine or if your desktop manager can assign your Windows key a function already.

Kevin Arrows
Kevin is a dynamic and self-motivated information technology professional, with a Thorough knowledge of all facets pertaining to network infrastructure design, implementation and administration. Superior record of delivering simultaneous large-scale mission critical projects on time and under budget.

Expert Tip

How to Create Windows Key Bindings in Linux

If the issue is with your Computer or a Laptop you should try using Restoro which can scan the repositories and replace corrupt and missing files. This works in most cases, where the issue is originated due to a system corruption. You can download Restoro by clicking the Download button below.

Download Now

I'm not interested