This question already has an answer here:
I just upgraded to Ubuntu 14.04 and I can't use my old keyboard layout configuration.
I used the Caps Lock key to change the layout to Hungarian. and I used the Shift+Caps Lock key to change the layout to English.
How can I set this keyboard shortcut in Ubuntu 14.04? All I can do is a previous source and next source option in All settings -> Keyboard -> Shortcuts -> Typing. But I don't know which was selected in most case, so I prefer start hit caps-lock before writing Hungarian, and Shift-CapsLock when I start programming. But now I can just rotate this sources (layouts) which is non-sense to me. I am not a finite state machine to remember my keyboard layout state.