Fix keyboard option selection.
Code refactoring, add mouse option selection.