private void RootFrame_KeyDown( CoreWindow sender, KeyEventArgs e ) { KeyDown?.Invoke( sender, e ); HoldingKeys[ e.VirtualKey ] = true; List<VirtualKey> Keys = new List<VirtualKey>(); foreach( KeyValuePair<VirtualKey, bool> Key in HoldingKeys ) { if ( Key.Key == VirtualKey.Menu ) continue; if ( Key.Value ) Keys.Add( Key.Key ); } string KeyCombo = GetComboHash( Keys ); #if DEBUG Logger.Log( ID, "Key: " + e.VirtualKey.ToString(), LogType.DEBUG ); #endif if ( RegisteredCombinations.ContainsKey( KeyCombo ) ) { ResetSequence(); } else if( TrySelectSequence( e.VirtualKey, out Keys ) ) { KeyCombo = GetSeqHash( Keys ); ResetSequence(); } else { return; } KeyCombinationEventArgs d = new KeyCombinationEventArgs( Keys.ToArray() ); foreach( Action<KeyCombinationEventArgs> P in RegisteredCombinations[ KeyCombo ] ) { P( d ); if ( d.Handled ) break; } }
private void Escape( KeyCombinationEventArgs e ) { object o = FocusManager.GetFocusedElement(); if ( o != null && SpecialElement.Contains( o.GetType() ) ) return; // Always Close the dialog first if ( Net.Astropenguin.Helpers.Popups.CloseDialog() ) return; NavigationHandler.MasterNavigationHandler( RootFrame, null ); }
private void ScrollBottom( KeyCombinationEventArgs obj ) { ContentView.GoBottom(); }
private void ScrollTop( KeyCombinationEventArgs obj ) { ContentView.GoTop(); }
private void PrevChapter( KeyCombinationEventArgs e ) { ES.StepPrev(); OpenBook( ES.Chapter ); }
private void NextChapter( KeyCombinationEventArgs e ) { ES.StepNext(); OpenBook( ES.Chapter ); }