Open classes.html and save it as keyboard.html.  Find the opening body tag and add this attribute/value:

<body onkeydown="changeEmphasis();">

Now when press any key on the keyboard should trigger the function. 

Copy the whole function and paste it so you have two identical functions.  Change the name of one of them to changeEmphasisBack.  In that one change the colour value from yellow to red.  Change the opening body tag again:

<body onkeydown="changeEmphasis();" onkeyup="changeEmphasisBack()";>

Try it by slowly pressing and releasing a key on your keyboard.