protected override void OnKeyUp(KeyRoutedEventArgs args) { base.OnKeyUp(args); var key = args.OriginalKey; var isHandled = args.Handled; isHandled = KeyProcess.KeyUp(key, this); args.Handled = isHandled; }
public string Key2Value(string key) { KeyProcess process = null; if (m_KeyProcess.TryGetValue(key, out process)) { return(process()); } return(key); }
public void RegisterKeyProcess(string key, KeyProcess process) { if (m_KeyProcess == null) { m_KeyProcess = new Dictionary <string, KeyProcess>(); } if (m_KeyProcess.ContainsKey(key)) { Log.w("Already Register Key Process:" + key); return; } m_KeyProcess.Add(key, process); }
protected override void OnKeyDown(KeyRoutedEventArgs args) { // We don't perform any action in OnKeyDown because we wait for the key to be // released before performing a Toggle(). However, if we don't handle OnKeyDown, // it bubbles up to the parent ScrollViewer and may cause scrolling, which is // undesirable. Therefore, we check to see if we will handle OnKeyUp for this key // press, and if so, we set Handled=true for OnKeyDown to stop bubbling this event. base.OnKeyDown(args); var isHandled = args.Handled; if (isHandled || _isDragging) { return; } var key = args.OriginalKey; isHandled = KeyProcess.KeyDown(key, this); args.Handled = isHandled; _handledKeyDown = isHandled; }
private bool OnKeyUpInternal(VirtualKey key) { KeyProcess.KeyUp(key, out var handled, _keyboardNavigationAcceptsReturn, this); return(handled); }
private protected virtual bool OnKeyDownInternal(VirtualKey key) { KeyProcess.KeyDown(key, out var handled, _keyboardNavigationAcceptsReturn, this); return(handled); }