3.7 C
New York
Saturday, February 22, 2025

keyboard – DefaultKeyBinding.dict technique not working to maneuver cursor from phrase to phrase(which is by default choices + left/proper)


There may be at the very least one syntax error in your DefaultKeyBinding.dict code. The instructions also needs to be enclosed between inverted commas. It ought to be:

 {
   "@UF702" = "moveWordLeft:";
   "@UF703" = "moveWordRight:";
   "@$UF702" = "moveWordLeftAndModifySelection:";
   "@$UF703" = "moveWordRightAndModifySelection:";
 }

I need to say, nevertheless, that I do not discover your instructions in Apple’s Cocoa Occasions Dealing with Information. What I do see there are instructions reminiscent of moveWordForward moveWordBackward. I do not discover moveWordLeftAndModifySelection, and I do not know what you need to obtain with it, however perhaps the Cocoa Occasions Dealing with Information (linked above) may also help you.

The follwing is a partial instance of my working setup:

 /* Meta shortcuts (alt key in MacOS) */
   "~f" = "moveWordForward:";          /* Esc f -> Transfer ahead phrase */
   "~b" = "moveWordBackward:";         /* Esc b -> Transfer backward phrase */
   "~c" = ( "capitalizeWord:",         /* Esc c -> Capitalize */
                "moveForward:",
                "moveForward:");
   "~u" = ( "uppercaseWord:",          /* Esc u -> Uppercase */
                "moveForward:",
                "moveForward:");
   "~l" = ( "lowercaseWord:",          /* Esc l -> Lowercase */
                "moveForward:",
                "moveForward:");

 /* insert pairs with C-c adopted by Alt down */
   "~f" = ("insertText:", "‹›");
   "~F" = ("insertText:", "«»");
   "~b" = ("insertText:", "[]");
   "~B" = ("insertText:", "{}");
   "~p" = ("insertText:", "()");

Be aware 1: You’ll be able to substitute the brackets by no matter textual content you’d prefer to insert (your title, electronic mail deal with, cell quantity or no matter string you utilize repetitively).

Be aware 2: Remark out textual content surrounding it with “/* */”.

Be aware 3: Watch out. Since you’ll be able to remap no matter key in your keyboard, keep away from doing it by mistake. When you write "a" = ("insertText:", "b");, everytime you hit the important thing “a” your mac goes to output “b”. When you remap “~r” to output “Robert Doe”, when you hit “~r” as an alternative of “®”, you may (unsurprisingly) get “Robert Doe”. You must ensure that that is the habits you need.

Be aware 4: Not all functions run Cocoa Occasions. Some will solely run a partial set. I nonetheless discover them helpful.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles