diff --git a/README.md b/README.md index 3422b13..0dabb5b 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ -[Current Version: 1.2.1.0](https://github.com/shriprem/StayAwake/blob/main/VersionHistory.md) +[Current Version: 1.3.0.0](https://github.com/shriprem/StayAwake/blob/main/VersionHistory.md) StayAwake is a simple utility that enables you to maintain an _Active_ status on Microsoft Teams (and perhaps other messaging applications such as Slack and Zoom). StayAwake also prevents screen saver activation, screen blanking, and Windows session lockouts. @@ -26,16 +26,21 @@ StayAwake executable is now digitally signed by the kind folks at [OSSign](https ## User Interface ![StayAwake UI](images/StayAwakeApp.png) -#### StayAwake Key simulation list -For most users, the default choice of *Scroll Lock cycling* will work just fine. See the [Key Simulation Options](#key-simulation-options) section below for more info. +#### Select multiple Key Codes for random simulation +StayAwake can randomly pick any of the 12 key codes during each simulation. Users can specify _at least_ one OR a select few OR all of the 12 key codes to be included in the simulation roster. See the [Select multiple Key Codes](#select-multiple-key-codes) section below for more info. -#### Seconds between Awakes field -This field allows you to specify the interval between key simulations. The initial default value for this is 240 seconds (_i.e._, 4 minutes). However, you can change this to any value between 10 and 9990 seconds. Your new value will be saved and used the next time you run StayAwake. +#### Minimum Awake Seconds +This field allows you to specify the minimum interval between key simulations. The initial default value for this is 240 seconds (_i.e._, 4 minutes). However, you can change this to any value between 10 and 9990 seconds. Your new value will be saved and used the next time you run StayAwake. + +#### Maximum Awake Seconds +This field allows you to specify the maximum interval between key simulations. The initial default value for this is 240 seconds (_i.e._, 4 minutes). However, you can change this to any value between 10 and 9990 seconds. Your new value will be saved and used the next time you run StayAwake. #### Set Timer button -After changing the value for *Seconds between Awakes*, click this button to apply the new setting. Clicking this button will also immediately run a StayAwake Key simulation. +After changing the value for either *Minimum Awake Seconds* or *Maximum Awake Seconds*, click this button to apply the new setting. Clicking this button will also immediately invoke an Awake event. + +After every Awake event, a random number of seconds (between the specified minimum and maximum seconds) will be picked to run the next Awake event. -The clock times of when the StayAwake event was last run, and when it will do so next are displayed and continually refreshed on the StayAwake window. +The clock times of the last and next Awake events will be displayed and continually refreshed on the StayAwake window. The randomly picked key code used for the last Awake will also be displayed below the last Awake time. #### Pause button Click this button to pause StayAwake Key simulations. @@ -62,15 +67,14 @@ Check the _Launch application in minimized state_ box to have StayAwake automati When the _Start Minimized_ option is enabled, StayAwake will launch and minimize immediately only on the first launch attempt. If StayAwake is still running in a minimized state, trying to launch the application again will restore the StayAwake dialog from the minimized state. This is by design when `MultipleInstancesAllowed=N`. See under: [Configuration File Details](#configuration-file-details) -### Key Simulation Options +### Select multiple Key Codes ![StayAwake UI](images/StayAwakeKeySelections.png) +StayAwake can randomly pick any of the 12 key codes during each simulation. In this popup, users can specify _at least_ one OR a select few OR all of the 12 key codes to be included in the simulation roster. #### Scroll Lock cycling -This is the default option, and it will work just fine for most users. - -However, some users using Remote Desktop alongside have reported spurious keystrokes being transmitted between the connected Windows devices. Users in such situations should explore other key simulation options. +Scroll Lock toggling will work just fine for most users. However, some users using Remote Desktop alongside have reported spurious keystrokes being transmitted between the connected Windows devices. Users in such situations should explore other key simulation options. #### Volume Up & Down With this option, StayAwake will simulate a _Volume Down_ key press, immediately followed by a _Volume Up_ key press, thereby resulting in no net change in volume level. @@ -84,10 +88,10 @@ With these options, StayWake will simulate key press of an unassigned keycode. These unassigned keycodes have been obtained from this Microsoft article on [Virtual-Key Codes](https://learn.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes). -Microsoft may start utilizing any of these unassigned codes in the future -- but not all of them in one go. Hence all 10 of the currently unassigned codes have been included in the [StayAwake Key Simulation list](#stayawake--key-simulation-list) so that users can switch to another still available unassigned keycode. +Microsoft may start utilizing any of these unassigned codes in the future -- but not all of them in one go. Hence all 10 of the currently unassigned codes have been included in the [Select multiple Key Codes](#select-multiple-key-codes) popup so that users can select other still available unassigned keycodes. #### Optional Tip - You can verify StayAwake in action by *temporarily* setting the StayAwake Key simulation selection to [Volume Up & Down](#volume-up--down) and the [Seconds between Awakes](#seconds-between-awakes-field) to 10 seconds. + You can verify StayAwake in action by *temporarily* enabling only the [Volume Up & Down](#volume-up--down) key code and setting both *Minimum Awake Seconds* and *Maximum Awake Seconds* fields to 10 seconds. ### System Tray Icon @@ -103,17 +107,21 @@ When you minimize StayAwake, it will be represented by the System Tray icon show ## Configuration File Details StayAwake saves its configuration in a file named `StayAwake.ini`. This file is co-located in the `StayAwake.exe` application file folder. These key-value pairs are stored in this file: -1. `AwakeKeyCode`: This key stores a numeric value between 0 and 11 to indicate the selection for the [StayAwake Key simulation](#stayawake-key-simulation-list) list. +1. `SelectedKeyCodes`: This key stores a string of 12 characters -- each character indicating if a key code in the [Select multiple Key Codes](#select-multiple-key-codes) popup is selected or not with either a `1` or `0`, respectively. + +2. `MinimumIntervalInSeconds`: This key stores the minimum number of seconds between each StayAwake Key simulation as specified in the [Minimum Awake Seconds](#minimum-awake-seconds) field. + + The `MinimumIntervalInSeconds` value must be an integer between 10 and 9990. Values outside this range will be ignored and the default value of 240 seconds will be used instead. -2. `SecondsBetweenToggles`: This key stores the number of seconds between each StayAwake Key simulation as specified in the [Seconds between Awakes](#seconds-between-awakes-field) field. +3. `MaximumIntervalInSeconds`: This key stores the maximum number of seconds between each StayAwake Key simulation as specified in the [Maximum Awake Seconds](#maximum-awake-seconds) field. - The `TimerIntervalInSeconds` value must be an integer between 10 and 9990. Values outside this range will be ignored and the default value of 240 seconds will be used instead. + The `MaximumIntervalInSeconds` value must be an integer between 10 and 9990. Values outside this range will be ignored and the default value of 240 seconds will be used instead. -3. `AwakePaused`: This key stores a flag value (_Y_ or _N_) to indicate if StayAwake is in paused state. +4. `AwakePaused`: This key stores a flag value (_Y_ or _N_) to indicate if StayAwake is in paused state. -4. `StartMinimized`: This key stores a flag value (_Y_ or _N_) to indicate if StayAwake will automatically minimize to System Tray upon launch. See: [Start Minimized](#start-minimized) +5. `StartMinimized`: This key stores a flag value (_Y_ or _N_) to indicate if StayAwake will automatically minimize to System Tray upon launch. See: [Start Minimized](#start-minimized) -5. `MultipleInstancesAllowed`: This key stores a flag value (_Y_ or _N_) to indicate whether multiple instances of StayAwake are allowed to run simultaneously. The default value is _N_ (i.e., multiple instances are not allowed). Any value that is not _Y_ will be interpreted as _N_. +6. `MultipleInstancesAllowed`: This key stores a flag value (_Y_ or _N_) to indicate whether multiple instances of StayAwake are allowed to run simultaneously. The default value is _N_ (i.e., multiple instances are not allowed). Any value that is not _Y_ will be interpreted as _N_. ## Alternatives diff --git a/StayAwake/StayAwake.h b/StayAwake/StayAwake.h index dd11107..90afaa4 100644 --- a/StayAwake/StayAwake.h +++ b/StayAwake/StayAwake.h @@ -6,7 +6,7 @@ #include "resource.h" -constexpr auto LAST_CODE_UPDATE_TIME = "Sep 20 2026 - 17:55:42"; +constexpr auto LAST_CODE_UPDATE_TIME = "Sep 21 2026 - 10:19:42"; class CStayAwakeApp : public CWinApp diff --git a/VersionHistory.md b/VersionHistory.md index c8199a7..760863d 100644 --- a/VersionHistory.md +++ b/VersionHistory.md @@ -1,5 +1,22 @@ ## Version History +### Version 1.3.0.0 [September 21, 2026] + +1. StayAwake will use a random pick from a roster of user-specified key codes for each Awake event. See enhancement request: [#15](https://github.com/shriprem/StayAwake/issues/15). + +2. StayAwake will use random interval between minimum & maximum seconds for each Awake event. See enhancement request: [#15](https://github.com/shriprem/StayAwake/issues/15). + +3. StayAwake will use `StayAwake.ini` configuration file located in the same directory as the `StayAwake.exe` executable file regardless of how the application is invoked. Resolves issue: [#10](https://github.com/shriprem/StayAwake/issues/10). + +#### Notes for users upgrading from previous versions of StayAwake +1. The user's choice for Key Simulation in the previous versions will be used as the only enabled key code in this new version. Users will need to use the [Select multiple Key Codes](https://github.com/shriprem/StayAwake?tab=readme-ov-file#select-multiple-key-codes) popup to specify multiple key codes to enable Awakes with random key simulations. + +2. The user-specified value for the *Seconds between Awakes* field in the previous versions will be used to fill both [Minimum Awake Seconds](https://github.com/shriprem/StayAwake?tab=readme-ov-file#minimum-awake-seconds) and [Maximum Awake Seconds](https://github.com/shriprem/StayAwake?tab=readme-ov-file#maximum-awake-seconds) fields in this new version. Users will need to specify a different value for these two new fields to enable a random interval between Awake events. + +**Release:** [1.3.0.0 Release](https://github.com/shriprem/StayAwake/releases/tag/v1.3.0.0) + +--- + ### Version 1.2.1.0 [January 1, 2026] 1. Added a checkbox option to have StayAwake automatically minimize to System Tray upon launch. See issue: [#8](https://github.com/shriprem/StayAwake/issues/8) diff --git a/images/StayAwakeApp.png b/images/StayAwakeApp.png index 8ea7f98..854f485 100644 Binary files a/images/StayAwakeApp.png and b/images/StayAwakeApp.png differ diff --git a/images/StayAwakeKeySelections.png b/images/StayAwakeKeySelections.png index b64f821..89bcac5 100644 Binary files a/images/StayAwakeKeySelections.png and b/images/StayAwakeKeySelections.png differ diff --git a/images/StayAwakePaused.png b/images/StayAwakePaused.png index 4972d56..dbaed5f 100644 Binary files a/images/StayAwakePaused.png and b/images/StayAwakePaused.png differ diff --git a/images/StayAwakePausedLaunch.png b/images/StayAwakePausedLaunch.png index 5e2eec6..2568358 100644 Binary files a/images/StayAwakePausedLaunch.png and b/images/StayAwakePausedLaunch.png differ