| Thread Previous • Date Previous • Date Next • Thread Next |
Hi Egor, On 7 Jun 2009, at 12:00, Egor Zindy wrote:
Hey Team, I had a look at key events for the past hour, and across browsers, things look really messed-up. http://ejohn.org/blog/keypress-in-safari-31/ http://unixpapa.com/js/key.html I'm not even sure what I took back from reading all this. Was webkit's decision of not sending special characters via keypress justified? keypress is bad? use keydown instead? how can I find the ascii value of the key then... all very confusing. Like the example given, nothing garanties (with keydown) that when you press SHIFT + 4, it'll be the $ sign character you expect. Some people do this: http://dev.rubyonrails.org/attachment/ticket/9666/event_keypress.diffif (eventName == 'keypress' && Prototype.Browser.WebKit) return "keydown";But then some people say you shouldn't.http://github.com/sstephenson/prototype/blob/ bfd5353cbfa8b344d959d28c4e0cc86cda61cbc4/src/event.jsThe above from prototypejs seems to be the best solution by the way... if I'm not mistaken.
Hmm, that's really a quite messed up situation. I am not completely sure what the best solution is. I quickly browsed the links and I agree with you, the prototype approach might be the best solution. Also, considering the experience the guys working on prototype must have, I think it's a save option to pick.
Anything we can lift from there? I'll keep working at it as proper (cross-browser) key handling in JessyInk is pretty much critical... especially with the "custom keys" targeted for release 1.3........
Completely with you on that. Cross-browser key handling is vital for JessyInk. If you want, I can try and work on the system that lets the user assign the keys (based on your extension and what we discussed so far), so you can really dig into the event handling. Another solution is to fix the event handling with the next release and leave the customisation for 1.4.
Cheers, Hannes
| Thread Previous • Date Previous • Date Next • Thread Next |