SideBySide2: Restore some old keybindings and fix help popup

Disable reverse search, restore "?" for help popup.
Map Ctrl+F to searching in CodeMirror, map Space to PageDown.
Take Ctrl+A back from Vim mode for selecting all text.
Disable Ctrl+O in Vim keymap since it's used by some browsers.
Add explanation of key commands to help popup.

'/' still starts a CodeMirror search instead of a Gerrit one.
Jumping within Gerrit using the 'g' prefix is still not supported.

Change-Id: Id77faa4b36add35c78edfd0d7d0611279cbe7120
This commit is contained in:
Michael Zhou
2013-11-07 05:50:19 -05:00
parent 3f6563d0a3
commit 6a45079cb6
8 changed files with 41 additions and 2 deletions

View File

@@ -24,6 +24,7 @@ public abstract class KeyCommand implements KeyPressHandler {
public static final int M_CTRL = 1 << 16;
public static final int M_ALT = 2 << 16;
public static final int M_META = 4 << 16;
public static final int M_SHIFT = 8 << 16;
public static boolean same(final KeyCommand a, final KeyCommand b) {
return a.getClass() == b.getClass() && a.helpText.equals(b.helpText);
@@ -58,6 +59,9 @@ public abstract class KeyCommand implements KeyPressHandler {
if ((keyMask & M_META) == M_META) {
modifier(b, KeyConstants.I.keyMeta());
}
if ((keyMask & M_SHIFT) == M_SHIFT) {
modifier(b, KeyConstants.I.keyShift());
}
final char c = (char) (keyMask & 0xffff);
switch (c) {

View File

@@ -32,6 +32,7 @@ public interface KeyConstants extends Constants {
String keyCtrl();
String keyAlt();
String keyMeta();
String keyShift();
String keyEnter();
String keyEsc();
}

View File

@@ -10,5 +10,6 @@ thenOtherKey = then
keyCtrl = Ctrl
keyAlt = Alt
keyMeta = Meta
keyShift = Shift
keyEnter = Enter
keyEsc = Esc