► 當 iMac 接上PC鍵盤時, 下位置的按鍵要如何產生作用, 設定方式如下
編輯 /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources/IDETextKeyBindingSet.plist
在
<key>Deletions</key>
<dict>
......
增加
<key>Delete Current Line</key>
<string>deleteToBeginningOfLine:, moveToEndOfLine:, deleteToBeginningOfLine:, deleteBackward:, moveDown:, moveToBeginningOfLine:</string>
</dict>
儲存
重新啟動 xcode 後, 進入 Xcode > Preferences > KeyBindings 點選 Text 類, 就可找到 Delete Current Line 然後指定所要的快速鍵
► 自訂鍵盤定義控制碼說明
1. 建立 DefaultKeyBinding.dict 文字檔, 然後利用命令視窗複製到 ~/Library/KeyBindings 目錄下後重新啟動電腦即可. KeyBindings 目錄若不存在則下達 mkdir KeyBindings 產生該目錄.
2. 檔案內容如下
2. 檔案內容如下
{
"\UF729" = "moveToBeginningOfLine:"; /* home */
"\UF72B" = "moveToEndOfLine:"; /* end */
"$\UF729" = "moveToBeginningOfLineAndModifySelection:"; /* Shift+Home */
"$\UF72B" = "moveToEndOfLineAndModifySelection:"; /* Shift + End */
"^\UF729" = "moveToBeginningOfDocument:"; /* Ctrl + Home */
"^\UF72B" = "moveToEndOfDocument:"; /* Ctrl + End */
"$^\UF729" = "moveToBeginningOfDocumentAndModifySelection:"; /* Shift + Ctrl + Home */
"$^\UF72B" = "moveToEndOfDocumentAndModifySelection:"; /* Shift + Ctrl + End */
"^c" = "copy:"; /* Ctrl + c */
"^v" = "paste:"; /* Ctrl + v */
"^x" = "cut:"; /* Ctrl + x */
"^z" = "undo:"; /* Ctrl + z */
}
"\UF729" = "moveToBeginningOfLine:"; /* home */
"\UF72B" = "moveToEndOfLine:"; /* end */
"$\UF729" = "moveToBeginningOfLineAndModifySelection:"; /* Shift+Home */
"$\UF72B" = "moveToEndOfLineAndModifySelection:"; /* Shift + End */
"^\UF729" = "moveToBeginningOfDocument:"; /* Ctrl + Home */
"^\UF72B" = "moveToEndOfDocument:"; /* Ctrl + End */
"$^\UF729" = "moveToBeginningOfDocumentAndModifySelection:"; /* Shift + Ctrl + Home */
"$^\UF72B" = "moveToEndOfDocumentAndModifySelection:"; /* Shift + Ctrl + End */
"^c" = "copy:"; /* Ctrl + c */
"^v" = "paste:"; /* Ctrl + v */
"^x" = "cut:"; /* Ctrl + x */
"^z" = "undo:"; /* Ctrl + z */
}
這樣就可以達成 PC鍵盤通用的動作了
► 如何在 xcode 增加刪除一行的動作
先改一下 IDEKit 資料夾權限
sudo chmod 777 /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources/
sudo chmod 666 /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources/IDETextKeyBindingSet.plist
sudo chmod 777 /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources/
sudo chmod 666 /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources/IDETextKeyBindingSet.plist
編輯 /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources/IDETextKeyBindingSet.plist
在
<key>Deletions</key>
<dict>
......
增加
<key>Delete Current Line</key>
<string>deleteToBeginningOfLine:, moveToEndOfLine:, deleteToBeginningOfLine:, deleteBackward:, moveDown:, moveToBeginningOfLine:</string>
</dict>
儲存
重新啟動 xcode 後, 進入 Xcode > Preferences > KeyBindings 點選 Text 類, 就可找到 Delete Current Line 然後指定所要的快速鍵
Key Modifiers
^ : Ctrl
$ : Shift ~ : Option (Alt) @ : Command (Apple) # : Numeric Keypad |
Non-Printable Key Codes Up Arrow: \UF700 Down Arrow: \UF701 Left Arrow: \UF702 Right Arrow: \UF703 Insert: \UF727 Page Delete: \UF728 Home: \UF729 End: \UF72B Break: \UF732 SysReq: \UF731 Help: \UF746 F1: \UF704 F2: \UF705 F3: \UF706 |
Backspace: \U0008 Tab: \U0009 Escape: \U001B Enter: \U000A Up: \UF72C Page Down: \UF72D Print Screen: \UF72E Scroll Lock: \UF72F Pause: \UF730 Menu: \UF735 |
可控制的動作指令 Supported Actions
► 特殊鑑對應
► 鍵盤對應參考
alignCenter: alignJustified: alignLeft: orderBack: alignRight: orderFront: breakUndoCoalescing cancelOperation: capitalizeWord: center orderFrontTablePanel: centerSelectionInVisibleArea: changeCaseOfLetter: checkSpelling: clearRecentDocuments: complete: copy: copyFont: copyRuler: cut: delete: deleteBackward: deleteBackwardByDecomposingPreviousCharacter: deleteForward: deleteToBeginningOfLine: deleteToBeginningOfParagraph: deleteToEndOfLine: deleteToEndOfParagraph: deleteToMark: deleteWordBackward: deleteWordForward: hide: ignoreSpelling: indent: insertBacktab: insertContainerBreak: insertLineBreak: insertNewline: insertNewlineIgnoringFieldEditor: insertParagraphSeparator: insertTab: insertTabIgnoringFieldEditor: insertText: loosenKerning: lowerBaseline: lowercaseWord: moveBackward: |
moveBackwardAndModifySelection: moveDown: moveDownAndModifySelection: moveForward: moveForwardAndModifySelection: moveLeft: moveLeftAndModifySelection: moveRight: moveRightAndModifySelection: moveToBeginningOfDocument: moveToBeginningOfDocumentAndModifySelection: moveToBeginningOfLine: moveToBeginningOfLineAndModifySelection: moveToBeginningOfParagraph: moveToEndOfDocument: moveToEndOfDocumentAndModifySelection: moveToEndOfLineAndModifySelection: moveToEndOfLine: moveToEndOfParagraph: moveUp: moveUpAndModifySelection: moveWordBackward: moveWordBackwardAndModifySelection: moveWordForward: moveWordForwardAndModifySelection: moveWordLeft: moveWordLeftAndModifySelection: moveWordRight: moveWordRightAndModifySelection: newDocument: openDocument: orderFrontLinkPanel: orderFrontListPanel: orderFrontSpacingPanel: outline: pageDown: pageUp: paste: pasteAsPlainText: pasteAsRichText: pasteFont: pasteRuler: performClose: |
performMiniaturize: performZoom: printDocument: raiseBaseline: revertDocumentToSaved: runPageLayout: saveAllDocuments: saveDocument: saveDocumentAs: saveDocumentTo: scrollLineDown: scrollLineUp: scrollPageDown: scrollPageUp: selectAll: selectLine: selectParagraph: selectToMark: selectWord: setMark: showContextHelp: showGuessPanel: startSpeaking: stopSpeaking: subscript: superscript: swapWithMark: terminate: tightenKerning: toggleBaseWritingDirection: toggleContinuousSpellChecking: toggleRuler: transpose: transposeWords: turnOffKerning: turnOffLigatures: underline: unscript: uppercaseWord: useAllLigatures: useStandardKerning: useStandardLigatures: yank: |