Make the sleep button to do something else?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
vsub
Posts: 550
Joined: 29 Sep 2015, 03:39

Make the sleep button to do something else?

Post by vsub » 15 Sep 2016, 10:11

Is it possible if AHK can't detect the key.

User avatar
Almost_there
Posts: 404
Joined: 30 Sep 2014, 10:32

Re: Make the sleep button to do something else?

Post by Almost_there » 15 Sep 2016, 10:57

None of my computers is equiped with a "sleep" button - quite confident that ahk can't detect that button. What language/keyboard language do you have?

User avatar
Capn Odin
Posts: 1352
Joined: 23 Feb 2016, 19:45
Location: Denmark
Contact:

Re: Make the sleep button to do something else?

Post by Capn Odin » 15 Sep 2016, 10:58

In the List of Keys the key Sleep is defined try that.
Please excuse my spelling I am dyslexic.

vsub
Posts: 550
Joined: 29 Sep 2015, 03:39

Re: Make the sleep button to do something else?

Post by vsub » 15 Sep 2016, 11:23

As I said,AHK don't detect the key at all...VK/SC/Name,nothing.

User avatar
Capn Odin
Posts: 1352
Joined: 23 Feb 2016, 19:45
Location: Denmark
Contact:

Re: Make the sleep button to do something else?

Post by Capn Odin » 15 Sep 2016, 11:40

vsub wrote:As I said,AHK don't detect the key at all...VK/SC/Name,nothing.
Sorry thought it was a grammatical error, we get them some times.
Please excuse my spelling I am dyslexic.

vsub
Posts: 550
Joined: 29 Sep 2015, 03:39

Re: Make the sleep button to do something else?

Post by vsub » 15 Sep 2016, 12:13

The keyboard is some weird Fujitsu keyboard that have a sleep button which does that if I set to do it
Control Panel\Hardware and Sound\Power Options\System Settings
but setting it to "Do nothing" and checking with ahk to see what key it's actually pressed,ahk don't react at all only on that key(all else is detected)

On my old(now dead)keyboard I also had that key and power too and I was using the keys scan code to do different things

punchin
Posts: 439
Joined: 17 Jan 2014, 17:54

Re: Make the sleep button to do something else?

Post by punchin » 15 Sep 2016, 15:43

Per the Special Keys documentation, if the Sleep command, SC code, and the other workarounds don't work, you're unfortunately out of luck.

partof
Posts: 110
Joined: 16 Jan 2016, 08:38

Re: Make the sleep button to do something else?

Post by partof » 26 Nov 2020, 11:51

but how do you get the SC code of the sleep button ? (I can't use the "key history" inbuilt tool since it put the PC to sleep...)

Post Reply

Return to “Ask for Help (v1)”