Skip to content

Commit

Permalink
Fix issue preventing assignment of Function keys
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianlungu committed Nov 29, 2020
1 parent 1ddc4d4 commit 6c6c349
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions ScreenSleep/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref b
{
if (msg == 0x0312 && wParam.ToInt32() == Settings.HotkeyId)
{


Task.Delay(1000 * Properties.Settings.Default.SleepTimer).ContinueWith(t => TurnOff_OnClick(null, null));
}

Expand Down
4 changes: 2 additions & 2 deletions ScreenSleep/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.4")]
[assembly: AssemblyFileVersion("1.0.0.4")]
[assembly: AssemblyVersion("1.0.0.5")]
[assembly: AssemblyFileVersion("1.0.0.5")]
7 changes: 6 additions & 1 deletion ScreenSleep/Settings.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,14 @@ public static void SetupSleepShortcut(WindowInteropHelper helper)
{
var shortcut = Properties.Settings.Default.SleepShortcut.ToLower();

string keyString = shortcut.Substring(shortcut.Length - 1);
string keyString = shortcut;
var modifiers = 0;

if (shortcut.Contains("+"))
{
keyString = shortcut.Substring(shortcut.Length - 1);
}

if (shortcut.Contains("alt"))
{
modifiers += 1;
Expand Down

0 comments on commit 6c6c349

Please sign in to comment.