加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

在Windows上重新定义Emacs中的密钥

发布时间:2020-12-14 01:54:35 所属栏目:Windows 来源:网络整理
导读:我在Mac OS X上使用我的命令键作为额外的控制键(我相信太空学员键盘具有这种配置).我想通过在Emacs中将Alt切换到Ctrl并将 Windows键切换为Alt来在我的Windows机器上模拟这个.这可能吗?我找到了 this post,这表明了类似的东西 (setq w32-pass-lwindow-to-sys
我在Mac OS X上使用我的命令键作为额外的控制键(我相信太空学员键盘具有这种配置).我想通过在Emacs中将Alt切换到Ctrl并将 Windows键切换为Alt来在我的Windows机器上模拟这个.这可能吗?我找到了 this post,这表明了类似的东西

(setq w32-pass-lwindow-to-system nil 
      w32-pass-rwindow-to-system nil 
      w32-pass-apps-to-system nil 
      w32-lwindow-modifier 'super ;; Left Windows key 
      w32-rwindow-modifier 'super ;; Right Windows key 
      w32-apps-modifier 'hyper) ;; Menu key

按下Windows键获取超级和超级键.当我尝试将其重新映射到’控制以测试它(但最终我希望它是meta和Alt作为Ctrl,如上所述)时,windows-e仍然被Windows(XP)拦截并打开资源管理器,但似乎是开始的好地方?我将不胜感激任何建议.

解决方法

从w32-pass-lwindow-to-system的文档:

Note that some combinations of the left “Windows” key with other keys are
caught by Windows at low level,and so binding them in Emacs will have no
effect. For example,<lwindow>-r always pops up the Windows Run dialog,
<lwindow>-<Pause> pops up the “System Properties” dialog,etc. However,see
the doc string of `w32-phantom-key-code’.

从w32-phantom-key-code的文档:

Virtual key code used to generate “phantom” key presses.
Value is a number between 0 and 255.

Phantom key presses are generated in order to stop the system from
acting on “Windows” key events when `w32-pass-lwindow-to-system’ or
`w32-pass-rwindow-to-system’ is nil.

正如它在Xah的网站上所说:

There’s no way around that unless you use other tools such as AutoHotkey. Even so,it may not be possible to disable 【Win+l】 (lock window) and 【Win+u】 (easy access).

所以看起来如果它不适用于他描述的方法(看起来是正确的),你应该研究一下AutoHotKey.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读