{"id":281385,"date":"2023-08-28T20:02:51","date_gmt":"2023-08-28T12:02:51","guid":{"rendered":"https:\/\/lrxjmw.cn\/qrslxtdtsjpb.html"},"modified":"2023-08-28T20:02:51","modified_gmt":"2023-08-28T12:02:51","slug":"qrslxtdtsjpb","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/qrslxtdtsjpb.html","title":{"rendered":"\u5d4c\u5165\u5f0fLinux\u7cfb\u7edf\u7684\u7279\u6b8a\u952e\u76d8\u7f16\u5199\u9a71\u52a8\u7a0b\u5e8f-Linux\u952e\u76d8\u9a71\u52a8"},"content":{"rendered":"
Linux<\/a>\u56e0\u4e3a\u5176\u5177\u6709\u5185\u6838\u5f3a\u608d\u4e14\u7a33\u5b9a\uff0c\u4fbf\u4e8e\u6269\u5145\u548c\u88c1\u51cf\uff0c\u4e30\u5bcc\u7684\u786c\u4ef6<\/a>\u652f\u6301\u7b49\u4f17\u591a\u4f18\u70b9\uff0c\u5728\u5d4c\u5165\u5f0f\u7cfb\u7edf<\/a>\u4e2d\u5f97\u5230\u4e86\u5e7f\u6cdb\u7684\u5e94\u7528\u3002\u597d\u591a\u5d4c\u5165\u5f0fLinux\u7cfb\u7edf\uff0c\u975e\u5e38\u662f\u4e00\u4e9b\u5177\u6709\u4e0e\u7528\u6237\u5f3a\u4ea4\u4e92\u7684\u5d4c\u5165\u5f0f\u7cfb\u7edf\u7ea2\u65d7linux\u5b98\u7f51\uff0c\u5e38\u5e38\u987b\u8981\u914d\u5907\u4e00\u4e2a\u7279\u6b8a\u6309\u952e\uff0c\u6b64\u65f6\u5f00\u53d1\u8005\u987b\u8981\u4f9d\u636e\u5b9e\u9645\u60c5\u51b5\uff0c\u4e3a\u81ea\u5df1\u7684\u7279\u6b8a\u6309\u952e\u7f16\u64b0\u9a71\u52a8\u7a0b\u5e8f\u3002<\/p>\n Linux\u6309\u952e\u9a71\u52a8\u7b80\u4ecb<\/p>\n Linux\u4e2d\u7684\u5927\u591a\u6570\u9a71\u52a8\u7a0b\u5e8f\u90fd\u91c7\u7528\u4e86\u5c42\u6b21\u578b\u7684\u4f53\u7cfb\u7ed3\u6784\uff0c\u9f20\u6807\u9a71\u52a8\u7a0b\u5e8f\u4e5f\u4e0d\u4f8b\u5916\u3002\u5728Linux\u4e2dlinux\u6309\u952e\u9a71\u52a8<\/strong>\uff0c\u9f20\u6807\u9a71\u52a8\u88ab\u754c\u5b9a\u6210\u4e24\u5c42\u6765\u5b9e\u73b0\u3002\u5176\u4e2d\uff0c\u4e0b\u5c42\u662f\u4e00\u4e2a\u901a\u7528\u7684\u6309\u952e\u5177\u8c61\u5c42\uff0c\u5b8c\u6210\u6309\u952e\u9a71\u52a8\u4e2d\u4e0d\u4f9d\u8d56\u4e8e\u5e95\u5c42\u5177\u4f53\u786c\u4ef6\u7684\u4e00\u4e9b\u529f\u80fd\uff0c\u4f46\u662f\u8d1f\u8d23\u4e3a\u5e95\u5c42\u63d0\u4f9b\u670d\u52a1\uff1b\u4e0a\u5c42\u5219\u662f\u786c\u4ef6\u5904\u7406\u5c42\uff0c\u4e0e\u5177\u4f53\u786c\u4ef6\u5bc6\u5207\u76f8\u5173\uff0c\u4e3b\u8981\u8d1f\u8d23\u5bf9\u786c\u4ef6\u8fdb\u884c\u76f4\u63a5\u64cd\u4f5c\u3002\u6309\u952e\u9a71\u52a8\u7a0b\u5e8f\u7684\u4e0b\u5c42\u516c\u5171\u90e8\u4efd\u90fd\u5728driver\/keyboard\u3002c\u4e2d\u3002\u8be5\u6587\u4ef6\u4e2d\u6700\u91cd\u8981\u7684\u5c31\u662f\u5185\u6838\u7528EXPORT_SYMBOL\u8fd9\u4e2a\u5b8f\u5bfc\u5165\u7684handle_sCANcode\u51fd\u6570\u3002handle_scancode\u5b8c\u6210\u7684\u529f\u80fd\u662f\uff1a\u9996\u5148\u5c06\u626b\u63cf\u7801\u8f6c\u6362\u6210\u952e\u7801\uff0c\u63a5\u7740\u6309\u7167shift\uff0calt\u7b49\u6269\u5145\u952e\u7684\u6309\u4e0b\u60c5\u51b5\u5c06\u952e\u7801\u8f6c\u6362\u6210\u76ee\u6807\u7801\uff0c\u901a\u5e38\u60c5\u51b5\u4e0b\u662fASCII\u7801\uff0c\u6700\u540e\u5c06\u8be5ASCII\u7801\u653e\u5728\u7ec8\u7aef\u8bbe\u5907\u7684\u7f13\u51b2\u533a\u4e2d\uff0c\u4f46\u662f\u8c03\u5ea6\u4e00\u4e2atasklet\u8d1f\u8d23\u5c06\u5176\u5728\u663e\u793a\u5668\u4e0a\u56de\u663e\u4e0b\u6765\u3002\u53ef\u4ee5\u770b\u51fa\uff0c\u8fd9\u4e2a\u51fd\u6570\u5b8c\u6210\u7684\u662f\u9f20\u6807\u9a71\u52a8\u7a0b\u5e8f\u4e2d\u6700\u6838\u5fc3\u7684\u4e00\u4e9b\u5de5\u4f5c\uff0c\u800c\u8fd9\u79cd\u6838\u5fc3\u7684\u903b\u8f91\u529f\u80fd\u662f\u4e0d\u4f9d\u8d56\u4e8e\u5e95\u5c42\u786c\u4ef6\u7684\uff0c\u6240\u4ee5\u53ef\u4ee5\u5c06\u5176\u72ec\u7acb\u4e0b\u6765\uff0c\u4f46\u662f\u5bfc\u5165\u7ed9\u5e95\u5c42\u7684\u786c\u4ef6\u5904\u7406\u51fd\u6570\u8c03\u7528\u3002\u5728\u8fd9\u4e2a\u6587\u4ef6\u4e2d\u8fd8\u5b9a\u4e49\u4e86\u5176\u5b83\u51e0\u4e2a\u53cd\u5f39\u51fd\u6570\uff0c\u5b83\u4eec\u7531\u9f20\u6807\u9a71\u52a8\u7a0b\u5e8f\u4e2d\u7684\u4e0b\u5c42\u516c\u5171\u90e8\u5206\u8c03\u7528\uff0c\u5e76\u7531\u5e95\u5c42\u786c\u4ef6\u5904\u7406\u51fd\u6570\u5b9e\u73b0\u3002\u4f8b\u5982kbd_init_hw\uff0ckbd_translate\uff0ckbd_unexpected_up\u7b49\u7b49\u3002\u5176\u4e2dkbd_translate\u7531handle_scancode\u8c03\u7528\uff0c\u8d1f\u8d23\u5c06\u626b\u63cf\u7801\u8f6c\u6362\u6210\u952e\u7801\uff1b\u6309\u952e\u9a71\u52a8\u7a0b\u5e8f\u7684\u5e95\u5c42\u786c\u4ef6\u5904\u7406\u90e8\u4efd\u5219\u6309\u7167\u4e0d\u540c\u7684\u786c\u4ef6\u6709\u4e0d\u540c\u7684\u5b9e\u73b0\u3002\u8bf8\u5982PC\u5e73\u53f0\u4e0a\u6807\u51c6\u6309\u952e\u7684\u5e95\u5c42\u786c\u4ef6\u5904\u7406\u51fd\u6570\u90fd\u96c6\u4e2d\u5728driver\/Pc_keyb\u3002c\u4e2d\u3002\u8fd9\u4e2a\u6587\u4ef6\u5305\u62ec\u4e86\u6309\u952e\u4e2d\u65ad\u5904\u7406\u51fd\u6570keyboard_interrupt\uff0c\u626b\u63cf\u7801\u5230\u952e\u7801\u8f6c\u6362\u51fd\u6570pckbd_translate\u7b49\u5176\u4ed6\u4e00\u4e9b\u4e0e\u5e95\u5c42\u786c\u4ef6\u5bc6\u5207\u76f8\u5173\u7684\u51fd\u6570\u3002<\/p>\n \u5728\u8fd9\u4e9b\u4f53\u7cfb\u7ed3\u6784\u4e0b\uff0c\u8981\u6dfb\u52a0\u4e00\u5757\u7279\u6b8a\u6309\u952e\u5230\u7cfb\u7edf\u4e2d\u5c31\u53d8\u5f97\u6108\u53d1\u6e05\u6670\u3002\u5f00\u53d1\u8005\u53ea\u9700\u4e3a\u5176\u7f16\u64b0\u9a71\u52a8\u7a0b\u5e8f\u4e2d\u7684\u5e95\u5c42\u786c\u4ef6\u5904\u7406\u51fd\u6570\uff0c\u5c31\u53ef\u4ee5\u5c06\u8be5\u6309\u952e\u9a71\u52a8\u4e0a\u53bb\u3002\u901a\u5e38\u8bf4\u6765\uff0c\u5e95\u5c42\u786c\u4ef6\u5904\u7406\u51fd\u6570\u4e2d\u6700\u91cd\u8981\u7684\u5de5\u4f5c\u5c31\u662f\u5728\u9f20\u6807\u4e2d\u65ad\u5904\u7406\u4e2d\u83b7\u53d6\u88ab\u6309\u4e0b\u952e\u7684\u626b\u63cf\u7801\uff0c\u4f46\u662f\u4ee5\u5b83\u4e3a\u53c2\u6570\u8c03\u7528handle_scancode\uff0c\u8be5\u626b\u63cf\u7801\u53ef\u4ee5\u81ea\u5df1\u5b9a\u4e49\uff0c\u4f46\u5b83\u5fc5\u987b\u60df\u4e00\u5730\u6807\u8bc6\u51fa\u88ab\u6309\u4e0b\u952e\u5728\u9f20\u6807\u4e0a\u7684\u4f4d\u7f6e\u3002\u636e\u6089\uff0c\u5f00\u53d1\u8005\u8fd8\u987b\u8981\u63d0\u4f9b\u5bf9\u5e94\u7684\u4ece\u81ea\u5b9a\u4e49\u626b\u63cf\u7801\u5230\u952e\u7801\u7684\u8f6c\u6362\u51fd\u6570kbd_translate\u3002\u5177\u4f53\u7684\u952e\u7801\u8f6c\u6362\uff0c\u5c06\u76ee\u6807\u7801\u653e\u5728\u7ec8\u7aef\u7684\u8f93\u5165\u7f13\u51b2\u533a\uff0c\u4ee5\u53ca\u56de\u663e\u7b49\u5de5\u4f5c\u90fd\u7531handle_scancode\u8d1f\u8d23\u5b8c\u6210\u3002\u5728\u6b64\u6211\u4eec\u4e5f\u53ef\u4ee5\u770b\u51fa\uff0c\u5185\u6838\u5bfc\u5165\u51fd\u6570handle_scancode\u5728\u6574\u4e2a\u6309\u952e\u9a71\u52a8\u7a0b\u5e8f\u4e2d\uff0c\u8d77\u7740\u5c06\u4e0b\u5c42\u901a\u7528\u5177\u8c61\u5c42\u548c\u5e95\u5c42\u786c\u4ef6\u5904\u7406\u5c42\u7c98\u548c\u4e0a\u53bb\u7684\u5173\u952e\u4f5c\u7528\u3002<\/p>\n \u5e94\u7528\u5b9e\u4f8b<\/p>\n <\/p>\n \u4e0b\u8fb9\u6211\u4eec\u5c06\u4ee5\u4e00\u4e2a\u5177\u4f53\u7684\u5e94\u7528\u5b9e\u4f8b\u6765\u8bf4\u660e\u5728\u5d4c\u5165\u5f0fLinux\u7cfb\u7edf\u4e2d\u7ed9\u4e00\u4e2a\u7279\u6b8a\u6309\u952e\u7f16\u64b0\u9a71\u52a8\u7a0b\u5e8f\u7684\u5177\u4f53\u8fc7\u7a0b\u3002<\/p>\n 1\u786c\u4ef6\u6a21\u5757\u63cf\u8ff0<\/p>\n \u672c\u7cfb\u7edf\u7684\u5efa\u7acb\u9009\u7528\u4e86\u4e09\u661f\u516c\u53f8\u7684S3C2410\u5f00\u53d1\u677f\u4f5c\u4e3a\u786c\u4ef6\u5e73\u53f0\u3002\u7279\u6b8a\u6309\u952e\u7684\u786c\u4ef6\u6a21\u5757\u4e3b\u8981\u7531\u4e24\u4e2aSN74hc164\u82af\u7247\u548c\u4e00\u4e2a4\u884c16\u5217\u7684\u77e9\u9635\u626b\u63cf\u7535\u8def\u6784\u6210\u3002SN74hc164\u662f\u4e00\u4e2a8\u4f4d\u7684\u4e32\u5f62\u8f93\u5165\u5e76\u5f62\u8f93\u51fa\u79fb\u4f4d\u5bc4\u5b58\u5668\uff0c\u5b83\u7684\u5185\u90e8\u75318\u4e2aD\u89e6\u53d1\u5668\u4e32\u8054\u800c\u6210\u3002\u5176\u5de5\u4f5c\u539f\u7406\u7b80\u5355\u8bf4\u6765\u662f\u8fd9\u6837\u7684\uff0cSN74hc164\u82af\u7247\u5728\u65f6\u949fCLK\u8109\u51b2\u7684\u4e0a\u5347\u6cbf\u5c06A\uff0cB\u5f15\u811a\u4e0a\u7684\u4e32\u5f62\u8f93\u5165\u57288\u4e2a\u65f6\u949f\u8109\u51b2\u4e4b\u540e\u5e76\u884c\u8f93\u51fa\u5230\u8f93\u51fa\u5f15\u811aQA\u5230QH\u3002\u5176\u771f\u503c\u8868\u89c1\u56fe1\u6240\u793a\u3002<\/p>\n \u4e24\u4e2aSN74hc164\u82af\u7247\u5148\u4e32\u8054\u540e\uff0c\u5c06\u5b83\u4eec\u7684CLK\u5f15\u811a\u548cCLR\u5f15\u811a\u5206\u522b\u63a5\u5230S3C2410\u5f00\u53d1\u677f\u7684GPB2\u548cGPB4\u7aef\u53e3\u4e0a\uff0c\u800c\u4e14\u5c06\u7b2c\u4e00\u4e2aSN74hc164\u82af\u7247\u7684A\uff0cB\u5f15\u811a\u63a5\u5230\u5f00\u53d1\u677f\u7684GPB1\u7aef\u53e3\u4e0a\uff0c\u8fd9\u4e09\u4e2aGPIO\u7aef\u53e3\u914d\u7f6e\u6210\u8f93\u51fa\u7aef\u53e3\u3002\u8fd9\u6837\u6211\u4eec\u5c31\u4f9d\u9760\u4e8e\u4e24\u4e2aSN74hc164\u5bc4\u5b58\u5668\uff0c\u5b9e\u73b0\u4e86\u53ea\u5360\u75283\u4e2aGPIO\u7aef\u53e3\uff0c\u7ed9\u77e9\u9635\u626b\u63cf\u7535\u8def\u768416\u5217\u63d0\u4f9b\u8f93\u5165\uff0c\u56e0\u800c\u65e2\u8282\u7701\u4e86\u6210\u672c\uff0c\u53c8\u675c\u7edd\u4e86GPIO\u8d44\u6e90\u7684\u6d6a\u8d39\u3002\u4f46\u8fd9\u540c\u65f6\u4e5f\u7ed9\u6309\u952e\u9a71\u52a8\u7a0b\u5e8f\u7684\u5b9e\u73b0\u5e26\u6765\u4e86\u4e00\u5b9a\u7684\u9ebb\u70e6\uff0c\u9a71\u52a8\u7a0b\u5e8f\u9996\u5148\u8981\u5c06SN74hc164\u9a71\u52a8\u4e0a\u53bb\uff0c\u4e4b\u540e\u624d\u4f1a\u5bf9\u77e9\u9635\u7535\u8def\u768416\u5217\u8fdb\u884c\u63a7\u5236\u3002\u8be5\u77e9\u9635\u7535\u8def\u76844\u4e2a\u884c\u5f15\u811a\u5206\u522b\u88ab\u63a5\u5230S3C2410\u7684GPG6\uff0cGPG7\uff0cGPG8\uff0cGPG9\u7aef\u53e3\u4e0a\uff0c\u4f46\u662f\u8fd9\u56db\u4e2a\u7aef\u53e3\u88ab\u914d\u7f6e\u6210\u4e2d\u65ad\u6e90\u3002\u65e0\u952e\u6309\u4e0b\u65f6\u76f4\u63a5\u8bfb\u4e3a\u9ad8\u7535\u4f4d\uff0c\u4f7f\u7528\u65f6\u901a\u8fc7SN74hc164\u82af\u7247\u5148\u5c06\u9f20\u6807\u768416\u5217\u7f6e\u4f4e\u7535\u4f4d\uff0c\u4efb\u4f55\u4e00\u4e2a\u952e\u88ab\u6309\u4e0b\uff0c\u76f8\u5e94\u7684\u884cGPG\u7aef\u53e3\u90fd\u4f1a\u6709\u4ece\u9ad8\u5230\u4f4e\u7684\u7535\u6d41\u8df3\u53d8\uff0c\u56e0\u800c\u89e6\u53d1\u4e00\u6b21\u4e2d\u65ad\u3002<\/p>\n <\/p>\n 2\u8f6f\u4ef6\u6a21\u5757\u63cf\u8ff0<\/p>\n \u521d\u59cb\u5316\u90e8\u4efd\u3002\u8fd9\u90e8\u4efd\u5305\u62ec\u786c\u4ef6\u5c42\u548c\u8f6f\u4ef6\u5c42\u4e0a\u7684\u521d\u59cb\u5316\u3002\u5728\u672c\u4f8b\u4e2d\uff0c\u987b\u8981\u5148\u5bf9\u77e9\u9635\u7535\u8def\u548cSN74hc164\u82af\u7247\u6240\u4f7f\u7528\u5230\u7684GPIO\u7aef\u53e3\u4f5c\u914d\u7f6e\uff0c\u4ee5\u4f7fCPU\u53ef\u4ee5\u5bf9\u5b83\u4eec\u8fdb\u884c\u63a7\u5236\u548c\u8bbf\u95ee\u3002\u4e3a\u4e86\u8981\u5c06\u67d0\u4e2aGPIO\u7aef\u53e3\u914d\u7f6e\u6210\u8f93\u5165\u8f93\u51fa\u6216\u5219\u662f\u4e2d\u65ad\u6e90\uff0c\u987b\u8981\u5728\u5bf9\u5e94\u7684GPIO\u63a7\u5236\u5bc4\u5b58\u5668\u4e2d\u8bbe\u7f6e\u6b63\u786e\u7684\u503c\uff0c\u5177\u4f53\u7684\u503c\u53ef\u4ee5\u901a\u8fc7\u67e5\u9605S3C2410\u5f00\u53d1\u677f\u6307\u5357\u6765\u83b7\u5f97\u3002\u4f8b\u5982\uff0c\u4e3a\u4e86\u5c06GPB1\u8bbe\u7f6e\u6210SN74hc164\u7684\u8f93\u5165\u7aef\uff0c\u987b\u8981\u5c06GPBCON\u8fd9\u4e2a\u63a7\u5236\u5b57\u4e2d2\uff0c3\u4e24\u4f4d\u8bbe\u7f6e\u6210\u4e8c\u8865\u7801\u768401\uff0c\u4e3a\u4e86\u5c06GPG6\u8bbe\u7f6e\u6210\u7535\u62ac\u9ad8\u8df3\u53d8\u4e2d\u65ad\u6e90\uff0c\u987b\u8981\u5c06GPGCON\u4e2d12\uff0c13\u4e24\u4f4d\u8bbe\u7f6e\u6210\u4e8c\u8865\u7801\u768410\u3002\u5728\u5b8c\u6210\u4e86\u786c\u4ef6\u521d\u59cb\u5316\u64cd\u4f5c\u4e4b\u540e\uff0c\u5c31\u662f\u8f6f\u4ef6\u5c42\u4e0a\u7684\u521d\u59cb\u5316\u4e86\u3002\u9996\u5148\u5c06\u9f20\u6807\u4e2d\u65ad\u5904\u7406\u51fd\u6570\u6ce8\u518c\u5230\u7cfb\u7edf\uff0c\u4e4b\u540e\u8bbe\u7f6e\u597d\u4e00\u4e2a\u5b9a\u65f6\u5668\u7ed3\u6784\uff0c\u4fbf\u4e8e\u5728\u4e2d\u65ad\u53d1\u751f\u65f6\u5c06\u5176\u6302\u5230\u5185\u6838\u7684\u5b9a\u65f6\u5668\u961f\u5217\u4e2d\u53bb\uff0c\u8be5\u5b9a\u65f6\u5668\u5c06\u89e6\u53d1\u5bf9\u6309\u952e\u7684\u626b\u63cf\u64cd\u4f5c\u3002\u6700\u540e\u901a\u8fc7SN74hc164\u5c06\u77e9\u9635\u7535\u8def\u768416\u5217\u7f6e\u96f6\u3002<\/p>\n \u4e2d\u65ad\u5904\u7406\u90e8\u4efd\u3002\u5982\u524d\u6240\u8ff0\uff0c\u8fd9\u90e8\u4efd\u8f6f\u4ef6\u5e94\u5f53\u5b8c\u6210\u7684\u5de5\u4f5c\u5c31\u662f\u626b\u63cf\u7279\u6b8a\u6309\u952e\uff0c\u786e\u5b9a\u90a3\u4e2a\u952e\u88ab\u6309\u4e0b\uff0c\u4f46\u662f\u9886\u5230\u7a33\u5b9a\u7684\u626b\u63cf\u7801linux \u5220\u9664\u6587\u4ef6\uff0c\u4e4b\u540e\u8c03\u7528\u5185\u6838\u5bfc\u5165\u51fd\u6570handle_scancode\u3002\u5728\u8fd9\u4e2a\u5e94\u7528\u4e2d\uff0c\u8be5\u7279\u6b8a\u6309\u952e\u7684\u5e03\u5c40\u4e0ePC\u6807\u51c6\u6309\u952e\u7684\u5e03\u5c40\u6bd4\u8f83\u76f8\u50cf\uff0c\u6240\u4ee5\u6211\u4eec\u76f4\u63a5\u5c06PC\u9f20\u6807\u4e0a\u5bf9\u5e94\u952e\u7684\u7cfb\u7edf\u626b\u63cf\u7801\u4f5c\u4e3a\u6211\u4eec\u7279\u6b8a\u6309\u952e\u4e0a\u5404\u4e2a\u952e\u7684\u626b\u63cf\u7801\uff0c\u540c\u65f6\u6211\u4eec\u5c06PC\u9f20\u6807\u9a71\u52a8\u7a0b\u5e8f\u4e2d\u626b\u63cf\u7801\u5230\u952e\u7801\u7684\u8f6c\u6362\u51fd\u6570pckbd_translate\u4f5c\u4e3a\u6211\u4eec\u7684kbd_translate\u51fd\u6570\u3002<\/p>\n \u786e\u5b9a\u54ea\u4e00\u4e2a\u952e\u88ab\u6309\u4e0b\u7684\u7b97\u6cd5\u5982\u4e0b\u3002\u5728\u4e2d\u65ad\u5230\u6765\u65f6\uff0c\u6211\u4eec\u65e9\u5df2\u53ef\u4ee5\u6309\u7167\u4e2d\u65ad\u53f7\u786e\u5b9a\u88ab\u6309\u4e0b\u7684\u952e\u5728\u54ea\u4e00\u884c\uff0c\u6211\u4eec\u8fd8\u987b\u8981\u786e\u5b9a\u88ab\u6309\u4e0b\u7684\u952e\u5728\u54ea\u4e00\u5217\u3002\u56e0\u6b64\uff0c\u6211\u4eec\u5148\u7ed9\u4e32\u8054\u7684\u4e24\u4e2aSN74hc164\u82af\u7247\u9001\u4e00\u4e2aCLR\u8baf\u53f7\uff0c\u6e05\u96f6\uff0c\u4e4b\u540e\u900116\u4e2a1\uff0c\u4fc3\u4f7f\u7279\u6b8a\u6309\u952e\u7684\u5217\u5747\u4e3a\u9ad8\u7535\u4f4d\uff0c\u6b64\u65f6\u6211\u4eec\u5728\u9f20\u6807\u7684\u884c\u7aef\u53e3\u8bfb\u5230\u7684\u90fd\u662f\u9ad8\u7535\u4f4d\u3002\u572816\u4e2a\u65f6\u949f\u8109\u51b2\u4e0b\uff0c\u7ed9SN74hc164\u82af\u7247\u9001\u51651\u4e2a0\u548c15\u4e2a1\uff0c\u81f4\u4f7f0\u5728\u6bcf\u4e00\u5217\u4e0a\u90fd\u60df\u4e00\u51fa\u73b0\u4e00\u6b21\uff0c\u4e8e\u6b64\u540c\u65f6\u5728\u9f20\u6807\u884c\u7aef\u53e3\u8fdb\u884c\u626b\u63cf\u3002\u5f53\u88ab\u6309\u4e0b\u952e\u6240\u5728\u5217\u7f6e0\u65f6\uff0c\u5176\u6240\u5728\u884c\u90fd\u4f1a\u8bfb\u5230\u4e00\u4e2a\u4f4e\u7535\u4f4d\u3002\u4f7f\u7528\u8fd9\u4e9b\u201c\u8d700\u6cd5\u201d\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u786e\u5b9a\u51fa\u6309\u952e\u4e0a\u90a3\u4e2a\u952e\u88ab\u6309\u4e0b\u4e86\u3002\u5e76\u4e14\u8fd9\u4e9b\u7b80\u5355\u7684\u626b\u63cf\u7b97\u6cd5\u8fd8\u4e0d\u591f\uff0c\u7531\u4e8e\u5728\u8fd9\u79cd\u7c7b\u578b\u7684\u77e9\u9635\u626b\u63cf\u9f20\u6807\u4e2d\uff0c\u952e\u7684\u6bcf\u6b21\u6309\u4e0b\u548c\u4e3e\u8d77\u5c31\u4f1a\u670910~20ms\uff08\u8fd9\u6bb5\u65f6\u95f4\u7684\u957f\u77ed\u7531\u786c\u4ef6\u7279\u70b9\u51b3\u5b9a\uff09\u7684\u6bdb\u523a\u6643\u52a8\u5b58\u5728\uff0c\u5982\u56fe2\u6240\u793a\uff0c\u6240\u4ee5\u4e3a\u4e86\u83b7\u53d6\u7a33\u5b9a\u7684\u952e\u76d8\u4fe1\u606f\uff0c\u5fc5\u9700\u8981\u60f3\u529e\u6cd5\u53bb\u9664\u8fd9\u4e9b\u6643\u52a8\uff0c\u80fd\u591f\u9632\u6b62\u5c06\u7528\u6237\u7684\u4e00\u6b21\u6309\u94ae\u8bef\u5f53\u6210\u51e0\u6b21\u6309\u94ae\u6765\u5904\u7406\u3002\u53bb\u6bdb\u523a\u7684\u4e00\u79cd\u5e38\u89c1\u7684\u65b9\u5f0f\u662f\u5728\u6709\u6309\u952e\u4e2d\u65ad\u62b5\u8fbe\u65f6\uff0c\u5e76\u4e0d\u7acb\u523b\u53bb\u626b\u63cf\u6309\u952e\uff0c\u800c\u662f\u5148\u7b49\u5f85\u4e00\u6bb5\u65f6\u95f4\uff0c\u7b49\u8df3\u8fc7\u6bdb\u523a\u6643\u52a8\u4e4b\u540e\u518d\u53bb\u626b\u63cf\u6309\u952e\uff0c\u5176\u4f2a\u4ee3\u7801\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n \u7b49\u5f85\u4e00\u6bb5\u65f6\u95f4\uff0c\u8df3\u8fc7\u6643\u52a8\uff1b<\/p>\n \u626b\u63cf\u6309\u952e\uff1b<\/p>\n if\u6309\u952e\u4e0a\u6ca1\u6709\u952e\u88ab\u6309\u4e0b<\/p>\n \u7ed3\u675f\u8fd4\u56de\uff1b<\/p>\n if\u6309\u952e\u4e0a\u6709\u952e\u88ab\u6309\u4e0b<\/p>\n \u518d\u5ea6\u7b49\u5f85\u4e00\u6bb5\u65f6\u95f4\u4e4b\u540e\u68c0\u6d4b\u540c\u6837\u7684\u952e\u662f\u5426\u4ecd\u7136\u5904\u4e8e\u88ab\u6309\u4e0b\u72b6\u6001\uff1b<\/p>\n if\u540c\u6837\u7684\u952e\u4efb\u7136\u662f\u6309\u4e0b<\/p>\n \u5c06\u8bfb\u5230\u7684\u626b\u63cf\u7801\u8fd4\u56de\uff1b<\/p>\n else<\/p>\n \u76f4\u63a5\u8fd4\u56de\uff1b<\/p>\n \u8fd9\u4e9b\u89e3\u51b3\u65b9\u6848\u5c1a\u4e14\u53ef\u884c\uff0c\u800c\u4e14\u5b83\u4f7f\u7528\u4e86\u5fd9\u7b49\u7684\u65b9\u5f0f\u53bb\u6bdb\u523a\uff0c\u5728\u5fd9\u7b49\u671f\u95f4\uff0c\u7cfb\u7edf\u505a\u4e0d\u4e86\u4efb\u4f55\u6709\u7528\u7684\u5de5\u4f5c\u3002\u8fd9\u5bf9\u4e8e\u4f30\u7b97\u8d44\u6e90\u672c\u8eab\u5c31\u5f88\u6709\u9650\u7684\u5d4c\u5165\u5f0fLinux\u7cfb\u7edf\u6765\u8bf4\uff0c\u662f\u4e00\u79cd\u5962\u534e\u7684\u6d6a\u8d39\u3002\u672c\u5e94\u7528\u4e2d\uff0c\u6211\u4eec\u8bbe\u8ba1\u4e86\u4e00\u79cd\u9002\u5b9c\u5d4c\u5165\u5f0f\u7cfb\u7edf\u7684\u53bb\u6bdb\u523a\u89e3\u51b3\u65b9\u6848\uff0c\u4f7f\u7528\u7597\u6548\u826f\u597d\u3002<\/p>\n \u56e0\u4e3aLinux\u5185\u6838\u63d0\u4f9b\u4e86\u5b9a\u65f6\u5668\u961f\u5217\uff0c\u6240\u4ee5\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u8fd9\u4e9b\u673a\u5236\u6765\u9632\u6b62\u5fd9\u7b49\uff0c\u63d0\u5347\u7cfb\u7edf\u7684\u6027\u80fd\u3002\u5f53\u6309\u952e\u4e0a\u6709\u952e\u88ab\u6309\u4e0b\u65f6\uff0c\u9f20\u6807\u4e2d\u65ad\u5904\u7406\u7a0b\u5e8f\u9996\u5148\u5173\u6389\u4e2d\u65ad\u6e90\uff0c\u6b65\u5165\u5bfb\u5740\u6a21\u5f0f\uff0c\u5c06\u4e00\u4e2atimerlist\u5bf9\u8c61\u6302\u6253\u5750\u65f6\u5668\u961f\u5217\u4e4b\u540e\u5c31\u7ed3\u675f\u4e86\u3002\u6302\u5165\u5185\u6838\u7684\u5b9a\u65f6\u5668\u6309\u91cf\u5730\u88ab\u89e6\u53d1\uff0c\u5b83\u6240\u89e6\u53d1\u7684\u51fd\u6570\u5b8c\u6210\u4ee5\u4e0b\u4e00\u4e9b\u5de5\u4f5c\uff1a\u5148\u5bf9\u6574\u4e2a\u6309\u952e\u4e0a\u6240\u6709\u7684\u952e\u8fdb\u884c\u4e00\u6b21\u626b\u63cf\uff0c\u800c\u4e14\u5c06\u626b\u63cf\u5f97\u5230\u7684\u7ed3\u679c\u4fdd\u5b58\u5230\u4e00\u4e2a\u9759\u60012\u7ef4\u5b57\u6bb5\u53d8\u91cfsnap_shot_matrix\uff3b16\uff3d\uff3b4\uff3d\u4e2d\u3002\u8be5\u53d8\u91cf\u63cf\u8ff0\u7684\u662f\u5728\u672c\u6b21\u6309\u952e\u626b\u63cf\u7684\u8fd9\u4e2a\u65f6\u523b\uff0c\u6309\u952e\u4e0a\u6240\u6709\u952e\u7684\u6309\u4e0b\u60c5\u51b5\u3002\u5047\u5982\u67d0\u4e2a\u952e\u6ca1\u6709\u88ab\u6309\u4e0b\uff0c\u5373\u5904\u4e8e\u62ac\u8d77\u72b6\u6001\uff0c\u8fd9\u4e48\u5c06snap_shot_matrix\u4e2d\u5bf9\u5e94\u7684\u503c\u7f6e\u4e3a0\uff0c\u5047\u5982\u67d0\u4e2a\u952e\u5904\u4e8e\u6309\u4e0b\u72b6\u6001\uff0c\u8fd9\u4e48\u5c06snap_shot_matrix\u4e2d\u5bf9\u5e94\u7684\u503c\u4f5c\u81ea\u589e1\u64cd\u4f5c\uff0c\u82e5\u8be5\u503c\u5728\u81ea\u589e1\u4e4b\u540e\u5c0f\u4e8e\u67d0\u4e2a\u9884\u5148\u6307\u5b9a\u7684\u6570\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u89c9\u5f97\u8fd9\u662f\u4e00\u4e2a\u7a33\u5b9a\u503c\uff0c\u800c\u4e14\u5c06\u53e6\u4e00\u4e2a\u5927\u5c0f\u4e3a16*4\u76842\u7ef4\u5b57\u6bb5\u53d8\u91cfcurrent_matrix\u5bf9\u5e94\u5ea7\u6807\u4e2d\u7684\u503c\u7f6e1\uff0c\u5426\u5219\u7f6e0\u3002\u8fd9\u4e2a\u53d8\u91cf\u63cf\u8ff0\u7684\u5c31\u662f\u5f53\u524d\u6309\u952e\u4e0a\u952e\u76d8\u60c5\u51b5\u7684\u7a33\u5b9a\u503c\u4e86\u3002\u4e5f\u5c31\u662f\u8bf4\u6211\u4eec\u9996\u5148\u628a\u5728\u672c\u6b21\u626b\u63cf\u4e2d\u5f97\u5230\u7684\u53d6\u6837\u6570\u636e\u4f5c\u5904\u7406\u4e4b\u540e\u4fdd\u5b58\u5230snap_shot_matrix\u4e2d\uff0c\u4e4b\u540e\u6839\u636e\u8be5\u53d8\u91cf\u4e2d\u7684\u503c\uff0c\u8fc7\u6ee4\u5f97\u5230current_matrix\uff0c\u901a\u8fc7\u8fd9\u6837\u4e00\u4e2a\u8fc7\u7a0b\u6765\u505a\u53bb\u6bdb\u523a\u5904\u7406\u3002\u5728\u5f97\u5230\u4e86\u672c\u6b21\u626b\u63cf\u7684\u7a33\u5b9a\u503ccurrent_matrix\u4e4b\u540e\uff0c\u6211\u4eec\u5c06\u5176\u4e0e\u5148\u524d\u5f97\u5230\u7684\u7a33\u5b9a\u503cprevious_matrix\u4f5c\u6bd4\u8f83\uff0c\u8fdb\u800c\u786e\u5b9a\u4e0e\u5148\u524d\u626b\u63cf\u65f6\u76f8\u6bd4\uff0c\u6b64\u523b\u6309\u952e\u4e0a\u7684\u6309\u94ae\u60c5\u51b5\u662f\u5426\u53d1\u751f\u4e86\u53d8\u5316\uff0c\u4ee5\u53ca\u6b64\u523b\u6309\u952e\u4e0a\u662f\u5426\u6709\u952e\u6309\u4e0b\u3002\u5047\u5982\u53d1\u89c9\u6309\u952e\u4e0a\u6ca1\u6709\u4efb\u4f55\u952e\u88ab\u6309\u4e0b\uff0c\u5219\u6253\u5f00\u6309\u952e\u4e2d\u65ad\uff0c\u518d\u5ea6\u5207\u56de\u5230\u4e2d\u65ad\u6a21\u5f0f\u3002\u5047\u5982\u6309\u952e\u4e0a\u6709\u952e\u88ab\u6309\u4e0b\uff0c\u800c\u4e14\u662f\u4e0d\u540c\u4e8e\u5148\u524d\u626b\u63cf\u5230\u7684\u88ab\u6309\u4e0b\u952e\uff0c\u6211\u4eec\u7acb\u5373\u8c03\u7528\u952e\u76d8\u5904\u7406\u51fd\u6570process_key\uff0c\u5b83\u4f1a\u8c03\u7528\u6309\u952e\u9a71\u52a8\u4e2d\u7684\u4e0b\u5c42\u51fd\u6570handle_scancode\u3002\u5047\u5982\u6309\u952e\u4e0a\u6309\u4e0b\u7684\u952e\u5c31\u662f\u5148\u524d\u6309\u4e0b\u7684\u90a3\u79cd\u952e\uff0c\u6211\u4eec\u5c06\u9012\u589e\u4e00\u4e2a\u8ba1\u6570\u5668\uff0c\u5f53\u8fd9\u4e2a\u8ba1\u6570\u5668\u8fbe\u5230\u67d0\u4e2a\u6307\u5b9a\u503c\u4e4b\u540e\uff0c\u6211\u4eec\u5c31\u542f\u52a8\u6240\u8c13\u7684Autorepeat\u529f\u80fd\uff0c\u5373\u7528\u6237\u4ecd\u7136\u6309\u7740\u67d0\u4e2a\u952e\uff0c\u9a71\u52a8\u7a0b\u5e8f\u624b\u52a8\u91cd\u590d\u5f62\u6210\u6309\u952e\u8f93\u5165\u3002\u8be5\u8ba1\u6570\u5668\u5728\u88ab\u6309\u4e0b\u952e\u53d1\u751f\u53d8\u5316\u65f6\u7f6e0\u3002\u5e76\u4e14\u53ea\u8981\u6309\u952e\u4e0a\u4f9d\u7136\u6709\u952e\u5904\u4e8e\u88ab\u6309\u4e0b\u72b6\u6001\uff0c\u6211\u4eec\u5c31\u5c06\u5f53\u524d\u8bfb\u5230\u7684\u6309\u952e\u7a33\u5b9a\u503ccurrent_matrix\u62f7\u8d1d\u5230previous_matrix\u4e2d\u53bb\uff0c\u4f46\u662f\u518d\u5ea6\u5c06\u4e0a\u9762\u63cf\u8ff0\u7684\u5b9a\u65f6\u5668\u5bf9\u8c61\u6302\u5230\u5185\u6838\u5b9a\u65f6\u5668\u961f\u5217\u4e2d\uff0c\u8fc7\u4e00\u6bb5\u65f6\u95f4\u4e4b\u540e\u518d\u5ea6\u626b\u63cf\u6574\u4e2a\u6309\u952elinux\u6309\u952e\u9a71\u52a8<\/strong>\uff0c\u76f4\u5230\u6309\u952e\u4e0a\u6ca1\u6709\u952e\u88ab\u6309\u4e0b\u3002<\/p>\n \u7ed3\u675f\u8bed<\/p>\n \u968f\u7740\u4fe1\u606f\u793e\u4f1a\u4ee5\u53ca\u8ba1\u7b97\u673a\u8f6f\u786c\u4ef6\u6280\u672f\u7684\u8fdb\u6b65\uff0c\u5d4c\u5165\u5f0f\u4fe1\u606f\u4ea7\u54c1\u7684\u8bbe\u8ba1\u548c\u5e94\u7528\u5f97\u5230\u4e86\u8fc5\u901f\u7684\u53d1\u5c55\uff0c\u987b\u8981\u4e3a\u81ea\u5df1\u7684\u5d4c\u5165\u5f0fLinux\u7cfb\u7edf\u6dfb\u52a0\u7279\u6b8a\u6309\u952e\u9a71\u52a8\u7684\u9700\u6c42\u4e5f\u8d8a\u6765\u8d8a\u666e\u904d\u3002\u672c\u6587\u5728\u4ecb\u7ecd\u4e86Linux\u4e2d\u6309\u952e\u9a71\u52a8\u7a0b\u5e8f\u7684\u6574\u4f53\u6846\u67b6\u4e4b\u540e\uff0c\u4ee5S3C2410\u5f00\u53d1\u677f\u4e0a\u7684\u4e00\u4e2a\u7279\u6b8a\u6309\u952e\u4e3a\u53cd\u4f8b\uff0c\u91cd\u70b9\u63cf\u8ff0\u4e86\u5728\u5d4c\u5165\u5f0fLinux\u73af\u5883\u4e0b\uff0c\u4e3a\u7279\u6b8a\u6309\u952e\u7f16\u64b0\u9a71\u52a8\u7a0b\u5e8f\u65f6\u987b\u8981\u5b8c\u6210\u7684\u5de5\u4f5c\uff0c\u4e3a\u7c7b\u4f3c\u7684\u5f00\u53d1\u63d0\u4f9b\u4e86\u4e00\u79cd\u601d\u8def\u548c\u53c2\u8003\u3002<\/p>\n","protected":false},"excerpt":{"rendered":" \u5f88\u591a\u5d4c\u5165\u5f0fLinux\u7cfb\u7edf\uff0c\u7279\u522b\u662f\u4e00\u4e9b\u5177\u6709\u4e0e\u7528\u6237\u5f3a\u4ea4\u4e92\u7684\u5d4c\u5165\u5f0f\u7cfb\u7edf\uff0c\u5f80\u5f80\u9700\u8981\u914d\u5907\u4e00\u4e2a\u7279\u6b8a\u952e\u76d8\uff0c\u6b64\u65f6\u5f00\u53d1\u8005\u9700\u8981\u6839\u636e\u5b9e\u9645\u60c5\u51b5\uff0c\u4e3a\u81ea\u5df1\u7684\u7279\u6b8a\u952e\u76d8\u7f16\u5199\u9a71\u52a8\u7a0b\u5e8f\u3002\u4e0b\u9762\u6211\u4eec\u5c06\u4ee5\u4e00\u4e2a\u5177\u4f53\u7684\u5e94\u7528\u5b9e\u4f8b\u6765\u8bf4\u660e\u5728\u5d4c\u5165\u5f0fLinux\u7cfb\u7edf\u4e2d\u7ed9\u4e00\u4e2a\u7279\u6b8a\u952e\u76d8\u7f16\u5199\u9a71\u52a8\u7a0b\u5e8f\u7684\u5177\u4f53\u8fc7\u7a0b\u3002<\/p>\n","protected":false},"author":1,"featured_media":281386,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-281385","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/281385","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=281385"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/281385\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/281386"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=281385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=281385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=281385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}