public void AltGrAndEnter()
            {
                // Alt-Gr should not add any modifiers in combination with Enter, so the display name should remain <CR>
                // The #1008 and #1390 issues were caused by VsVim not handling this combination properly.
                var keyInput = KeyInputUtil.ApplyKeyModifiersToKey(VimKey.Enter, VimKeyModifiers.Alt | VimKeyModifiers.Control);

                Assert.Equal("<CR>", KeyNotationUtil.GetDisplayName(keyInput));
            }
 public void Alpha()
 {
     foreach (var c in KeyInputUtilTest.CharLettersUpper)
     {
         var keyInput = KeyInputUtil.CharToKeyInput(c);
         Assert.Equal(c.ToString(), KeyNotationUtil.GetDisplayName(keyInput));
     }
 }
            public void ControlHAndBackspace()
            {
                var left  = KeyInputUtil.CharWithControlToKeyInput('h');
                var right = KeyNotationUtil.StringToKeyInput("<BS>");

                Assert.Equal("<C-H>", KeyNotationUtil.GetDisplayName(left));
                Assert.Equal("<BS>", KeyNotationUtil.GetDisplayName(right));
            }
Beispiel #4
0
 public void NonAlphaWithControl()
 {
     foreach (var c in "()#")
     {
         var keyInput = KeyInputUtil.CharWithControlToKeyInput(c);
         Assert.Equal($"<C-{c}>", KeyNotationUtil.GetDisplayName(keyInput));
     }
 }
 public void NonAlphaWithControl()
 {
     foreach (var c in "()#")
     {
         var keyInput = KeyInputUtil.CharWithControlToKeyInput(c);
         var text     = string.Format("<C-{0}>", c);
         Assert.Equal(text, KeyNotationUtil.GetDisplayName(keyInput));
     }
 }
 public void AlphaLowerAndAlt()
 {
     foreach (var c in KeyInputUtilTest.CharLettersLower)
     {
         var keyInput    = KeyInputUtil.CharWithAltToKeyInput(c);
         var shiftedChar = (char)(0x80 | (int)c);
         Assert.Equal(shiftedChar.ToString(), KeyNotationUtil.GetDisplayName(keyInput));
     }
 }
 public void AlphaLowerAndAltGr()
 {
     // Vim don't let you map Alt-Gr combinations (Ctrl + Alt), intead it should see just the plain character
     // The #1008 and #1390 issues were caused by VsVim not handling those combinations properly.
     foreach (var c in KeyInputUtilTest.CharLettersLower)
     {
         var keyInput = KeyInputUtil.ApplyKeyModifiersToChar(c, VimKeyModifiers.Alt | VimKeyModifiers.Control);
         Assert.Equal(c.ToString(), KeyNotationUtil.GetDisplayName(keyInput));
     }
 }
            public void NamedKeys()
            {
                Action <VimKey, string> func =
                    (vimKey, name) =>
                {
                    var keyInput = KeyInputUtil.VimKeyToKeyInput(vimKey);
                    Assert.Equal(name, KeyNotationUtil.GetDisplayName(keyInput));
                };

                func(VimKey.Enter, "<CR>");
                func(VimKey.Escape, "<Esc>");
                func(VimKey.Delete, "<Del>");
            }
            public void KeypadKeys()
            {
                Action <VimKey, string> func =
                    (vimKey, name) =>
                {
                    var keyInput = KeyInputUtil.VimKeyToKeyInput(vimKey);
                    Assert.Equal(name, KeyNotationUtil.GetDisplayName(keyInput));
                };

                func(VimKey.KeypadEnter, "<kEnter>");
                func(VimKey.KeypadDecimal, "<kPoint>");
                func(VimKey.KeypadPlus, "<kPlus>");
                func(VimKey.KeypadMultiply, "<kMultiply>");
                func(VimKey.KeypadMinus, "<kMinus>");
                func(VimKey.KeypadDivide, "<kDivide>");
            }
Beispiel #10
0
            public void AlphaAndControl()
            {
                foreach (var c in KeyInputUtilTest.CharLettersUpper)
                {
                    var keyInput = KeyInputUtil.CharWithControlToKeyInput(c);

                    // Certain combinations like CTRL-J have a primary key which gets displayed over
                    // them.  Don't test them here
                    if (keyInput.Key != VimKey.None)
                    {
                        continue;
                    }

                    Assert.Equal($"<C-{c}>", KeyNotationUtil.GetDisplayName(keyInput));
                }
            }
Beispiel #11
0
            public void AltGrAndEnter()
            {
                var keyInput = KeyInputUtil.ApplyKeyModifiersToKey(VimKey.Enter, VimKeyModifiers.Alt | VimKeyModifiers.Control);

                Assert.Equal("<C-A-CR>", KeyNotationUtil.GetDisplayName(keyInput));
            }
Beispiel #12
0
            public void FormFeed()
            {
                var keyInputSet = KeyNotationUtil.StringToKeyInputSet("<C-l>");

                Assert.Equal("<C-L>", KeyNotationUtil.GetDisplayName(keyInputSet.FirstKeyInput.Value));
            }