예제 #1
0
        private KeyboardMap GetOrCreateKeyboardMap()
        {
            var keyboardId = NativeMethods.GetKeyboardLayout(0);

            if (_keyboardMap == null || _keyboardMap.KeyboardId != keyboardId)
            {
                _keyboardMap = new KeyboardMap(keyboardId);
            }

            return(_keyboardMap);
        }
예제 #2
0
        bool IKeyUtil.TryConvertSpecialToKeyInput(Key key, ModifierKeys modifierKeys, out KeyInput keyInput)
        {
            if (WpfKeyToKeyInputMap.TryGetValue(key, out keyInput))
            {
                var keyModifiers = KeyboardMap.ConvertToKeyModifiers(modifierKeys);
                keyInput = KeyInputUtil.ApplyModifiers(keyInput, keyModifiers);
                return(true);
            }

            keyInput = null;
            return(false);
        }
예제 #3
0
 internal KeyInput GetKeyInput(char c, ModifierKeys modifierKeys)
 {
     return(KeyboardMap.GetKeyInput(c, IsAltGr(modifierKeys) ? ModifierKeys.None : modifierKeys));
 }
예제 #4
0
 internal static KeyModifiers GetKeyModifiers(ModifierKeys keys)
 {
     return(KeyboardMap.ConvertToKeyModifiers(keys));
 }
예제 #5
0
파일: KeyUtil.cs 프로젝트: 0-F/VsVim
        private KeyboardMap GetOrCreateKeyboardMap()
        {
            var keyboardId = NativeMethods.GetKeyboardLayout(0);
            if (_keyboardMap == null || _keyboardMap.KeyboardId != keyboardId)
            {
                _keyboardMap = new KeyboardMap(keyboardId);
            }

            return _keyboardMap;
        }
예제 #6
0
 public FakeKeyboardTest()
 {
     _mockVirtualKeyboard = new MockVirtualKeyboard();
     _map = new KeyboardMap(IntPtr.Zero, _mockVirtualKeyboard);
 }
예제 #7
0
 public void Setup(string id)
 {
     if (String.IsNullOrEmpty(id))
     {
         _customId = IntPtr.Zero;
         _map = new KeyboardMap(NativeMethods.GetKeyboardLayout(0));
     }
     else
     {
         _customId = NativeMethods.LoadKeyboardLayout(id, 0, out _mustUnloadLayout);
         Assert.NotEqual(IntPtr.Zero, _customId);
         _map = new KeyboardMap(_customId);
     }
 }
예제 #8
0
 KeyModifiers IKeyUtil.GetKeyModifiers(ModifierKeys modifierKeys)
 {
     return(KeyboardMap.ConvertToKeyModifiers(modifierKeys));
 }