{"id":138,"date":"2022-02-09T13:55:16","date_gmt":"2022-02-09T19:55:16","guid":{"rendered":"https:\/\/torensmith.com\/?p=138"},"modified":"2022-02-09T13:55:16","modified_gmt":"2022-02-09T19:55:16","slug":"keyboard-tinkering-part-8","status":"publish","type":"post","link":"https:\/\/torensmith.com\/?p=138","title":{"rendered":"Keyboard Tinkering, Part 8"},"content":{"rendered":"\n<p>Just a quick update here. No hardware changes since last time, but I finally got around to putting in rudimentary ghost key rejection. What I tried was laughably simple: if there are more than two new keys being detected in a single scanning pass, ignore them both and send no updates, until the next change occurs. It doesn&#8217;t even check to see if they are in positions to cause ghosting &#8212; it just relies on the fact that ghost keypresses will always appear instantaneously with the last key, and for normal keypresses that&#8217;s very unlikely. Since making that change, it&#8217;s just perfect. No ghost keypresses, and no lost keys from what I&#8217;ve noticed.<\/p>\n\n\n\n<p>One unfortunate effect from the current decoder\/diode arrangement is that I can&#8217;t really set things up for this to go to sleep and be awaked by an interrupt when any key gets pressed. So I don&#8217;t have a great way for this to go into a very low-power mode, but I can at least try to optimize the regular power usage a little. Throughout all of the previous iterations, I had a 1ms delay following each scanning pass, but the passes were now happening much faster without the IO expanders. I tried doubling the loop delay to 2ms, and noticed no change in responsiveness, but greatly increased battery life. At some point I&#8217;ll probably put something in to increase that a lot (like 25ms or so) if there haven&#8217;t been any keys pressed in an hour or so, and that&#8217;ll presumably make another huge difference. But for right now everything&#8217;s great.<\/p>\n\n\n\n<p>Oh, I should also put in some kind of support for volume\/media control. That would be useful.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Just a quick update here. No hardware changes since last time, but I finally got around to putting in rudimentary ghost key rejection. What I tried was laughably simple: if there are more than two new keys being detected in a single scanning pass, ignore them both and send no updates, until the next change [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[1],"tags":[9,3,6,7],"class_list":["post-138","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-keyboard","tag-keyboards","tag-nmb","tag-space-invaders"],"_links":{"self":[{"href":"https:\/\/torensmith.com\/index.php?rest_route=\/wp\/v2\/posts\/138","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/torensmith.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/torensmith.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/torensmith.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/torensmith.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=138"}],"version-history":[{"count":1,"href":"https:\/\/torensmith.com\/index.php?rest_route=\/wp\/v2\/posts\/138\/revisions"}],"predecessor-version":[{"id":140,"href":"https:\/\/torensmith.com\/index.php?rest_route=\/wp\/v2\/posts\/138\/revisions\/140"}],"wp:attachment":[{"href":"https:\/\/torensmith.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=138"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/torensmith.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=138"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/torensmith.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=138"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}