|
|
|
|
@ -1,5 +1,4 @@ |
|
|
|
|
using MultiTerm.Core.ViewModel; |
|
|
|
|
using System; |
|
|
|
|
using System.Windows.Controls; |
|
|
|
|
|
|
|
|
|
namespace MultiTerm.Wpf.View; |
|
|
|
|
@ -11,4 +10,27 @@ public partial class ShellView : UserControl |
|
|
|
|
InitializeComponent(); |
|
|
|
|
this.DataContext = App.AppHost!.Services.GetService(typeof(ShellViewModel)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
/// Handles key down events for the whole user control. |
|
|
|
|
/// </summary> |
|
|
|
|
/// <param name="sender"></param> |
|
|
|
|
/// <param name="e"></param> |
|
|
|
|
private void UserControl_KeyDown(object sender, System.Windows.Input.KeyEventArgs e) |
|
|
|
|
{ |
|
|
|
|
// move tab forward |
|
|
|
|
if( e.Key == System.Windows.Input.Key.Tab && |
|
|
|
|
e.KeyboardDevice.Modifiers == System.Windows.Input.ModifierKeys.Control ) |
|
|
|
|
{ |
|
|
|
|
this.terminalTabControl.SelectedIndex++; |
|
|
|
|
e.Handled = true; |
|
|
|
|
} |
|
|
|
|
// move tab backwards |
|
|
|
|
else if ( e.Key == System.Windows.Input.Key.Tab && |
|
|
|
|
e.KeyboardDevice.Modifiers == (System.Windows.Input.ModifierKeys.Control & System.Windows.Input.ModifierKeys.Shift) ) |
|
|
|
|
{ |
|
|
|
|
this.terminalTabControl.SelectedIndex--; |
|
|
|
|
e.Handled = true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|