I have a basic typing tutor built in javascript. It has two portions:
The first portion contains the text/lesson to type and the second portion has keyboard with keys.
I code like this:
$(document).on('keyup', function(e){
if( String.fromCharCode(e.keyCode) == TextCharacter )
// Character was typed correctly
});
The problem is that it works for small case letters. If the lesson contains any character in capital case, it does not work since the user has to type “shift + character”.
Is there any way to check if character key is pressed while holding the shift key?
Thanks
event (e) has two properties to check if shift/ ctrl are pressed. event.shiftKey and event.ctrlKey properties are set to true if respective key is pressed.