{"id":9060,"date":"2023-09-03T08:00:00","date_gmt":"2023-09-03T11:00:00","guid":{"rendered":"https:\/\/felipemateus.com\/?p=9060"},"modified":"2025-12-09T20:41:08","modified_gmt":"2025-12-09T23:41:08","slug":"sonoff-keyboard-key-reuse-background","status":"publish","type":"post","link":"https:\/\/felipemateus.com\/en\/blog\/2023\/09\/sonoff-keyboard-key-reuse-background","title":{"rendered":"sonoff: Keyboard key reuse \u2013 Part 2"},"content":{"rendered":"<p class=\"wp-block-paragraph\">Some time ago I wrote <a href=\"https:\/\/felipemateus.com\/en\/blog\/2021\/11\/sonoff-keyboard-key-reuse\">a text talking about a sonoff software I made<\/a> to replace a notebook key that had no use. However, I owed a version 2 of the project running in the background, this is the objective of this new project.&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before starting to explain more about the sonoff program, you must be wondering why I&#039;m making a version 2? This program is very useful for me because I can turn the light on and off without taking my hand off the computer keyboard.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-text-align-center\">Starting the Sonoff Project<\/h2>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\">There are some differences between this and another project, not only in the way it works but also in the operating system built into the software. As you can see in the previous project, the system was Windows 10, now I&#039;m using<a href=\"https:\/\/pop.system76.com\/\"> Pop Os<\/a>.<\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\">First of all I tried to create the new version based on<a href=\"https:\/\/felipemateus.com\/en\/blog\/2021\/11\/sonoff-keyboard-key-reuse\"> previous project<\/a> however, I encountered some difficulties such as: lib outdated, slowness in the execution of the application and the fact that it generated several files to generate the binary.<\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\">All these python limitations were bothering me a little, so I decided to research in other languages a way to make this project better.&nbsp;<\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\">Then I looked in Rust and I didn&#039;t get much success until I found a lib in golang that did exactly what it did in python besides promising access to private keys that didn&#039;t work.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-text-align-center\">How the sonoff project works<\/h2>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\">The program, run in the background of the computer as a service, maintains an always active connection with sonoff <a href=\"http:\/\/ewelink.cc\">ewelink.cc<\/a> So this makes it run much faster than the previous program.&nbsp;<\/p>\n\n\n\n<figure class=\"wp-block-image alignwide size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"514\" src=\"https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2023\/09\/terminal_servico-1024x514.png\" alt=\"Linux terminal with service running sonoff service. \" class=\"wp-image-9061\" srcset=\"https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2023\/09\/terminal_servico-1024x514.png 1024w, https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2023\/09\/terminal_servico-300x151.png 300w, https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2023\/09\/terminal_servico-768x386.png 768w, https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2023\/09\/terminal_servico-1536x771.png 1536w, https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2023\/09\/terminal_servico-18x9.png 18w, https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2023\/09\/terminal_servico-150x75.png 150w, https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2023\/09\/terminal_servico.png 1920w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Image 1: shows terminal with service running]<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">To turn the light off or on, press the keys <strong>Ctrl + Alt + num0 <\/strong>so it does not depend on the operating system shortcut to execute it is implemented directly in the program.&nbsp;<\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\">However it is possible to install only on Linux I did not make the version of this program compatible with Windows different from the previous program.<\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\">The program issues a notification at each execution of the command, indicating the current status of the changed lamp.<\/p>\n\n\n\n<figure class=\"wp-block-image alignwide size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"561\" height=\"600\" src=\"https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2023\/09\/notificacoes.png\" alt=\"Image shows program notifications. \" class=\"wp-image-9063\" srcset=\"https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2023\/09\/notificacoes.png 561w, https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2023\/09\/notificacoes-281x300.png 281w, https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2023\/09\/notificacoes-11x12.png 11w, https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2023\/09\/notificacoes-150x160.png 150w\" sizes=\"auto, (max-width: 561px) 100vw, 561px\" \/><figcaption class=\"wp-element-caption\">Image 2: Shows notifications of the running program.<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading has-text-align-center\"><strong>Creation Challenges<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The main challenge of this version was trying to capture the keys that are pressed using the hotkey lib, but it was not possible. So I searched the internet for another lib that ended up working, but if I want to capture a special key, like in the previous project, I&#039;ll have a hard time.<\/p>\n\n\n\n<p class=\"has-text-align-justify wp-block-paragraph\">Another thing that I got stuck was when creating the service, I was creating the service in system mode, so he was not able to see the x11 settings that are necessary for the hotkey. However, searching the internet I managed to solve this problem until quickly.<\/p>\n\n\n\n<h2 class=\"wp-block-heading has-text-align-center\">Technologies Used<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>golang<\/li>\n\n\n\n<li><a href=\"http:\/\/github.com\/gen2brain\/beeep\">beep<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/github.com\/NicklasWallgren\/ewelink\">ewelink go<\/a><\/li>\n\n\n\n<li><a href=\"http:\/\/github.com\/robotn\/gohook\">gohook<\/a><\/li>\n<\/ul>\n\n\n\n<div class=\"wp-block-buttons is-content-justification-center is-layout-flex wp-container-core-buttons-is-layout-fe48e5de wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link has-text-align-center wp-element-button\" href=\"http:\/\/github.com\/eufelipemateus\/sonoff-bottao-background\" target=\"_blank\" rel=\"noreferrer noopener\">Project on Github<\/a><\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>This project is part of the second part of the &#039;Keyboard Key Reuse&#039; project. In it, I develop a program that allows you to turn the light on and off using a keyboard shortcut. In this new version, the program runs as a background service.<\/p>","protected":false},"author":2,"featured_media":3727,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"googlesitekit_rrm_CAowhPjFCw:productID":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"federated","footnotes":"","jetpack_publicize_message":"Ol\u00e1, pessoal!\n\nSegue a parte 2 do meu projeto para facilitar o desligamento\/ligamento com o teclado est\u00e1 pronta. Agora, o programa \u00e9 executado em segundo plano.\n\nComente, Curta e Compartilha. \n\nObrigado!","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[2],"tags":[1609,1094,1622,1053],"class_list":["post-9060","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-projetos","tag-go","tag-iot","tag-linux","tag-programacao"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>sonoff: Reutiliza\u00e7\u00e3o de tecla do teclado - Parte 2 - Felipe Mateus @felipemateus<\/title>\n<meta name=\"description\" content=\"Felipe Mateus - sonoff: Reutiliza\u00e7\u00e3o de tecla do teclado - Parte 2 ; Este \u00e9 uma continua\u00e7\u00e3o do projeto anterior afim de executar em background\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/felipemateus.com\/en\/blog\/2023\/09\/sonoff-keyboard-key-reuse-background\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"sonoff: Reutiliza\u00e7\u00e3o de tecla do teclado - Parte 2 - Felipe Mateus @felipemateus\" \/>\n<meta property=\"og:description\" content=\"Felipe Mateus - sonoff: Reutiliza\u00e7\u00e3o de tecla do teclado - Parte 2 ; Este \u00e9 uma continua\u00e7\u00e3o do projeto anterior afim de executar em background\" \/>\n<meta property=\"og:url\" content=\"https:\/\/mundoazul.blog\/2023\/09\/sonoff-reutilizacao-de-tecla-do-teclado-background\" \/>\n<meta property=\"og:site_name\" content=\"Felipe Mateus\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/eufelipemateus\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/eufelipemateus\" \/>\n<meta property=\"article:published_time\" content=\"2023-09-03T11:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-12-09T23:41:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2021\/11\/iot-gb3efe58db_1920.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1280\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Felipe Mateus\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@eufelipemateus\" \/>\n<meta name=\"twitter:site\" content=\"@eufelipemateus\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Felipe Mateus\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":[\"Article\",\"BlogPosting\"],\"@id\":\"https:\\\/\\\/felipemateus.com\\\/blog\\\/2023\\\/09\\\/sonoff-reutilizacao-de-tecla-do-teclado-background#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/felipemateus.com\\\/blog\\\/2023\\\/09\\\/sonoff-reutilizacao-de-tecla-do-teclado-background\"},\"author\":{\"name\":\"Felipe Mateus\",\"@id\":\"https:\\\/\\\/felipemateus.com\\\/#\\\/schema\\\/person\\\/5ca2279426b9f93497fbf68a6e2577b6\"},\"headline\":\"sonoff: Reutiliza\u00e7\u00e3o de tecla do teclado &#8211; Parte 2\",\"datePublished\":\"2023-09-03T11:00:00+00:00\",\"dateModified\":\"2025-12-09T23:41:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/felipemateus.com\\\/blog\\\/2023\\\/09\\\/sonoff-reutilizacao-de-tecla-do-teclado-background\"},\"wordCount\":502,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/felipemateus.com\\\/#\\\/schema\\\/person\\\/5ca2279426b9f93497fbf68a6e2577b6\"},\"image\":{\"@id\":\"https:\\\/\\\/felipemateus.com\\\/blog\\\/2023\\\/09\\\/sonoff-reutilizacao-de-tecla-do-teclado-background#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/felipemateus.com\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/iot-gb3efe58db_1920.jpg\",\"keywords\":[\"go\",\"iot\",\"linux\",\"Programa\u00e7\u00e3o\"],\"articleSection\":[\"Projetos\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/felipemateus.com\\\/blog\\\/2023\\\/09\\\/sonoff-reutilizacao-de-tecla-do-teclado-background#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/felipemateus.com\\\/blog\\\/2023\\\/09\\\/sonoff-reutilizacao-de-tecla-do-teclado-background\",\"url\":\"https:\\\/\\\/felipemateus.com\\\/blog\\\/2023\\\/09\\\/sonoff-reutilizacao-de-tecla-do-teclado-background\",\"name\":\"sonoff: Reutiliza\u00e7\u00e3o de tecla do teclado - Parte 2 - Felipe Mateus @felipemateus\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/felipemateus.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/felipemateus.com\\\/blog\\\/2023\\\/09\\\/sonoff-reutilizacao-de-tecla-do-teclado-background#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/felipemateus.com\\\/blog\\\/2023\\\/09\\\/sonoff-reutilizacao-de-tecla-do-teclado-background#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/felipemateus.com\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/iot-gb3efe58db_1920.jpg\",\"datePublished\":\"2023-09-03T11:00:00+00:00\",\"dateModified\":\"2025-12-09T23:41:08+00:00\",\"description\":\"Felipe Mateus - sonoff: Reutiliza\u00e7\u00e3o de tecla do teclado - Parte 2 ; Este \u00e9 uma continua\u00e7\u00e3o do projeto anterior afim de executar em background\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/felipemateus.com\\\/blog\\\/2023\\\/09\\\/sonoff-reutilizacao-de-tecla-do-teclado-background#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/felipemateus.com\\\/blog\\\/2023\\\/09\\\/sonoff-reutilizacao-de-tecla-do-teclado-background\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/felipemateus.com\\\/blog\\\/2023\\\/09\\\/sonoff-reutilizacao-de-tecla-do-teclado-background#primaryimage\",\"url\":\"https:\\\/\\\/felipemateus.com\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/iot-gb3efe58db_1920.jpg\",\"contentUrl\":\"https:\\\/\\\/felipemateus.com\\\/wp-content\\\/uploads\\\/2021\\\/11\\\/iot-gb3efe58db_1920.jpg\",\"width\":1920,\"height\":1280,\"caption\":\"Imagem de Pixabay\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/felipemateus.com\\\/blog\\\/2023\\\/09\\\/sonoff-reutilizacao-de-tecla-do-teclado-background#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"In\u00edcio\",\"item\":\"https:\\\/\\\/felipemateus.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Projetos\",\"item\":\"https:\\\/\\\/felipemateus.com\\\/blog\\\/topicos\\\/projetos\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"sonoff: Reutiliza\u00e7\u00e3o de tecla do teclado &#8211; Parte 2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/felipemateus.com\\\/#website\",\"url\":\"https:\\\/\\\/felipemateus.com\\\/\",\"name\":\"Felipe Mateus @felipemateus\",\"description\":\"Seja Bem-Vindo ao meu mundo azul.\",\"publisher\":{\"@id\":\"https:\\\/\\\/felipemateus.com\\\/#\\\/schema\\\/person\\\/5ca2279426b9f93497fbf68a6e2577b6\"},\"alternateName\":\"eufelipemateus\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/felipemateus.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/felipemateus.com\\\/#\\\/schema\\\/person\\\/5ca2279426b9f93497fbf68a6e2577b6\",\"name\":\"Felipe Mateus Rocha Martins\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/felipemateus.com\\\/wp-content\\\/uploads\\\/2023\\\/04\\\/FELIPE-2-1024x1024.png\",\"url\":\"https:\\\/\\\/felipemateus.com\\\/wp-content\\\/uploads\\\/2023\\\/04\\\/FELIPE-2-1024x1024.png\",\"contentUrl\":\"https:\\\/\\\/felipemateus.com\\\/wp-content\\\/uploads\\\/2023\\\/04\\\/FELIPE-2-1024x1024.png\",\"width\":1024,\"height\":1024,\"caption\":\"Felipe Mateus\"},\"sameAs\":[\"https:\\\/\\\/felipemateus.com\",\"https:\\\/\\\/www.facebook.com\\\/eufelipemateus\",\"https:\\\/\\\/www.instagram.com\\\/eufelipemateus\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/eufelipemateus\\\/\",\"https:\\\/\\\/x.com\\\/eufelipemateus\",\"https:\\\/\\\/github.com\\\/eufelipemateus\",\"https:\\\/\\\/soundcloud.com\\\/eufelipemateus\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Sonoff: Keyboard Key Reuse - Part 2 - Felipe Mateus @felipemateus","description":"Felipe Mateus - sonoff: Keyboard key reuse - Part 2 ; This is a continuation of the previous project in order to run in the background","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/felipemateus.com\/en\/blog\/2023\/09\/sonoff-keyboard-key-reuse-background","og_locale":"en_US","og_type":"article","og_title":"sonoff: Reutiliza\u00e7\u00e3o de tecla do teclado - Parte 2 - Felipe Mateus @felipemateus","og_description":"Felipe Mateus - sonoff: Reutiliza\u00e7\u00e3o de tecla do teclado - Parte 2 ; Este \u00e9 uma continua\u00e7\u00e3o do projeto anterior afim de executar em background","og_url":"https:\/\/mundoazul.blog\/2023\/09\/sonoff-reutilizacao-de-tecla-do-teclado-background","og_site_name":"Felipe Mateus","article_publisher":"https:\/\/www.facebook.com\/eufelipemateus","article_author":"https:\/\/www.facebook.com\/eufelipemateus","article_published_time":"2023-09-03T11:00:00+00:00","article_modified_time":"2025-12-09T23:41:08+00:00","og_image":[{"width":1920,"height":1280,"url":"https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2021\/11\/iot-gb3efe58db_1920.jpg","type":"image\/jpeg"}],"author":"Felipe Mateus","twitter_card":"summary_large_image","twitter_creator":"@eufelipemateus","twitter_site":"@eufelipemateus","twitter_misc":{"Written by":"Felipe Mateus","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/felipemateus.com\/blog\/2023\/09\/sonoff-reutilizacao-de-tecla-do-teclado-background#article","isPartOf":{"@id":"https:\/\/felipemateus.com\/blog\/2023\/09\/sonoff-reutilizacao-de-tecla-do-teclado-background"},"author":{"name":"Felipe Mateus","@id":"https:\/\/felipemateus.com\/#\/schema\/person\/5ca2279426b9f93497fbf68a6e2577b6"},"headline":"sonoff: Reutiliza\u00e7\u00e3o de tecla do teclado &#8211; Parte 2","datePublished":"2023-09-03T11:00:00+00:00","dateModified":"2025-12-09T23:41:08+00:00","mainEntityOfPage":{"@id":"https:\/\/felipemateus.com\/blog\/2023\/09\/sonoff-reutilizacao-de-tecla-do-teclado-background"},"wordCount":502,"commentCount":0,"publisher":{"@id":"https:\/\/felipemateus.com\/#\/schema\/person\/5ca2279426b9f93497fbf68a6e2577b6"},"image":{"@id":"https:\/\/felipemateus.com\/blog\/2023\/09\/sonoff-reutilizacao-de-tecla-do-teclado-background#primaryimage"},"thumbnailUrl":"https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2021\/11\/iot-gb3efe58db_1920.jpg","keywords":["go","iot","linux","Programa\u00e7\u00e3o"],"articleSection":["Projetos"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/felipemateus.com\/blog\/2023\/09\/sonoff-reutilizacao-de-tecla-do-teclado-background#respond"]}]},{"@type":"WebPage","@id":"https:\/\/felipemateus.com\/blog\/2023\/09\/sonoff-reutilizacao-de-tecla-do-teclado-background","url":"https:\/\/felipemateus.com\/blog\/2023\/09\/sonoff-reutilizacao-de-tecla-do-teclado-background","name":"Sonoff: Keyboard Key Reuse - Part 2 - Felipe Mateus @felipemateus","isPartOf":{"@id":"https:\/\/felipemateus.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/felipemateus.com\/blog\/2023\/09\/sonoff-reutilizacao-de-tecla-do-teclado-background#primaryimage"},"image":{"@id":"https:\/\/felipemateus.com\/blog\/2023\/09\/sonoff-reutilizacao-de-tecla-do-teclado-background#primaryimage"},"thumbnailUrl":"https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2021\/11\/iot-gb3efe58db_1920.jpg","datePublished":"2023-09-03T11:00:00+00:00","dateModified":"2025-12-09T23:41:08+00:00","description":"Felipe Mateus - sonoff: Keyboard key reuse - Part 2 ; This is a continuation of the previous project in order to run in the background","breadcrumb":{"@id":"https:\/\/felipemateus.com\/blog\/2023\/09\/sonoff-reutilizacao-de-tecla-do-teclado-background#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/felipemateus.com\/blog\/2023\/09\/sonoff-reutilizacao-de-tecla-do-teclado-background"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/felipemateus.com\/blog\/2023\/09\/sonoff-reutilizacao-de-tecla-do-teclado-background#primaryimage","url":"https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2021\/11\/iot-gb3efe58db_1920.jpg","contentUrl":"https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2021\/11\/iot-gb3efe58db_1920.jpg","width":1920,"height":1280,"caption":"Imagem de Pixabay"},{"@type":"BreadcrumbList","@id":"https:\/\/felipemateus.com\/blog\/2023\/09\/sonoff-reutilizacao-de-tecla-do-teclado-background#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"In\u00edcio","item":"https:\/\/felipemateus.com\/"},{"@type":"ListItem","position":2,"name":"Projetos","item":"https:\/\/felipemateus.com\/blog\/topicos\/projetos"},{"@type":"ListItem","position":3,"name":"sonoff: Reutiliza\u00e7\u00e3o de tecla do teclado &#8211; Parte 2"}]},{"@type":"WebSite","@id":"https:\/\/felipemateus.com\/#website","url":"https:\/\/felipemateus.com\/","name":"Felipe Mateus @felipemateus","description":"Welcome to my blue world.","publisher":{"@id":"https:\/\/felipemateus.com\/#\/schema\/person\/5ca2279426b9f93497fbf68a6e2577b6"},"alternateName":"eufelipemateus","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/felipemateus.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/felipemateus.com\/#\/schema\/person\/5ca2279426b9f93497fbf68a6e2577b6","name":"Felipe Mateus Rocha Martins","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2023\/04\/FELIPE-2-1024x1024.png","url":"https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2023\/04\/FELIPE-2-1024x1024.png","contentUrl":"https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2023\/04\/FELIPE-2-1024x1024.png","width":1024,"height":1024,"caption":"Felipe Mateus"},"sameAs":["https:\/\/felipemateus.com","https:\/\/www.facebook.com\/eufelipemateus","https:\/\/www.instagram.com\/eufelipemateus","https:\/\/www.linkedin.com\/in\/eufelipemateus\/","https:\/\/x.com\/eufelipemateus","https:\/\/github.com\/eufelipemateus","https:\/\/soundcloud.com\/eufelipemateus"]}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/felipemateus.b-cdn.net\/wp-content\/uploads\/2021\/11\/iot-gb3efe58db_1920.jpg","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pb1Prx-2m8","jetpack-related-posts":[{"id":3710,"url":"https:\/\/felipemateus.com\/en\/blog\/2021\/11\/sonoff-keyboard-key-reuse","url_meta":{"origin":9060,"position":0},"title":"sonoff: Keyboard key reuse","author":"Felipe Mateus","date":"21\/11\/2021","format":false,"excerpt":"In this text I show a homemade project that I created that allows activating the sonoff through the computer keyboard.","rel":"","context":"In &quot;Projetos&quot;","block_context":{"text":"Projetos","link":"https:\/\/felipemateus.com\/en\/blog\/topics\/projects"},"img":{"alt_text":"imagem capa para temas iot.","src":"https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2021\/11\/iot-gb3efe58db_1920.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2021\/11\/iot-gb3efe58db_1920.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2021\/11\/iot-gb3efe58db_1920.jpg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2021\/11\/iot-gb3efe58db_1920.jpg?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2021\/11\/iot-gb3efe58db_1920.jpg?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2021\/11\/iot-gb3efe58db_1920.jpg?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":34192,"url":"https:\/\/felipemateus.com\/en\/blog\/2025\/12\/retrospective","url_meta":{"origin":9060,"position":1},"title":"Dev Retrospective: A journey of creation, PoCs, and real limitations.","author":"Felipe Mateus","date":"31\/12\/2025","format":false,"excerpt":"An immersion into the Fediverse, Web3, and distributed systems from behind the scenes of more than 20 projects from 2025. Between published tools and discarded PoCs, the text reflects on technical experimentation, regulatory barriers, and the understanding that real progress arises from the accumulated learning in each attempt.","rel":"","context":"In &quot;Projetos&quot;","block_context":{"text":"Projetos","link":"https:\/\/felipemateus.com\/en\/blog\/topics\/projects"},"img":{"alt_text":"Capa retrospectiva","src":"https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2025\/12\/capa-retrospectiva.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2025\/12\/capa-retrospectiva.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2025\/12\/capa-retrospectiva.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2025\/12\/capa-retrospectiva.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2025\/12\/capa-retrospectiva.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2025\/12\/capa-retrospectiva.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":2740,"url":"https:\/\/felipemateus.com\/en\/blog\/2021\/05\/bingo","url_meta":{"origin":9060,"position":2},"title":"Bingo Game Multiplayer Socket.io and Javascript","author":"Felipe Mateus","date":"08\/05\/2021","format":false,"excerpt":"This is a multiplayer game made as a way to test knowledge and serve as an example for other programmers.","rel":"","context":"In &quot;Projetos&quot;","block_context":{"text":"Projetos","link":"https:\/\/felipemateus.com\/en\/blog\/topics\/projects"},"img":{"alt_text":"imagem de bingo","src":"https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2019\/09\/2019-09-18.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2019\/09\/2019-09-18.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2019\/09\/2019-09-18.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2019\/09\/2019-09-18.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2019\/09\/2019-09-18.png?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":8859,"url":"https:\/\/felipemateus.com\/en\/blog\/2023\/04\/which-information-technology-course-has-the-least-math","url_meta":{"origin":9060,"position":3},"title":"Which Information Technology course has the least math?","author":"Felipe Mateus","date":"11\/04\/2023","format":false,"excerpt":"This article explores Information Technology (IT) courses that require less math. Although mathematics is fundamental to IT, some courses require less mathematical knowledge than others. Courses include Systems Analysis and Development (ADS), Information Technology Management (GTI), Computer Network Technology,\u2026","rel":"","context":"In &quot;Tecnologia, Carreira e Mercado&quot;","block_context":{"text":"Tecnologia, Carreira e Mercado","link":"https:\/\/felipemateus.com\/en\/blog\/topics\/technology"},"img":{"alt_text":"Curso de tecnologia","src":"https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2023\/04\/Educacao-Cursos-tecnologia.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2023\/04\/Educacao-Cursos-tecnologia.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2023\/04\/Educacao-Cursos-tecnologia.jpg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2023\/04\/Educacao-Cursos-tecnologia.jpg?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":4218,"url":"https:\/\/felipemateus.com\/en\/blog\/2022\/03\/pwa-progressive-web-application","url_meta":{"origin":9060,"position":4},"title":"What is PWA (Progressive Web Application)?","author":"Felipe Mateus","date":"31\/03\/2022","format":false,"excerpt":"What is PWA? A type of web application that looks like a native app but don&#039;t know more.","rel":"","context":"In &quot;Desenvolvimento Web e Programa\u00e7\u00e3o&quot;","block_context":{"text":"Desenvolvimento Web e Programa\u00e7\u00e3o","link":"https:\/\/felipemateus.com\/en\/blog\/topics\/web-development-and-programming"},"img":{"alt_text":"pwa logo","src":"https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2022\/03\/pwa-logo.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2022\/03\/pwa-logo.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2022\/03\/pwa-logo.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2022\/03\/pwa-logo.png?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2022\/03\/pwa-logo.png?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2022\/03\/pwa-logo.png?resize=1400%2C800&ssl=1 4x"},"classes":[]},{"id":68149,"url":"https:\/\/felipemateus.com\/en\/blog\/2026\/04\/new-cycles","url_meta":{"origin":9060,"position":5},"title":"New Cycles: Evolving my Application Ecosystem","author":"Felipe Mateus","date":"23\/04\/2026","format":false,"excerpt":"Felipe Mateus shares the restructuring of his app ecosystem: the archiving of old projects and the commitment to modern, decentralized software through the Pixelfed Brasil client, su nome app.","rel":"","context":"In &quot;Projetos&quot;","block_context":{"text":"Projetos","link":"https:\/\/felipemateus.com\/en\/blog\/topics\/projects"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2026\/04\/roketpik-code-5113374_1920.jpg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2026\/04\/roketpik-code-5113374_1920.jpg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2026\/04\/roketpik-code-5113374_1920.jpg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2026\/04\/roketpik-code-5113374_1920.jpg?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2026\/04\/roketpik-code-5113374_1920.jpg?resize=1050%2C600&ssl=1 3x, https:\/\/i0.wp.com\/felipemateus.com\/wp-content\/uploads\/2026\/04\/roketpik-code-5113374_1920.jpg?resize=1400%2C800&ssl=1 4x"},"classes":[]}],"jetpack_likes_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/felipemateus.com\/en\/wp-json\/wp\/v2\/posts\/9060","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/felipemateus.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/felipemateus.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/felipemateus.com\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/felipemateus.com\/en\/wp-json\/wp\/v2\/comments?post=9060"}],"version-history":[{"count":14,"href":"https:\/\/felipemateus.com\/en\/wp-json\/wp\/v2\/posts\/9060\/revisions"}],"predecessor-version":[{"id":29972,"href":"https:\/\/felipemateus.com\/en\/wp-json\/wp\/v2\/posts\/9060\/revisions\/29972"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/felipemateus.com\/en\/wp-json\/wp\/v2\/media\/3727"}],"wp:attachment":[{"href":"https:\/\/felipemateus.com\/en\/wp-json\/wp\/v2\/media?parent=9060"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/felipemateus.com\/en\/wp-json\/wp\/v2\/categories?post=9060"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/felipemateus.com\/en\/wp-json\/wp\/v2\/tags?post=9060"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}