Xcode 4 idekeybindings multiple commands for one keystroke

杀马特。学长 韩版系。学妹 提交于 2019-12-21 10:55:12

问题


Trying desperately to customize Xcode 4 keybindings.

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)

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>

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

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.


回答1:


Just because you can add an array with two functions to the xml structure, doesn't mean that Xcode is looking for it when it parses the file.

If the code that reads the file checked if the value was an array or a string, then did some looping, this would behave the way you believe it should. My guess is that Xcode is reading the value associated with the key, seeing that it isn't a string, and serenading you with that lovely beep.



来源:https://stackoverflow.com/questions/5975026/xcode-4-idekeybindings-multiple-commands-for-one-keystroke

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!