mirror of
				https://github.com/2dust/v2rayN.git
				synced 2025-11-04 06:22:52 +00:00 
			
		
		
		
	
						commit
						0bde282448
					
				
					 2 changed files with 16 additions and 11 deletions
				
			
		| 
						 | 
				
			
			@ -72,7 +72,8 @@
 | 
			
		|||
                    VerticalAlignment="Top"
 | 
			
		||||
                    AcceptsReturn="True"
 | 
			
		||||
                    IsReadOnly="True"
 | 
			
		||||
                    Style="{StaticResource MyOutlinedTextBox}" />
 | 
			
		||||
                    Style="{StaticResource MyOutlinedTextBox}"
 | 
			
		||||
                    PreviewKeyDown="TxtGlobalHotkey_PreviewKeyDown" />
 | 
			
		||||
 | 
			
		||||
                <TextBlock
 | 
			
		||||
                    Grid.Row="2"
 | 
			
		||||
| 
						 | 
				
			
			@ -89,7 +90,8 @@
 | 
			
		|||
                    VerticalAlignment="Top"
 | 
			
		||||
                    AcceptsReturn="True"
 | 
			
		||||
                    IsReadOnly="True"
 | 
			
		||||
                    Style="{StaticResource MyOutlinedTextBox}" />
 | 
			
		||||
                    Style="{StaticResource MyOutlinedTextBox}"
 | 
			
		||||
                    PreviewKeyDown="TxtGlobalHotkey_PreviewKeyDown" />
 | 
			
		||||
 | 
			
		||||
                <TextBlock
 | 
			
		||||
                    Grid.Row="3"
 | 
			
		||||
| 
						 | 
				
			
			@ -106,7 +108,8 @@
 | 
			
		|||
                    VerticalAlignment="Top"
 | 
			
		||||
                    AcceptsReturn="True"
 | 
			
		||||
                    IsReadOnly="True"
 | 
			
		||||
                    Style="{StaticResource MyOutlinedTextBox}" />
 | 
			
		||||
                    Style="{StaticResource MyOutlinedTextBox}"
 | 
			
		||||
                    PreviewKeyDown="TxtGlobalHotkey_PreviewKeyDown" />
 | 
			
		||||
                <TextBlock
 | 
			
		||||
                    Grid.Row="4"
 | 
			
		||||
                    Grid.Column="0"
 | 
			
		||||
| 
						 | 
				
			
			@ -122,7 +125,8 @@
 | 
			
		|||
                    VerticalAlignment="Top"
 | 
			
		||||
                    AcceptsReturn="True"
 | 
			
		||||
                    IsReadOnly="True"
 | 
			
		||||
                    Style="{StaticResource MyOutlinedTextBox}" />
 | 
			
		||||
                    Style="{StaticResource MyOutlinedTextBox}"
 | 
			
		||||
                    PreviewKeyDown="TxtGlobalHotkey_PreviewKeyDown" />
 | 
			
		||||
                <TextBlock
 | 
			
		||||
                    Grid.Row="5"
 | 
			
		||||
                    Grid.Column="0"
 | 
			
		||||
| 
						 | 
				
			
			@ -138,7 +142,8 @@
 | 
			
		|||
                    VerticalAlignment="Top"
 | 
			
		||||
                    AcceptsReturn="True"
 | 
			
		||||
                    IsReadOnly="True"
 | 
			
		||||
                    Style="{StaticResource MyOutlinedTextBox}" />
 | 
			
		||||
                    Style="{StaticResource MyOutlinedTextBox}"
 | 
			
		||||
                    PreviewKeyDown="TxtGlobalHotkey_PreviewKeyDown" />
 | 
			
		||||
            </Grid>
 | 
			
		||||
 | 
			
		||||
            <TextBlock
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -20,11 +20,11 @@ namespace v2rayN.Views
 | 
			
		|||
            _config = LazyConfig.Instance.GetConfig();
 | 
			
		||||
            _config.globalHotkeys ??= new List<KeyEventItem>();
 | 
			
		||||
 | 
			
		||||
            txtGlobalHotkey0.KeyDown += TxtGlobalHotkey_KeyDown;
 | 
			
		||||
            txtGlobalHotkey1.KeyDown += TxtGlobalHotkey_KeyDown;
 | 
			
		||||
            txtGlobalHotkey2.KeyDown += TxtGlobalHotkey_KeyDown;
 | 
			
		||||
            txtGlobalHotkey3.KeyDown += TxtGlobalHotkey_KeyDown;
 | 
			
		||||
            txtGlobalHotkey4.KeyDown += TxtGlobalHotkey_KeyDown;
 | 
			
		||||
            txtGlobalHotkey0.KeyDown += TxtGlobalHotkey_PreviewKeyDown;
 | 
			
		||||
            txtGlobalHotkey1.KeyDown += TxtGlobalHotkey_PreviewKeyDown;
 | 
			
		||||
            txtGlobalHotkey2.KeyDown += TxtGlobalHotkey_PreviewKeyDown;
 | 
			
		||||
            txtGlobalHotkey3.KeyDown += TxtGlobalHotkey_PreviewKeyDown;
 | 
			
		||||
            txtGlobalHotkey4.KeyDown += TxtGlobalHotkey_PreviewKeyDown;
 | 
			
		||||
 | 
			
		||||
            HotkeyHandler.Instance.IsPause = true;
 | 
			
		||||
            this.Closing += (s, e) => HotkeyHandler.Instance.IsPause = false;
 | 
			
		||||
| 
						 | 
				
			
			@ -45,7 +45,7 @@ namespace v2rayN.Views
 | 
			
		|||
            BindingData();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private void TxtGlobalHotkey_KeyDown(object sender, KeyEventArgs e)
 | 
			
		||||
        private void TxtGlobalHotkey_PreviewKeyDown(object sender, KeyEventArgs e)
 | 
			
		||||
        {
 | 
			
		||||
            e.Handled = true;
 | 
			
		||||
            var _ModifierKeys = new Key[] { Key.LeftCtrl, Key.RightCtrl, Key.LeftShift,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in a new issue