{"action":"created","issue":{"url":"https://api.github.com/repos/NicoHood/HID/issues/83","repository_url":"https://api.github.com/repos/NicoHood/HID","labels_url":"https://api.github.com/repos/NicoHood/HID/issues/83/labels{/name}","comments_url":"https://api.github.com/repos/NicoHood/HID/issues/83/comments","events_url":"https://api.github.com/repos/NicoHood/HID/issues/83/events","html_url":"https://github.com/NicoHood/HID/issues/83","id":161030412,"number":83,"title":"BootKeyboard sends wrong keys","user":{"login":"obfuscated","id":2459214,"avatar_url":"https://avatars.githubusercontent.com/u/2459214?v=3","gravatar_id":"","url":"https://api.github.com/users/obfuscated","html_url":"https://github.com/obfuscated","followers_url":"https://api.github.com/users/obfuscated/followers","following_url":"https://api.github.com/users/obfuscated/following{/other_user}","gists_url":"https://api.github.com/users/obfuscated/gists{/gist_id}","starred_url":"https://api.github.com/users/obfuscated/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/obfuscated/subscriptions","organizations_url":"https://api.github.com/users/obfuscated/orgs","repos_url":"https://api.github.com/users/obfuscated/repos","events_url":"https://api.github.com/users/obfuscated/events{/privacy}","received_events_url":"https://api.github.com/users/obfuscated/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-06-18T15:48:30Z","updated_at":"2016-06-19T09:06:54Z","closed_at":null,"body":"I'm trying to use a SingleReport/BootKeyboard but it sends wrong key codes. I'm using a Micro and Arduino 1.6.9, gcc 4.9.x.\r\n\r\nThe problem is that if I send KEY_ENTER the computer receives '('.\r\nI have BootKeyboard.press(KEY_ENTER) in the code.\r\n\r\nI've tried to trace the problem and it turns out that the KeyboardAPI::set expects an index in the _asciimap, but it gets a KeyboardKeycode value instead. So it expects 10, but the code for KEY_ENTER is 40 and this is exactly the ascii for '('.\r\n\r\nIf I comment the line: `k = pgm_read_byte(_asciimap + k);` it starts to work, but now all the modifiers doesn't work (shift, control, alt and the windows button).\r\n\r\nAm I doing something wrong or the code is just broken?"},"comment":{"url":"https://api.github.com/repos/NicoHood/HID/issues/comments/226987126","html_url":"https://github.com/NicoHood/HID/issues/83#issuecomment-226987126","issue_url":"https://api.github.com/repos/NicoHood/HID/issues/83","id":226987126,"user":{"login":"NicoHood","id":6888294,"avatar_url":"https://avatars.githubusercontent.com/u/6888294?v=3","gravatar_id":"","url":"https://api.github.com/users/NicoHood","html_url":"https://github.com/NicoHood","followers_url":"https://api.github.com/users/NicoHood/followers","following_url":"https://api.github.com/users/NicoHood/following{/other_user}","gists_url":"https://api.github.com/users/NicoHood/gists{/gist_id}","starred_url":"https://api.github.com/users/NicoHood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NicoHood/subscriptions","organizations_url":"https://api.github.com/users/NicoHood/orgs","repos_url":"https://api.github.com/users/NicoHood/repos","events_url":"https://api.github.com/users/NicoHood/events{/privacy}","received_events_url":"https://api.github.com/users/NicoHood/received_events","type":"User","site_admin":false},"created_at":"2016-06-19T09:06:54Z","updated_at":"2016-06-19T09:06:54Z","body":"The (expected) chain works like this:\r\n\r\nYou call [press()](https://github.com/NicoHood/HID/blob/master/src/HID-APIs/KeyboardAPI.hpp#L55) which calls [add()](https://github.com/NicoHood/HID/blob/master/src/HID-APIs/KeyboardAPI.hpp#L77) which calls set().\r\n\r\nNow the there are **two** set() functions. One with uint8_t as param and one with the enum. But the one with the enum is virtual only and needs to be overriden:\r\nhttps://github.com/NicoHood/HID/blob/master/src/HID-APIs/KeyboardAPI.h#L59\r\n\r\nSo there are only two possible reasons for this bug:\r\n* The press() chain calls the wrong set() function\r\n* The wrong press() function is called which of course calls the \"wrong\" set()\r\n\r\n\r\nTo debug this:\r\n* Can you try [this](https://github.com/NicoHood/HID/blob/master/examples/Keyboard/BootKeyboard/BootKeyboard.ino#L38) example and check if it works?\r\n* Can you replace the marked line with a press() and a release() instead? This should trigger your bug\r\n* If this works, can you give me a **minimal** test sketch where you can reproduce the bug?\r\n\r\nI have not tested anything myself, because all my hardware is in use or broken ;)"}}
{"actor":{"display_login":"NicoHood"}}