Repository navigation
Replies: 2 comments 3 replies
|
I checked the source: on Windows the Sleep action isn't implemented yet, it's skipped on purpose (there's a comment about it in Workaround until it's added: use the "Run Command" action instead, it works on Windows. Something like: If your PC hibernates instead of sleeping with that, turning hibernation off fixes it ( |
|
quick addendum courtesy of AI.. (i would not recommend anyone cut and paste an encodes string without checking it themselves but this works for me) I've now managed to get the Lock key on my Logitech MX keyboard to put Windows 10 to sleep, using OpenLogi's Run Command action. The original PowerShell suggestion worked perfectly when executed directly in PowerShell, but did nothing when assigned to a key in OpenLogi. I tested several alternatives: notepad.exe — worked. powershell.exe -NoProfile -Command Start-Process notepad.exe — worked. The original sleep command, including a version replacing $false with 0 — neither worked through OpenLogi. PowerShell's -EncodedCommand — worked! This suggests a command-line parsing or quoting issue when OpenLogi launches more complex PowerShell expressions. Working solution: In OpenLogi, assign your chosen key to Run Command and paste this entire line into the command field: powershell.exe -NoProfile -EncodedCommand QQBkAGQALQBUAHkAcABlACAALQBBAHMAcwBlAG0AYgBsAHkATgBhAG0AZQAgAFMAeQBzAHQAZQBtAC4AVwBpAG4AZABvAHcAcwAuAEYAbwByAG0AcwA7ACAAWwBTAHkAcwB0AGUAbQAuAFcAaQBuAGQAbwB3AHMALgBGAG8AcgBtAHMALgBBAHAAcABsAGkAYwBhAHQAaQBvAG4AXQA6ADoAUwBlAHQAUwB1AHMAcABlAG4AZABTAHQAYQB0AGUAKAAnAFMAdQBzAHAAZQBuAGQAJwAsACAAJABmAGEAbABzAGUALAAgACQAZgBhAGwAcwBlACkA For clarity, this is simply a UTF-16LE Base64 encoding of the following PowerShell instruction: Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.Application]::SetSuspendState('Suspend', $false, $false) The command requests normal Windows sleep. It doesn't require administrator privileges, additional software or disabling hibernation. Tested successfully on Windows 10 with my Logitech MX keyboard. The PC sleeps and wakes normally. Hopefully this helps other Windows users until OpenLogi implements the native Sleep action. It might also be worth investigating whether the Run Command implementation could handle PowerShell quoting more reliably. |
Uh oh!
There was an error while loading. Please reload this page.
Pre-flight checklist
Question
I am trying to map the top right key on my mx keys keyboard (the one with the lock icon) to sleep rather than screen lock.
I can map it to other things like screenshot so that key is getting picked up correctly
However, if I choose sleep from the configuration menu it still only locks the computer but will not sleep.
Is there a solution?
Operating system
Windows
OpenLogi version
0.8.20
Device and connection
MX Keyboard over unifying receiver
Diagnostics report
All reactions