Xcode 4 idekeybindings 一个按键的多个命令 [英] Xcode 4 idekeybindings multiple commands for one keystroke

查看:22
本文介绍了Xcode 4 idekeybindings 一个按键的多个命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

拼命尝试自定义 Xcode 4 键绑定.

Trying desperately to customize Xcode 4 keybindings.

我正在编辑用户 .idekeybindings 文件(xcode 有时会在打开时修改它然后尝试通过键绑定界面更新 - 可爱)

I'm editing the user .idekeybindings file (which xcode sometimes wipes out when modified while open and then subsequently attempting to update through the key bindings interface - lovely)

我的理解是提供一个 of s 命令(选择器)而不是仅仅一个字符串应该执行所有这些命令.

My understanding is that providing an of s commands (selectors) instead of just a single string should execute all those commands.

<key>Text Key Bindings</key>
<dict>
    <key>Key Bindings</key>
    <dict>
        <key>@L</key>
        <string>selectLine:</string>
        <key>@d</key>
        <array>
            <string>selectLine:</string>
            <string>deleteBackward:</string>
        </array>
    </dict>
    <key>Version</key>
    <integer>3</integer>
</dict>

在这种特殊情况下,我的 selectLine: 用于 command-shift-l 工作正常.

In this particular case, my selectLine: for the command-shift-l works properly.

我的 command-d 向我发出哔哔声并失败了.如果我删除数组中的任一命令,但将其保留在数组中,则该命令有效(与哪个命令无关).但是一旦我把它们结合起来,它就惨败了.

My command-d beeps at me and fails. If I remove either command in the array, but leave it inside the array, that command works (doesn't matter which one). But as soon as I combine them it fails miserably.

有人知道我在这里做错了什么吗?缺乏有关如何做到这一点的知识令人沮丧.

Anyone know what I'm doing wrong here? The lack of knowledge provided on how to do this is frustrating.

推荐答案

您想要做的事情绝对是可能的.(至少在 XCode 10 中,这是我在撰写本文时使用的)

What you're looking to do is absolutely possible. (at least in XCode 10, which is what I'm using at the time of writing)

而不是将您的命令放入数组:

Instead of putting your commands into an array:

<array>
  <string>selectLine:</string>
  <string>deleteBackward:</string>
</array>

只需将它们放入 one 字符串条目中,并确保它们像这样用逗号分隔:

simply put them into one string entry and make sure they're comma-separated like so:

<string>selectLine:, deleteBackward:</string>

干杯!

这篇关于Xcode 4 idekeybindings 一个按键的多个命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆