#3701 closed defect (wontfix)
keypress faux event
Reported by: | guest | Owned by: | sjmiles |
---|---|---|---|
Priority: | high | Milestone: | |
Component: | Events | Version: | 0.9 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
on IE keypress faux event for [Delete] key vs. keypress for "."
both have evt.keyCode of 46 so special logic is needed for faux events vs regular events. Is there a better way to handle this...
Perhaps have dojo.keys store a faux keyCode as well and test for that in the keypress?
dojo.keys = {
... DELETE: 46, fauxDELETE: "DELETE", ...
};
Change History (4)
comment:1 follow-ups: 3 4 Changed 15 years ago by
Status: | new → assigned |
---|
comment:2 Changed 15 years ago by
Resolution: | → wontfix |
---|---|
Status: | assigned → closed |
comment:3 Changed 15 years ago by
First sentence should read:
For DELETE charCode is 0, for "." it's 46. On Mozilla, the keyCode for "." is 0, but IE won't let us set that value.
comment:4 Changed 15 years ago by
Sorry, code fragments got mangled. Wish I could edit trac entries. Anyway:
// works on all supported browsers if (!e.charCode && e.keyCode == dojo.keys.DELETE) ... or // works on all supported browsers switch(!e.charCode && e.keyCode){ // switch on non-printables case dojo.keys.DELETE: ...
Note: See
TracTickets for help on using
tickets.
For DELETE charCode is 0, for "." it's 46. On Mozilla, the keyCode for "." is 0, but won't let us set that value.
The 0 charCode identifies non-printable characters, and can be tested cross-browser. In other words:
works on all supported browsers if (!e.charCode && e.keyCode == dojo.keys.DELETE) ...
or
works on all supported browsers switch(!e.charCode && e.keyCode){ switch on non-printables
...