js: Add and utilize function isSpecialKeypress
#377
+25
−16
Merged