<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet href="/rss/stylesheet/" type="text/xsl"?>
<rss xmlns:content='http://purl.org/rss/1.0/modules/content/' xmlns:taxo='http://purl.org/rss/1.0/modules/taxonomy/' xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' xmlns:itunes='http://www.itunes.com/dtds/podcast-1.0.dtd' xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0" xmlns:dc='http://purl.org/dc/elements/1.1/' xmlns:atom='http://www.w3.org/2005/Atom' xmlns:podbridge='http://www.podbridge.com/podbridge-ad.dtd' version='2.0'>
<channel>
  <title>小明的博客</title>
  <language>zh-cn</language>
  <generator>microfeed.org</generator>
  <itunes:type>episodic</itunes:type>
  <itunes:explicit>false</itunes:explicit>
  <atom:link rel="self" href="https://blog-madeai-eu-org.pages.dev/rss/" type="application/rss+xml"/>
  <link>https://blog.madeai.eu.org</link>
  <description>
    <![CDATA[<p>分享日常工作生活中的所思所想，拒绝碎片化信息，通过阅读和博客输出沉淀深度思考。</p>]]>
  </description>
  <itunes:author>DylanYang</itunes:author>
  <itunes:image href="https://cdn.madeai.eu.org/blog-madeai-eu-org/production/images/channel-b4ee93e4522a2b7a4690f12bf5d4960a.png"/>
  <image>
    <title>小明的博客</title>
    <url>https://cdn.madeai.eu.org/blog-madeai-eu-org/production/images/channel-b4ee93e4522a2b7a4690f12bf5d4960a.png</url>
    <link>https://blog.madeai.eu.org</link>
  </image>
  <copyright>©2026</copyright>
  <itunes:owner>
    <itunes:email>huangyebiaoke@outlook.com</itunes:email>
    <itunes:name>DylanYang</itunes:name>
  </itunes:owner>
  <itunes:category text="Business">
    <itunes:category text="Investing"/>
  </itunes:category>
  <itunes:category text="Arts">
    <itunes:category text="Design"/>
  </itunes:category>
  <itunes:category text="News">
    <itunes:category text="Tech News"/>
  </itunes:category>
  <item>
    <title>GamepadMapper：用手柄掌控 Mac 的开源映射工具</title>
    <guid>HxHfF0OAXN6</guid>
    <pubDate>Sun, 17 May 2026 04:51:21 GMT</pubDate>
    <itunes:explicit>false</itunes:explicit>
    <description>
      <![CDATA[<p>作为一名 Mac 用户，你是否曾想过用手柄来控制游戏之外的应用？或者你是否需要在某些不支持手柄的 Mac 游戏中使用手柄替代键鼠？<strong>GamepadMapper</strong> 就是为此而生的开源 macOS 工具。</p><h2>什么是 GamepadMapper？</h2><p>GamepadMapper 是一款 macOS 菜单栏应用，可以将手柄的按键和摇杆实时映射为键盘按键和鼠标操作。它基于 Swift 6 + SwiftUI 构建，纯 Swift Package Manager 管理，无任何第三方依赖，支持 Apple Silicon 和 Intel Mac。</p><p><img src="https://cdn.madeai.eu.org/blog-madeai-eu-org/production/media/rich-editor/items/HxHfF0OAXN6/image-f802fd018f725c40372e250a57b190b2.png"></p><p><em>主界面：权限状态、手柄连接状态、方案管理和映射编辑入口一目了然</em></p><h2>核心特性</h2><h3>1. 可靠的底层输入读取</h3><p>GamepadMapper 采用了 <strong>双输入机制</strong> 确保手柄输入稳定可靠：</p><ul><li><strong>HID 层读取</strong>（IOHIDManager）：在独立后台线程运行，直接从硬件层读取手柄输入，即使应用切到后台也能持续响应。这是映射引擎的主要输入源。</li><li><strong>GameController 框架</strong>（GCController）：用于手柄连接/断开通知和实时状态可视化展示。</li></ul><p><img src="https://cdn.madeai.eu.org/blog-madeai-eu-org/production/images/item-c6ed645b330c7d02dcd3c73ebd4e4bfc.png"></p><p><em>实时手柄状态可视化：D-pad、摇杆、肩键、扳机键、ABXY 功能键的状态一目了然</em></p><h3>2. 高性能映射引擎</h3><p>映射引擎运行在 qos: .userInteractive 的高优先级后台队列上：</p><ul><li><strong>8ms 轮询间隔</strong>（约 125Hz），带来低延迟的响应体验</li><li>支持多种映射类型：</li><li class="ql-indent-1">按键 → 键盘键 / 鼠标键</li><li class="ql-indent-1">摇杆 → 键盘键（方向感知，可配死区）</li><li class="ql-indent-1">摇杆 → 鼠标移动（可调灵敏度）</li><li class="ql-indent-1">摇杆 → 鼠标拖拽</li><li>每个映射最多支持 <strong>2 个组合目标</strong>（Combo Targets），实现一键多操</li><li>内置软件按键重复（Key Repeat）机制，模拟原生键盘长按效果</li></ul><p><img src="https://cdn.madeai.eu.org/blog-madeai-eu-org/production/media/rich-editor/items/HxHfF0OAXN6/image-45d19c89986ce32878d9b1348b2b0dcc.png"></p><p><em>映射编辑器：为每个按键或摇杆配置映射目标、死区、灵敏度和组合键</em></p><h3>3. 拖拽边界系统</h3><p>对于鼠标拖拽映射，GamepadMapper 提供了独特的<strong>圆形拖拽边界</strong>功能：光标被限制在以指定中心点和半径的圆形区域内，摇杆回中时自动回到边界中心。配合可视化叠加窗口，可以直观地调整边界位置和大小。</p><p><img src="https://cdn.madeai.eu.org/blog-madeai-eu-org/production/media/rich-editor/items/HxHfF0OAXN6/image-b3cddd19a71d9be6b10d09c02fccba84.png"></p><p><em>拖拽边界可视化：圆形叠加窗口支持拖拽移动和边缘缩放</em></p><h3>4. 多方案管理</h3><p>方案以 JSON 文件存储在 ~/Library/Application Support/GamepadMapper/Profiles/，支持创建、重命名、复制、删除和重置。不同方案可以有不同的映射配置、灵敏度和拖拽边界，方便在不同场景间快速切换。</p><h3>5. 多语言支持</h3><p>内置 6 种语言界面：英文、简体中文、日文、韩文、俄文、西班牙文，可在设置中实时切换。</p><h3>6. 便捷的菜单栏入口</h3><p><img src="https://cdn.madeai.eu.org/blog-madeai-eu-org/production/media/rich-editor/items/HxHfF0OAXN6/image-a2255aa890bfe9a8ac54ce3d0ceee38e.png"></p><p><em>菜单栏图标和下拉菜单：快速开始/停止映射、切换方案、查看引擎日志</em></p><h2>快速上手</h2><ol><li>启动应用 — 菜单栏出现手柄图标</li><li>通过蓝牙或 USB 连接手柄</li><li>点击菜单栏图标，打开设置</li><li>授予<strong>辅助功能</strong>权限（用于发送键盘/鼠标事件）</li><li>编辑映射配置，点击<strong>开始映射</strong></li><li>切换到目标应用，映射在后台持续生效</li></ol><h2>技术架构</h2><h2> <strong>语言</strong>Swift 6.0 <strong>UI 框架</strong>SwiftUI + @Observable <strong>最低系统</strong>macOS 14 (Sonoma) <strong>输入层</strong>IOHIDManager + GameController.framework <strong>输出层</strong>CGEvent（键盘 + 鼠标模拟） <strong>构建系统</strong>Swift Package Manager <strong>许可协议</strong>GPL v3 获取源码</h2><p>GamepadMapper 是开源项目，源码托管在 GitHub：</p><p><a href="https://github.com/huangyebiaoke/GamepadMapper" rel="noopener noreferrer" target="_blank">github.com/huangyebiaoke/GamepadMapper</a></p><pre class="ql-syntax" spellcheck="false">git clone https://github.com/huangyebiaoke/GamepadMapper.git
cd GamepadMapper
swift build
</pre><p>如果你有任何问题或建议，欢迎在 GitHub 提交 Issue 或 PR！</p>]]>
    </description>
    <link>https://blog-madeai-eu-org.pages.dev/i/gamepadmapper-mac-HxHfF0OAXN6/</link>
    <itunes:image href="https://cdn.madeai.eu.org/blog-madeai-eu-org/production/images/item-dbc41d8ac1dfbddcd4ae75a6049ea825.png"/>
  </item>
</channel>
</rss>