@@ -85,107 +85,6 @@ private void CoreWindow_PointerPressed(CoreWindow sender, PointerEventArgs args)
8585 }
8686 }
8787
88- private async void CoreWindow_KeyDown ( CoreWindow sender , KeyEventArgs args )
89- {
90- var ctrl = Window . Current . CoreWindow . GetKeyState ( VirtualKey . Control ) ;
91- var shift = Window . Current . CoreWindow . GetKeyState ( VirtualKey . Shift ) ;
92- var alt = Window . Current . CoreWindow . GetKeyState ( VirtualKey . Menu ) ;
93- if ( App . CurrentInstance != null )
94- {
95- if ( ctrl . HasFlag ( CoreVirtualKeyStates . Down ) )
96- {
97- if ( shift . HasFlag ( CoreVirtualKeyStates . Down ) )
98- {
99- if ( App . CurrentInstance . ContentPage != null )
100- {
101- switch ( args . VirtualKey )
102- {
103- case VirtualKey . N :
104- Window . Current . CoreWindow . KeyDown -= CoreWindow_KeyDown ;
105- await App . addItemDialog . ShowAsync ( ) ;
106- Window . Current . CoreWindow . KeyDown += CoreWindow_KeyDown ;
107- break ;
108- }
109- }
110- }
111- else
112- {
113- if ( App . CurrentInstance . ContentPage != null )
114- {
115- switch ( args . VirtualKey )
116- {
117- case VirtualKey . C :
118- App . CurrentInstance . InteractionOperations . CopyItem_ClickAsync ( null , null ) ;
119- break ;
120- case VirtualKey . X :
121- App . CurrentInstance . InteractionOperations . CutItem_Click ( null , null ) ;
122- break ;
123- case VirtualKey . V :
124- App . CurrentInstance . InteractionOperations . PasteItem_ClickAsync ( null , null ) ;
125- break ;
126- case VirtualKey . A :
127- App . CurrentInstance . InteractionOperations . SelectAllItems ( ) ;
128- break ;
129- }
130- }
131-
132- switch ( args . VirtualKey )
133- {
134- case VirtualKey . N :
135- var filesUWPUri = new Uri ( "files-uwp:" ) ;
136- await Launcher . LaunchUriAsync ( filesUWPUri ) ;
137- break ;
138- case VirtualKey . W :
139- if ( ( ( Window . Current . Content as Frame ) . Content as InstanceTabsView ) . TabStrip . TabItems . Count == 1 )
140- {
141- Application . Current . Exit ( ) ;
142- }
143- else if ( ( ( Window . Current . Content as Frame ) . Content as InstanceTabsView ) . TabStrip . TabItems . Count > 1 )
144- {
145- ( ( Window . Current . Content as Frame ) . Content as InstanceTabsView ) . TabStrip . TabItems . RemoveAt ( ( ( Window . Current . Content as Frame ) . Content as InstanceTabsView ) . TabStrip . SelectedIndex ) ;
146- }
147- break ;
148- }
149- }
150- }
151- else if ( ctrl . HasFlag ( CoreVirtualKeyStates . None ) && alt . HasFlag ( CoreVirtualKeyStates . None ) )
152- {
153- if ( App . CurrentInstance . ContentPage != null )
154- {
155- switch ( args . VirtualKey )
156- {
157- case VirtualKey . Delete :
158- App . CurrentInstance . InteractionOperations . DeleteItem_Click ( null , null ) ;
159- break ;
160- case VirtualKey . Enter :
161- if ( ( App . CurrentInstance . ContentPage ) . IsQuickLookEnabled )
162- {
163- App . CurrentInstance . InteractionOperations . ToggleQuickLook ( ) ;
164- }
165- else
166- {
167- App . CurrentInstance . InteractionOperations . List_ItemClick ( null , null ) ;
168- }
169- break ;
170- }
171-
172- if ( App . CurrentInstance . CurrentPageType == typeof ( PhotoAlbum ) )
173- {
174- switch ( args . VirtualKey )
175- {
176- case VirtualKey . F2 :
177- if ( ( App . CurrentInstance . ContentPage ) . SelectedItems . Count > 0 )
178- {
179- App . CurrentInstance . InteractionOperations . RenameItem_Click ( null , null ) ;
180- }
181- break ;
182- }
183- }
184- }
185- }
186- }
187- }
188-
18988 public static INavigationControlItem rightClickedItem ;
19089
19190 public static async void FlyoutItem_Click ( object sender , RoutedEventArgs e )
@@ -308,7 +207,6 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)
308207
309208 // Ensure the current window is active
310209 Window . Current . Activate ( ) ;
311- Window . Current . CoreWindow . KeyDown += CoreWindow_KeyDown ;
312210 Window . Current . CoreWindow . PointerPressed += CoreWindow_PointerPressed ;
313211 Window . Current . CoreWindow . Dispatcher . AcceleratorKeyActivated += Dispatcher_AcceleratorKeyActivated ;
314212
@@ -369,7 +267,6 @@ protected override void OnActivated(IActivatedEventArgs args)
369267 }
370268 // Ensure the current window is active.
371269 Window . Current . Activate ( ) ;
372- Window . Current . CoreWindow . KeyDown += CoreWindow_KeyDown ;
373270 Window . Current . CoreWindow . PointerPressed += CoreWindow_PointerPressed ;
374271 Window . Current . CoreWindow . Dispatcher . AcceleratorKeyActivated += Dispatcher_AcceleratorKeyActivated ;
375272 return ;
@@ -395,7 +292,6 @@ protected override void OnActivated(IActivatedEventArgs args)
395292
396293 // Ensure the current window is active.
397294 Window . Current . Activate ( ) ;
398- Window . Current . CoreWindow . KeyDown += CoreWindow_KeyDown ;
399295 Window . Current . CoreWindow . PointerPressed += CoreWindow_PointerPressed ;
400296 Window . Current . CoreWindow . Dispatcher . AcceleratorKeyActivated += Dispatcher_AcceleratorKeyActivated ;
401297
@@ -404,7 +300,6 @@ protected override void OnActivated(IActivatedEventArgs args)
404300 rootFrame . Navigate ( typeof ( InstanceTabsView ) , null , new SuppressNavigationTransitionInfo ( ) ) ;
405301 // Ensure the current window is active.
406302 Window . Current . Activate ( ) ;
407- Window . Current . CoreWindow . KeyDown += CoreWindow_KeyDown ;
408303 Window . Current . CoreWindow . PointerPressed += CoreWindow_PointerPressed ;
409304 Window . Current . CoreWindow . Dispatcher . AcceleratorKeyActivated += Dispatcher_AcceleratorKeyActivated ;
410305 return ;
@@ -418,7 +313,6 @@ protected override void OnActivated(IActivatedEventArgs args)
418313
419314 // Ensure the current window is active.
420315 Window . Current . Activate ( ) ;
421- Window . Current . CoreWindow . KeyDown += CoreWindow_KeyDown ;
422316 Window . Current . CoreWindow . PointerPressed += CoreWindow_PointerPressed ;
423317 Window . Current . CoreWindow . Dispatcher . AcceleratorKeyActivated += Dispatcher_AcceleratorKeyActivated ;
424318 }
0 commit comments