You can trying using nextLine()
which reads in a String of text.
char code = keyboard.nextLine().charAt(0);
charAt(0)
takes in the first character of the received input.
Additional Note:
If you want to convert user inputs to upper/lower case. This is especially useful.
You can chain String methods together:
char code1 = keyboard.nextLine().toUpperCase().charAt(0); //Convert input to uppercase
char code2 = keyboard.nextLine().toLowerCase().charAt(0); //Convert input to lowercase
char code3 = keyboard.nextLine().replace(" ", "").charAt(0); //Prevent reading whitespace