public static void setupQwertyDirButtons(VEightDirButtonBatch bts) { var dirs = new [] { Dir9.NW, Dir9.N, Dir9.NE, Dir9.W, Dir9.E, Dir9.SW, Dir9.S, Dir9.SE, }; var leftQwerty = new [] { Keys.Q, Keys.W, Keys.E, Keys.A, Keys.D, Keys.Z, Keys.X, Keys.C, }; var vimQwerty = new [] { Keys.Y, Keys.K, Keys.U, Keys.H, Keys.L, Keys.B, Keys.J, Keys.N, }; var keysZipped = new [] { leftQwerty, vimQwerty }; for (int i = 0; i < dirs.Length; i++) { bts.dirNode(dirs[i]) .addKeyboardKeys(keysZipped.Select(keys => keys[i])); } }
static void setupCommonDirButtons(VEightDirButtonBatch bts) { // keys to be zipped var numpads = new [] { Keys.NumPad7, Keys.NumPad8, Keys.NumPad9, Keys.NumPad4, Keys.NumPad6, Keys.NumPad1, Keys.NumPad2, Keys.NumPad3, }; var digits = new [] { Keys.D7, Keys.D8, Keys.D9, Keys.D4, Keys.D6, Keys.D1, Keys.D2, Keys.D3, }; var dirs = new [] { Dir9.NW, Dir9.N, Dir9.NE, Dir9.W, Dir9.E, Dir9.SW, Dir9.S, Dir9.SE, }; var keysZipped = new [] { numpads, digits, }; for (int i = 0; i < dirs.Length; i++) { bts.dirNode(dirs[i]) .addKeyboardKeys(keysZipped.Select(keys => keys[i])); } }