Skip to content
This repository has been archived by the owner on Nov 8, 2017. It is now read-only.

jwerty.is() not working in FF #38

Open
pascalbayer opened this issue Jul 10, 2013 · 0 comments
Open

jwerty.is() not working in FF #38

pascalbayer opened this issue Jul 10, 2013 · 0 comments

Comments

@pascalbayer
Copy link

// For each property in the jwertyCode object, compare to `event`
for (var p in jwertyCode[n]) {
    // ...except for jwertyCode.jwertyCombo...
    if (p !== 'jwertyCombo' && event[p] != jwertyCode[n][p]) returnValue = false;
}

I'm trying to check for key binding when clicking on an element but jwerty.is() does return false for 'shift', 'cmd' & 'alt'. After some minutes of debugging I've found the problem: You're getting the originalEvent which is in that case [object MouseEvent] and has no property keyCode for that reason. Therefore the result is always false. I'm not sure if there is a solution for this problem in FF, but it is working fine in Chrome.
Thanks for this wonderful library!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants