{"comment":{"created_at":"2011-10-12T07:54:37Z","body":"Thx you for your fast and very detailed answer. I ended up with 'shift+[0-9]/[0-9]/[num-0-num-9]'.","updated_at":"2011-10-12T07:54:37Z","url":"https://api.github.com/repos/keithamus/jwerty/issues/comments/2376700","id":2376700,"user":{"avatar_url":"https://secure.gravatar.com/avatar/d2c89762e1cf0892bf20d2389316bb3c?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/olecrivain","id":589788,"login":"olecrivain"}},"action":"created","issue":{"number":1,"created_at":"2011-10-11T15:41:30Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"Hi,\r\n\r\nI'm evaluating your library for keyboard navigation in my project. I really \r\nlike the concept but I have some difficulties with number keys.\r\n\r\nI want to bind numbers, from 0 to 9, so I started with this :\r\n\r\n```javascript\r\njwerty.key('[0-9]', function (e) {\r\n    alert(e.which);\r\n}); \r\n```\r\n\r\nIt didn't work for me because I have an azerty keyboard and I obtain '0' by pressing 'shift+0' \r\n(http://www.computerhope.com/help/azerty.gif). This leads to :\r\n\r\n```javascript\r\njwerty.key('shift+[0-9]', function (e) {\r\n    alert(e.which);\r\n}); \r\n```\r\n\r\nWorks great, but I don't care if the numbers come from the numpad or the left of the keyboard. \r\nI have to handle all of them the same way. So I tried this :\r\n\r\n```javascript\r\n// does not work\r\njwerty.key('shift+[0-9],num-[0-9]', function (e) {\r\n    alert(e.which);\r\n});\r\n```\r\n\r\n```javascript\r\n// does not work\r\njwerty.key('shift+[0-9],num-0,num-1,num-2,num-3,...', function (e) {\r\n    alert(e.which);\r\n})\r\n```\r\n\r\nand finally this :\r\n\r\n```javascript\r\njwerty.key('shift+[0-9]', function (e) {\r\n    alert(e.which);\r\n});\r\njwerty.key('num-0', function (e) {\r\n    alert(e.which);\r\n});\r\njwerty.key('num-1', function (e) {\r\n    alert(e.which);\r\n});\r\n.\r\n.\r\n.\r\njwerty.key('num-9', function (e) {\r\n    alert(e.which);\r\n});\r\n```\r\n\r\nThe last code works, but is not as easy as promising :)\r\n\r\nI think the more inuitive way of handling numbers would be the first solution : '[0-9]'. \r\nIn my case, I don't need the distinction between numpad and normal keyboard (do some people really need that?).\r\n\r\nWhat do you think?\r\n\r\nBest regards\r\nOlivier","comments":2,"title":"Numbers binding","updated_at":"2011-10-12T07:54:37Z","url":"https://api.github.com/repos/keithamus/jwerty/issues/1","id":1876787,"assignee":null,"milestone":null,"closed_at":"2011-10-11T20:06:29Z","user":{"avatar_url":"https://secure.gravatar.com/avatar/d2c89762e1cf0892bf20d2389316bb3c?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/olecrivain","id":589788,"login":"olecrivain"},"html_url":"https://github.com/keithamus/jwerty/issues/1","labels":[],"state":"closed"},"legacy":{"issue_id":1876787,"comment_id":2376700}}