Custom Keyboard Shortcuts: Difference between revisions
No edit summary |
No edit summary |
||
| Line 11: | Line 11: | ||
# double click it --> TextEdit should now launch | # double click it --> TextEdit should now launch | ||
# before you do anything, go to TextEdit->Preferences, and under "Format" pick "Plain Text", this is important | # before you do anything, go to TextEdit->Preferences, and under "Format" pick "Plain Text", this is important | ||
# Now | # Now open the file mentioned above, "'''Keyboard.txt'''" | ||
# Now find the lines in the Menus.txt file that you want to add keyboard shortcuts for, eg: find the line<pre>"Menu/Controls/Original Pitch" = "Original Pitch";</pre> | # Now find the lines in the Menus.txt file that you want to add keyboard shortcuts for, eg: find the line<pre>"Menu/Controls/Original Pitch" = "Original Pitch";</pre> | ||
# Now | # Now search in "'''Keyboard.txt'''" for that. If you do not find it you must TYPE it. DO NOT COPY AND PASTE. The original document is encoded in UTF16, while your document MUST BE encoded in MacRoman. If you don't know what this means then you must type. If you have the ability to convert between UTF18 and MacRoman then go ahead (only XCode seems to do this properly. TextWrangler seems to have the ability but it does NOT work) | ||
# Now | # Now on the right hand side of the equals sign, type something like a-y (this stands for ⌘-Y, "a" for "apple"), save | ||
# Place that file in the correct location (see top of this page) | # Place that file in the correct location (see top of this page) | ||
# run kJams. | # run kJams. | ||
Revision as of 00:43, 15 November 2007
kJams allows you to customize all keyboard shortcuts. To do this you edit a special file named "Keyboard.txt" which resides in your preferences folder at this location:
/Users/(your user)/Library/Preferences/kJams/Keyboard.txt
Instructions for editing the file are within the file itself.
You'll notice how each line begins with the quoted string that is the path to the menu item. These strings come directly from the strings file located inside the kJams application bundle. To get to that file, follow these steps:
- In the Finder, context-click (which means control- or right- click) on the kJams application icon, and pick "Show Package Contents"
- Inside that folder, navigate to this file:
Contents/Resources/English.lproj/Menus.strings
- Copy the Menus.strings file to the desktop
- Rename it so it says Menus.txt (it is after all just a text file)
- double click it --> TextEdit should now launch
- before you do anything, go to TextEdit->Preferences, and under "Format" pick "Plain Text", this is important
- Now open the file mentioned above, "Keyboard.txt"
- Now find the lines in the Menus.txt file that you want to add keyboard shortcuts for, eg: find the line
"Menu/Controls/Original Pitch" = "Original Pitch";
- Now search in "Keyboard.txt" for that. If you do not find it you must TYPE it. DO NOT COPY AND PASTE. The original document is encoded in UTF16, while your document MUST BE encoded in MacRoman. If you don't know what this means then you must type. If you have the ability to convert between UTF18 and MacRoman then go ahead (only XCode seems to do this properly. TextWrangler seems to have the ability but it does NOT work)
- Now on the right hand side of the equals sign, type something like a-y (this stands for ⌘-Y, "a" for "apple"), save
- Place that file in the correct location (see top of this page)
- run kJams.
You should now have custom a keyboard shortcut for that item.
Limitations: don't move the space bar (kMenuSpaceGlyph) off of the play command, it won't work.
There are some glyphs that are hard to type on the keyboard, for these you can use the codes below. Find the key you want, say the left arrow key, and look for it's code, which is 0x64, and type that for it's key. The file has many examples to show you how to do it.
/* For use with Get/SetMenuItemKeyGlyph*/
enum {
kMenuNullGlyph = 0x00, /* Null (always glyph 1)*/
kMenuTabRightGlyph = 0x02, /* Tab to the right key (for left-to-right script systems)*/
kMenuTabLeftGlyph = 0x03, /* Tab to the left key (for right-to-left script systems)*/
kMenuEnterGlyph = 0x04, /* Enter key*/
kMenuShiftGlyph = 0x05, /* Shift key*/
kMenuControlGlyph = 0x06, /* Control key*/
kMenuOptionGlyph = 0x07, /* Option key*/
kMenuSpaceGlyph = 0x09, /* Space (always glyph 3) key*/
kMenuDeleteRightGlyph = 0x0A, /* Delete to the right key (for right-to-left script systems)*/
kMenuReturnGlyph = 0x0B, /* Return key (for left-to-right script systems)*/
kMenuReturnR2LGlyph = 0x0C, /* Return key (for right-to-left script systems)*/
kMenuNonmarkingReturnGlyph = 0x0D, /* Nonmarking return key*/
kMenuPencilGlyph = 0x0F, /* Pencil key*/
kMenuDownwardArrowDashedGlyph = 0x10, /* Downward dashed arrow key*/
kMenuCommandGlyph = 0x11, /* Command key*/
kMenuCheckmarkGlyph = 0x12, /* Checkmark key*/
kMenuDiamondGlyph = 0x13, /* Diamond key*/
kMenuAppleLogoFilledGlyph = 0x14, /* Apple logo key (filled)*/
kMenuParagraphKoreanGlyph = 0x15, /* Unassigned (paragraph in Korean)*/
kMenuDeleteLeftGlyph = 0x17, /* Delete to the left key (for left-to-right script systems)*/
kMenuLeftArrowDashedGlyph = 0x18, /* Leftward dashed arrow key*/
kMenuUpArrowDashedGlyph = 0x19, /* Upward dashed arrow key*/
kMenuRightArrowDashedGlyph = 0x1A, /* Rightward dashed arrow key*/
kMenuEscapeGlyph = 0x1B, /* Escape key*/
kMenuClearGlyph = 0x1C, /* Clear key*/
kMenuLeftDoubleQuotesJapaneseGlyph = 0x1D, /* Unassigned (left double quotes in Japanese)*/
kMenuRightDoubleQuotesJapaneseGlyph = 0x1E, /* Unassigned (right double quotes in Japanese)*/
kMenuTrademarkJapaneseGlyph = 0x1F, /* Unassigned (trademark in Japanese)*/
kMenuBlankGlyph = 0x61, /* Blank key*/
kMenuPageUpGlyph = 0x62, /* Page up key*/
kMenuCapsLockGlyph = 0x63, /* Caps lock key*/
kMenuLeftArrowGlyph = 0x64, /* Left arrow key*/
kMenuRightArrowGlyph = 0x65, /* Right arrow key*/
kMenuNorthwestArrowGlyph = 0x66, /* Northwest arrow key*/
kMenuHelpGlyph = 0x67, /* Help key*/
kMenuUpArrowGlyph = 0x68, /* Up arrow key*/
kMenuSoutheastArrowGlyph = 0x69, /* Southeast arrow key*/
kMenuDownArrowGlyph = 0x6A, /* Down arrow key*/
kMenuPageDownGlyph = 0x6B, /* Page down key*/
kMenuAppleLogoOutlineGlyph = 0x6C, /* Apple logo key (outline)*/
kMenuContextualMenuGlyph = 0x6D, /* Contextual menu key*/
kMenuPowerGlyph = 0x6E, /* Power key*/
kMenuF1Glyph = 0x6F, /* F1 key*/
kMenuF2Glyph = 0x70, /* F2 key*/
kMenuF3Glyph = 0x71, /* F3 key*/
kMenuF4Glyph = 0x72, /* F4 key*/
kMenuF5Glyph = 0x73, /* F5 key*/
kMenuF6Glyph = 0x74, /* F6 key*/
kMenuF7Glyph = 0x75, /* F7 key*/
kMenuF8Glyph = 0x76, /* F8 key*/
kMenuF9Glyph = 0x77, /* F9 key*/
kMenuF10Glyph = 0x78, /* F10 key*/
kMenuF11Glyph = 0x79, /* F11 key*/
kMenuF12Glyph = 0x7A, /* F12 key*/
kMenuF13Glyph = 0x87, /* F13 key*/
kMenuF14Glyph = 0x88, /* F14 key*/
kMenuF15Glyph = 0x89, /* F15 key*/
kMenuControlISOGlyph = 0x8A, /* Control key (ISO standard)*/
kMenuEjectGlyph = 0x8C, /* Eject key (available on Mac OS X 10.2 and later)*/
kMenuEisuGlyph = 0x8D, /* Japanese eisu key (available in Mac OS X 10.4 and later)*/
kMenuKanaGlyph = 0x8E /* Japanese kana key (available in Mac OS X 10.4 and later)*/
};