Did I miss something or the Event.Keys object has gone from mootools since 1.4.0 ?
I cannot get the real value of a key or compare it to the current pressed key :
var modifiers = {
previous: Event.Keys.left,
next: Event.Keys.right
};
switch (evt.code){
case Event.Keys.backspace:
// Do some stuff;
break;
case Event.Keys.delete:
// Do some other stuff
break;
}
Is ther a possibility this object has move to another object or property ?
erm. Under the new API changes,
Eventis now known asDOMEvent, a MooToolsType, not a Class. Additionally, event definitions are now private behind a closure in a keys array.https://github.com/mootools/mootools-core/blob/master/Source/Types/DOMEvent.js
There is an API to work with it:
which, regretfully – is one way: You have no getter for the
Event.Keys, you cannot set it w/o going through the API either.You can redefine them as per the source or store a local var of what they mean. You can also refactor it to puncture it.
You can also do pseudo events, like
keydown:leftthe alert above will only fire if you press the left arrow inside your textarea. Hope this helps…