Ubuntu – How many keyboard key combinations are possible in Ubuntu

keyboardkeyboard-layoutshortcut-keysunity

You can press modifier keys (Ctrl, Alt, Shift and Super) together with regular keys like A or S, etc. to produce a unique key combination.

Does anyone know the total number of possible combinations?

Bear in mind Left Shift+A and Right Shift+A could be two different combinations but I'm not sure. I tried googling this question but didn't find an answer.

NOTE: My keyboard has 12 function keys plus a Fn function key modifier key for things like brightness control, media playback control, etc. Some of these key combinations might be tied into ACPI or laptop hardware and don't count. There is also a separate directional control region (Home, PgUp, arrow keys, etc. plus a separate numeric keypad.

Best Answer

In the image below I have limited the number of keys by blacking out the ones that, in my opinion, would not really be used for this (enter,arrows, hardware etc) and coloured the keys to be modifiers in gray. This will give us a nice starting point.

enter image description here

This gives us, 6 modifier (mod) keys and 63 normal keys (key), so to get the amount of two key combinations we can do key*mod and get 378, call this A.

To get the number of three key combinations we have 6 mod keys and each can be paired with another, so each key can have 5 combos. If we do 6*5 we get 30 (com) and we can multiply this by key to get the number of three key combinations com*key is 1890 and call this B.

Finally we can add A to B and get the number of mappable shortcuts for Unity, within the given criteria.

A+B = 2268

To summarize:

mod*key + com*key = answer

You should be able to use this on any keyboard by assigning the numbers to the variables (key, mod, com) by counting them and then using the final equation to work out the number of possible shortcuts.

I am no mathematician but I think I did this right, please anyone feel free to tell me if I am not in the comments but I had to answer this, it was driving me nuts.