Exemple #1
0
        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;
            }
        }
Exemple #2
0
        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 );
        }
Exemple #3
0
 private void ScrollBottom( KeyCombinationEventArgs obj )
 {
     ContentView.GoBottom();
 }
Exemple #4
0
 private void ScrollTop( KeyCombinationEventArgs obj )
 {
     ContentView.GoTop();
 }
Exemple #5
0
 private void PrevChapter( KeyCombinationEventArgs e )
 {
     ES.StepPrev();
     OpenBook( ES.Chapter );
 }
Exemple #6
0
 private void NextChapter( KeyCombinationEventArgs e )
 {
     ES.StepNext();
     OpenBook( ES.Chapter );
 }