Recently, I've started utilizing Dojo's latest on module for event handling. It has been working well so far, but a new issue has cropped up. Specifically, when using the keypress
event, I am unable to retrieve the character value (such as "2" or "b") of the pressed key. Previously, with the behavior
module and the connect
module, I could access this information using e.keyChar
or e.charOrCode
, however, currently they are showing as undefined.
This is how my event is set up:
on(element, 'keypress', function(e)
{
console.log(e.keyCode); //This works, but doesn't provide the desired result
console.log(e.charOrCode); //Returns undefined
console.log(e.keyChar); //Also returns undefined
});
What approach should I take to obtain the character of the pressed key while using this module?