<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Mahboob</title>
    <description>The latest articles on DEV Community by Mahboob (@mahboobmonnamd).</description>
    <link>https://dev.to/mahboobmonnamd</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4256563%2F043ac766-fad8-4f6d-9886-35f697574baa.png</url>
      <title>DEV Community: Mahboob</title>
      <link>https://dev.to/mahboobmonnamd</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mahboobmonnamd"/>
    <language>en</language>
    <item>
      <title>I Built a Tiny macOS App So I Could Clean My Keyboard Without Accidental Typing</title>
      <dc:creator>Mahboob</dc:creator>
      <pubDate>Sat, 21 Nov 2026 02:06:22 +0000</pubDate>
      <link>https://dev.to/mahboobmonnamd/i-built-a-tiny-macos-app-so-i-could-clean-my-keyboard-without-accidental-typing-2dn0</link>
      <guid>https://dev.to/mahboobmonnamd/i-built-a-tiny-macos-app-so-i-could-clean-my-keyboard-without-accidental-typing-2dn0</guid>
      <description>&lt;h2&gt;
  
  
  I Built a Tiny macOS App So I Could Clean My Keyboard Without Accidental Typing
&lt;/h2&gt;

&lt;p&gt;Have you ever tried cleaning your MacBook keyboard, only to accidentally type random characters, trigger shortcuts, or change the volume?&lt;/p&gt;

&lt;p&gt;I faced the same problem.&lt;/p&gt;

&lt;p&gt;I wanted something simple: &lt;strong&gt;a way to temporarily disable my keyboard while keeping the mouse and trackpad working.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;Lock My Keyboard&lt;/strong&gt;, a free, open-source macOS utility.&lt;/p&gt;

&lt;p&gt;No complicated setup. No unnecessary features. Just &lt;strong&gt;Lock → Clean → Unlock&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  ✨ What Does It Do?
&lt;/h2&gt;

&lt;p&gt;Lock My Keyboard is designed around a simple workflow:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🔒 &lt;strong&gt;One-click Lock&lt;/strong&gt; — Temporarily blocks keyboard input.&lt;/li&gt;
&lt;li&gt;🧹 &lt;strong&gt;Clean safely&lt;/strong&gt; — Wipe your keyboard without accidental typing.&lt;/li&gt;
&lt;li&gt;🖱️ &lt;strong&gt;Mouse and trackpad stay active&lt;/strong&gt; — You can still click Unlock.&lt;/li&gt;
&lt;li&gt;✅ &lt;strong&gt;One-click Unlock&lt;/strong&gt; — Restores normal keyboard input.&lt;/li&gt;
&lt;li&gt;🔐 &lt;strong&gt;Privacy-focused&lt;/strong&gt; — No accounts, cloud services, or keystroke logging.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The interface is intentionally minimal.&lt;/p&gt;

&lt;h2&gt;
  
  
  💻 Requirements
&lt;/h2&gt;

&lt;p&gt;Before installing, make sure you have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;An Apple Silicon Mac (M1, M2, M3, M4, or newer).&lt;/li&gt;
&lt;li&gt;macOS 26 or later.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://brew.sh" rel="noopener noreferrer"&gt;Homebrew&lt;/a&gt; installed.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🚀 Installation Using Homebrew
&lt;/h2&gt;

&lt;p&gt;Open Terminal and execute the following commands.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Add the Homebrew tap&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew tap mahboobmonnamd/lock-my-keyboard https://github.com/mahboobmonnamd/lock-my-keyboard
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 2: Trust the specific cask&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew trust --cask mahboobmonnamd/lock-my-keyboard/lock-my-keyboard
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Homebrew requires explicit trust for this third-party cask. This command trusts the specific cask rather than the entire tap.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Install the application&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;brew install --cask lock-my-keyboard
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 4: Launch the application&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;open -a LockMyKeyboard
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it!&lt;/p&gt;

&lt;h3&gt;
  
  
  First-Time Setup
&lt;/h3&gt;

&lt;p&gt;The app requires macOS Accessibility permission to intercept keyboard events.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;strong&gt;Lock My Keyboard&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Lock&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;If prompted, open &lt;strong&gt;System Settings → Privacy &amp;amp; Security → Accessibility&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Enable permission for Lock My Keyboard.&lt;/li&gt;
&lt;li&gt;Return to the app and click &lt;strong&gt;Lock&lt;/strong&gt; again.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can now clean your keyboard and click &lt;strong&gt;Unlock&lt;/strong&gt; when finished.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Important security note:&lt;/strong&gt; The current published release (v1.0.1) is unsigned and not notarized because Apple Developer ID signing is not yet available for this project. The Homebrew cask removes the app's quarantine attribute, which bypasses normal Gatekeeper origin verification. Review the source code and verify the published release checksum before deciding to install it. This is not equivalent to Apple's notarization process.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  ⚙️ How Does It Work?
&lt;/h2&gt;

&lt;p&gt;I developed the application using:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Swift&lt;/strong&gt; for the application logic.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SwiftUI&lt;/strong&gt; for the user interface.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CoreGraphics&lt;/strong&gt; for intercepting keyboard events.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;macOS Accessibility APIs&lt;/strong&gt; for the required permission checks.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The interesting part is the &lt;strong&gt;CoreGraphics event tap&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;When you click Lock, the app creates an event tap that suppresses keyboard input, including supported media-key events, while leaving mouse and trackpad interactions available.&lt;/p&gt;

&lt;p&gt;When you click Unlock or exit the application, the event tap is removed, allowing keyboard input again.&lt;/p&gt;

&lt;p&gt;No keystrokes are stored or sent anywhere.&lt;/p&gt;

&lt;h2&gt;
  
  
  🛠️ Building for Reliability
&lt;/h2&gt;

&lt;p&gt;While building this utility, I realized that disabling keyboard input is only half the problem.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do you know the keyboard is actually locked?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;macOS can disable event taps unexpectedly. An app shouldn't continue displaying "Locked" if keyboard protection is no longer active.&lt;/p&gt;

&lt;p&gt;To improve reliability, I've recently added:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Event-tap health monitoring.&lt;/li&gt;
&lt;li&gt;Detection of lost Accessibility permission.&lt;/li&gt;
&lt;li&gt;Clear warnings when keyboard protection unexpectedly stops.&lt;/li&gt;
&lt;li&gt;Automated Swift tests.&lt;/li&gt;
&lt;li&gt;GitHub Actions CI.&lt;/li&gt;
&lt;li&gt;Safer release and Homebrew validation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These improvements are merged into the source code and are intended for an upcoming release. The latest published version remains &lt;strong&gt;v1.0.1&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  ❤️ Why Open Source?
&lt;/h2&gt;

&lt;p&gt;This started as a small personal utility, but I believe useful software doesn't always need to be complicated.&lt;/p&gt;

&lt;p&gt;Sometimes the best projects solve one everyday problem really well.&lt;/p&gt;

&lt;p&gt;Lock My Keyboard is free, open source, and available on GitHub.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub Repository:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://github.com/mahboobmonnamd/lock-my-keyboard" rel="noopener noreferrer"&gt;https://github.com/mahboobmonnamd/lock-my-keyboard&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Installation Guide:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://github.com/mahboobmonnamd/lock-my-keyboard/blob/main/docs/INSTALL.md" rel="noopener noreferrer"&gt;https://github.com/mahboobmonnamd/lock-my-keyboard/blob/main/docs/INSTALL.md&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Latest Published Release:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://github.com/mahboobmonnamd/lock-my-keyboard/releases/tag/v1.0.1" rel="noopener noreferrer"&gt;https://github.com/mahboobmonnamd/lock-my-keyboard/releases/tag/v1.0.1&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🙌 Feedback and Contributions Welcome!
&lt;/h2&gt;

&lt;p&gt;If you find this useful, give it a try and share your feedback.&lt;/p&gt;

&lt;p&gt;If you're a macOS or Swift developer, contributions, bug reports, and improvement suggestions are always welcome.&lt;/p&gt;

&lt;p&gt;And if you like the project, consider giving it a ⭐ on GitHub!&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Built with Swift, SwiftUI, and the motivation to solve one small, annoying everyday problem.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>swift</category>
      <category>mac</category>
    </item>
  </channel>
</rss>
