@@ -85,107 +85,6 @@ private void CoreWindow_PointerPressed(CoreWindow sender, PointerEventArgs args)
85
85
}
86
86
}
87
87
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
-
189
88
public static INavigationControlItem rightClickedItem ;
190
89
191
90
public static async void FlyoutItem_Click ( object sender , RoutedEventArgs e )
@@ -308,7 +207,6 @@ protected override void OnLaunched(LaunchActivatedEventArgs e)
308
207
309
208
// Ensure the current window is active
310
209
Window . Current . Activate ( ) ;
311
- Window . Current . CoreWindow . KeyDown += CoreWindow_KeyDown ;
312
210
Window . Current . CoreWindow . PointerPressed += CoreWindow_PointerPressed ;
313
211
Window . Current . CoreWindow . Dispatcher . AcceleratorKeyActivated += Dispatcher_AcceleratorKeyActivated ;
314
212
@@ -369,7 +267,6 @@ protected override void OnActivated(IActivatedEventArgs args)
369
267
}
370
268
// Ensure the current window is active.
371
269
Window . Current . Activate ( ) ;
372
- Window . Current . CoreWindow . KeyDown += CoreWindow_KeyDown ;
373
270
Window . Current . CoreWindow . PointerPressed += CoreWindow_PointerPressed ;
374
271
Window . Current . CoreWindow . Dispatcher . AcceleratorKeyActivated += Dispatcher_AcceleratorKeyActivated ;
375
272
return ;
@@ -395,7 +292,6 @@ protected override void OnActivated(IActivatedEventArgs args)
395
292
396
293
// Ensure the current window is active.
397
294
Window . Current . Activate ( ) ;
398
- Window . Current . CoreWindow . KeyDown += CoreWindow_KeyDown ;
399
295
Window . Current . CoreWindow . PointerPressed += CoreWindow_PointerPressed ;
400
296
Window . Current . CoreWindow . Dispatcher . AcceleratorKeyActivated += Dispatcher_AcceleratorKeyActivated ;
401
297
@@ -404,7 +300,6 @@ protected override void OnActivated(IActivatedEventArgs args)
404
300
rootFrame . Navigate ( typeof ( InstanceTabsView ) , null , new SuppressNavigationTransitionInfo ( ) ) ;
405
301
// Ensure the current window is active.
406
302
Window . Current . Activate ( ) ;
407
- Window . Current . CoreWindow . KeyDown += CoreWindow_KeyDown ;
408
303
Window . Current . CoreWindow . PointerPressed += CoreWindow_PointerPressed ;
409
304
Window . Current . CoreWindow . Dispatcher . AcceleratorKeyActivated += Dispatcher_AcceleratorKeyActivated ;
410
305
return ;
@@ -418,7 +313,6 @@ protected override void OnActivated(IActivatedEventArgs args)
418
313
419
314
// Ensure the current window is active.
420
315
Window . Current . Activate ( ) ;
421
- Window . Current . CoreWindow . KeyDown += CoreWindow_KeyDown ;
422
316
Window . Current . CoreWindow . PointerPressed += CoreWindow_PointerPressed ;
423
317
Window . Current . CoreWindow . Dispatcher . AcceleratorKeyActivated += Dispatcher_AcceleratorKeyActivated ;
424
318
}
0 commit comments