Skip to content

Commit

Permalink
- Added support for Windows 7, 8 and 8.1.
Browse files Browse the repository at this point in the history
- Changed shortcut key to select all the text to match context menu's InputGestureText property of TextArea.
  • Loading branch information
Max DR committed Jun 12, 2020
1 parent 2046e61 commit cb6d156
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
14 changes: 14 additions & 0 deletions ModernNotepad/CustomControls/TextArea.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using ModernNotepadLibrary.Core;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Input;

namespace ModernNotepad.CustomControls
{
Expand All @@ -16,5 +17,18 @@ public TextArea()
}

public void SetFontFamily(string fontFamilyName) => FontFamily = new FontFamily(fontFamilyName);

protected override void OnPreviewKeyDown(KeyEventArgs e)
{
base.OnPreviewKeyDown(e);
if (Keyboard.Modifiers == ModifierKeys.Control && e.Key == Key.A)
{
e.Handled = true;
}
else if (Keyboard.Modifiers == ModifierKeys.Control && e.Key == Key.E)
{
SelectAll();
}
}
}
}
6 changes: 3 additions & 3 deletions ModernNotepad/app.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->

<!-- Windows 7 -->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />

<!-- Windows 8 -->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />

<!-- Windows 8.1 -->
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />

<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
Expand Down

0 comments on commit cb6d156

Please sign in to comment.