Page 1 of 1

script to make a keyboard backlight timer

Posted: 12 Oct 2018, 18:33
by sulphuricsaliva
Hey guys, pretty sure this won't be possible but I have a wireless keyboard (anne pro 2) and use it exclusively with bluetooth and it does have the feature to auto turn the backlighting off after a minute to save battery but I think one minute is way too much time and I could extend the battery life by reducing that time out. I have the win key assigned to turn the backlight on and off and I end up doing it manually at night most of the time.

Is there any chance to create a script to turn off the backlighting by auto pressing the win key after a period of inactivity and turning it back on when I press any key?

Re: script to make a keyboard backlight timer

Posted: 13 Oct 2018, 01:49
by Rohwedder
Hallo,
try:

Code: Select all

#Persistent
#InstallKeybdHook
#InstallMouseHook
OffTime = 10000 ;10 Seconds
BackLightOn := True
SetTimer, BackLightToggle, 500
Return
BackLightToggle:
If (BackLightOn And A_TimeIdlePhysical > OffTime) 
Or (!BackLightOn And A_TimeIdlePhysical < OffTime)
{
	Send, {LWin} ;Toogle BackLight
	BackLightOn := !BackLightOn
}
Return

Re: script to make a keyboard backlight timer

Posted: 13 Oct 2018, 04:39
by sulphuricsaliva
IIt won't work because the winkey has been remaped by the keyboard's software. I tried scanning the key remaped with the backlight fucntion but it doesn't pick up anything :\

Re: script to make a keyboard backlight timer

Posted: 13 Oct 2018, 04:49
by sulphuricsaliva
I tried assigning the backlight toggle to a combination of keys fn1 + fn2 (SC04B and SC050) and tried modifying your script like this:

#Persistent
#InstallKeybdHook
#InstallMouseHook
OffTime = 10000 ;10 Seconds
BackLightOn := True
SetTimer, BackLightToggle, 500
Return
BackLightToggle:
If (BackLightOn And A_TimeIdlePhysical > OffTime)
Or (!BackLightOn And A_TimeIdlePhysical < OffTime)
{
Send, {SC04B}{SC050};Toogle BackLight
BackLightOn := !BackLightOn
}
Return

But still doesn't work.

Re: script to make a keyboard backlight timer

Posted: 13 Oct 2018, 06:51
by Rohwedder
Hallo,
first try to toogle BackLight with a simple Hotkey.
I don't think this is working:

Code: Select all

q::
Send, {SC04B}{SC050};Toogle BackLight
Return
But maybe this?:

Code: Select all

q::
Send, {SC04B Down}{SC050 Down}
Sleep, 100
Send, {SC04B Up}{SC050 Up}
Return

Re: script to make a keyboard backlight timer

Posted: 13 Oct 2018, 09:50
by sulphuricsaliva
Nop, doesn't work :(

Re: script to make a keyboard backlight timer

Posted: 13 Oct 2018, 16:22
by Scr1pter
Can you turn off the backlight by using the keyboard software?
Perhaps ControlClick or ControlSend might help.
(But only if you can turn it off using the software)

Regards

Re: script to make a keyboard backlight timer

Posted: 14 Oct 2018, 05:37
by sulphuricsaliva
I can only access the software using the keyboard via usb cable so...nop :\

Re: script to make a keyboard backlight timer

Posted: 14 Oct 2018, 16:07
by Scr1pter
Could it be that some information is stored directly in the keyboard?
You connect the keyboard via USB, change some settings in the software and it gets stored in the keyboard's chip.

How is it if you use your keyboard on other devices?
E.g. Smart TV.

Regards

Re: script to make a keyboard backlight timer

Posted: 14 Oct 2018, 16:59
by sulphuricsaliva
Yes the information is stored directly in the keyboard. I never used it on anything other than the pc.

Re: script to make a keyboard backlight timer

Posted: 14 Oct 2018, 19:10
by Scr1pter
But I don't unterstand why the software doesn't give you the option to change the limit.
I mean you can assign a key to turn off the light, yet you can't change the time limit.

Have you checked if there is a newer software version?

Looks like it is this keyboard:
https://flashquark.com/product/pre-orde ... -switches/
I took a quick look at its manual.
Couldn't find a timer setting.

Regards

Re: script to make a keyboard backlight timer

Posted: 15 Oct 2018, 03:40
by sulphuricsaliva
Yeah It's pretty much the only flaw in this keyboard so far, for me. There's no timer funcion, I've sent them an email with the suggestion but they'll probably just ignore it.