Custom Keyboard Shortcuts: Difference between revisions

From kJams Wiki
Jump to navigation Jump to search
No edit summary
 
No edit summary
Line 44: Line 44:


You should now have custom a keyboard shortcut for that item.
You should now have custom a keyboard shortcut for that item.
There are some exceptions currently, which I'll remove if people complain:
<pre>
kMenuItemID_FILE_SHOW_ORIGINAL must have shift
kMenuItemID_FILE_PAGE_SETUP must have shift
kMenuItemID_EDIT_REDO must have shift
kMenuItemID_EDIT_CLEAR can not have command, glyph is backward delete
kMenuItemID_EDIT_DESELECT_ALL must have shift
kMenuItemID_EDIT_FIND_IN_LIBRARY must have shift
kMenuItemID_CONTROLS_PLAY can not have command
kMenuItemID_CONTROLS_NEXT_SONG can not have command, glyph is right arrow
kMenuItemID_CONTROLS_PREV_SONG can not have command, glyph is left arrow
kMenuItemID_CONTROLS_VOL_UP glyph is up arrow
kMenuItemID_CONTROLS_VOL_DOWN glyph is down arrow
kMenuItemID_CONTROLS_MUTE glyph is down arrow, ??must have option??
kMenuItemID_CONTROLS_KILL_LEFT_CHANNEL must have option
kMenuItemID_CONTROLS_KILL_RIGHT_CHANNEL must have option
kMenuItemID_CONTROLS_KILL_CENTER_CHANNEL must have option
all graphic channels can not have command, must have control
graphic channels above 9 same as above, plus must have shift
kMenuItemID_CONTROLS_TEMPO_UP must have shift
kMenuItemID_CONTROLS_TEMPO_DOWN must have shift
kMenuItemID_CONTROLS_TEMPO_NORMAL must have shift
</pre>

Revision as of 07:18, 26 October 2007

kJams allows you to customize almost all keyboard shortcuts. To do this you create a special file named "Keyboard.txt" containing your modifications and you place it in the folder:

/Users/(your user)/Library/Preferences/kJams/

Here is an example file:

#	a comment line must begin with a pound sign (#), blank lines are ignored

#	modifier keys are as follows
#	a = apple key
#	s = shift key
#	o = option key
#	c = control key
#	they may come in any order, eg: "asoc" is the same as "oacs"
#	they must be followed by a dash character, eg: -
#	followed by the UNMODIFIED version of the key you want to use
#	ie: if you want shift-S then specify "s-s", not "s-S"
#	ergo: you can not use keys which require shifting, controlling, or optioning
#	eg: the @ sign is not legal (shift 2 on US keyboards), but you can use "s-2"

# lines must end with a semi-colon: ;

"Menu/Controls/Pitch Down" = "a-t";
"Menu/Controls/Pitch Up" = "a-y";
"Menu/Controls/Original Pitch" = "a-u";
"Menu/Controls/Tempo Slower" = "as-t";
"Menu/Controls/Tempo Faster" = "as-y";
"Menu/Controls/Original Tempo" = "as-u";

To download this file, click here.

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:

  1. In the Finder, context-click (which means control- or right- click) on the kJams application icon, and pick "Show Package Contents"
  2. Inside that folder, navigate to this file:
    Contents/Resources/English.lproj/Menus.strings
  3. Copy the Menus.strings file to the desktop
  4. Rename it so it says Menus.txt (it is after all just a text file)
  5. double click it --> TextEdit should now launch
  6. before you do anything, go to TextEdit->Preferences, and under "Format" pick "Plain Text", this is important
  7. Now make a new text document, save it, call it "Keyboard.txt"
  8. 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";
  9. Now type that line into "Keyboard.txt". 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)
  10. Now in your new document, delete all the text inside the quotes on the right hand side of the equals sign (=) (don't delete the quotes!)
  11. Type something like a-y (this stands for ⌘-Y, "a" for "apple"), save
  12. Place that file in the correct location (see top of this page)
  13. run kJams.

You should now have custom a keyboard shortcut for that item.

There are some exceptions currently, which I'll remove if people complain:

kMenuItemID_FILE_SHOW_ORIGINAL				must have shift
kMenuItemID_FILE_PAGE_SETUP				must have shift
kMenuItemID_EDIT_REDO					must have shift
kMenuItemID_EDIT_CLEAR					can not have command, glyph is backward delete
kMenuItemID_EDIT_DESELECT_ALL				must have shift
kMenuItemID_EDIT_FIND_IN_LIBRARY			must have shift
kMenuItemID_CONTROLS_PLAY				can not have command
kMenuItemID_CONTROLS_NEXT_SONG				can not have command, glyph is right arrow
kMenuItemID_CONTROLS_PREV_SONG				can not have command, glyph is left arrow
kMenuItemID_CONTROLS_VOL_UP				glyph is up arrow
kMenuItemID_CONTROLS_VOL_DOWN				glyph is down arrow
kMenuItemID_CONTROLS_MUTE				glyph is down arrow, ??must have option??
kMenuItemID_CONTROLS_KILL_LEFT_CHANNEL			must have option
kMenuItemID_CONTROLS_KILL_RIGHT_CHANNEL			must have option
kMenuItemID_CONTROLS_KILL_CENTER_CHANNEL		must have option
all graphic channels					can not have command, must have control
graphic channels above 9				same as above, plus must have shift
kMenuItemID_CONTROLS_TEMPO_UP				must have shift
kMenuItemID_CONTROLS_TEMPO_DOWN				must have shift
kMenuItemID_CONTROLS_TEMPO_NORMAL			must have shift