private KeyboardMap GetOrCreateKeyboardMap() { var keyboardId = NativeMethods.GetKeyboardLayout(0); if (_keyboardMap == null || _keyboardMap.KeyboardId != keyboardId) { _keyboardMap = new KeyboardMap(keyboardId); } return(_keyboardMap); }
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); }
internal KeyInput GetKeyInput(char c, ModifierKeys modifierKeys) { return(KeyboardMap.GetKeyInput(c, IsAltGr(modifierKeys) ? ModifierKeys.None : modifierKeys)); }
internal static KeyModifiers GetKeyModifiers(ModifierKeys keys) { return(KeyboardMap.ConvertToKeyModifiers(keys)); }
private KeyboardMap GetOrCreateKeyboardMap() { var keyboardId = NativeMethods.GetKeyboardLayout(0); if (_keyboardMap == null || _keyboardMap.KeyboardId != keyboardId) { _keyboardMap = new KeyboardMap(keyboardId); } return _keyboardMap; }
public FakeKeyboardTest() { _mockVirtualKeyboard = new MockVirtualKeyboard(); _map = new KeyboardMap(IntPtr.Zero, _mockVirtualKeyboard); }
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); } }
KeyModifiers IKeyUtil.GetKeyModifiers(ModifierKeys modifierKeys) { return(KeyboardMap.ConvertToKeyModifiers(modifierKeys)); }