Example #1
0
 public void unbindKey(String keySequence) {
   KeyStroke ks = KeyStroke.getKeyStroke(keySequence);
   if (ks == null) {
     throw new Error("Invalid key sequence \"" + keySequence + "\"");
   }
   textView.getKeymap().removeKeyStrokeBinding(ks);
 }
Example #2
0
 public void bindKeyToCommand(String keySequence, LispExpr cmd) {
   // 	see Java API for info on keySequence format
   KeyStroke ks = KeyStroke.getKeyStroke(keySequence);
   if (ks == null) {
     throw new Error("Invalid key sequence \"" + keySequence + "\"");
   }
   textView.getKeymap().addActionForKeyStroke(ks, new KeyAction(cmd));
 }