Jump to content
Sign in to follow this  
Madman

Caps and scroll

Recommended Posts

Madman

I was bored decied to play with the ligts on the keyboard ;p

Here a part of the code...

Send("{NUMLOCK off}")
            Send("{CAPSLOCK off}")
            Send("{SCROLLLOCK off}")
            If $OneNum And BitAND(GUICtrlRead($OneNum), $GUI_CHECKED) = $GUI_CHECKED Then
                If $TwoCaps And BitAND(GUICtrlRead($TwoCaps), $GUI_CHECKED) = $GUI_CHECKED Then
                        Sleep($SleepTime)
                    Send("{NUMLOCK on}")
                        Sleep($SleepTime)
                    Send("{CAPSLOCK on}")
                        Sleep($SleepTime)
                    Send("{SCROLLLOCK on}")
                        Sleep($SleepTime)
                    Send("{NUMLOCK off}")
                        Sleep($SleepTime)
                    Send("{CAPSLOCK off}")
                        Sleep($SleepTime)
                    Send("{SCROLLLOCK off}")

It supposed to set all locks off, then num on,caps on,scroll on, each with a second appart ($SleepTime = 1second ), and then num off, caps off, scroll off.

But what it does... locks off,num on,caps on, (here's the prob) scroll on and caps off,num off, "caps off", scroll off.

Why does caps go off when scroll turn on?

Is it an Xp, AutoIt or Swe Keyboard prob?

Share this post


Link to post
Share on other sites
1905russell

I was bored decied to play with the ligts on the keyboard ;p

Here a part of the code...

Send("{NUMLOCK off}")
            Send("{CAPSLOCK off}")
            Send("{SCROLLLOCK off}")
            If $OneNum And BitAND(GUICtrlRead($OneNum), $GUI_CHECKED) = $GUI_CHECKED Then
                If $TwoCaps And BitAND(GUICtrlRead($TwoCaps), $GUI_CHECKED) = $GUI_CHECKED Then
                        Sleep($SleepTime)
                    Send("{NUMLOCK on}")
                        Sleep($SleepTime)
                    Send("{CAPSLOCK on}")
                        Sleep($SleepTime)
                    Send("{SCROLLLOCK on}")
                        Sleep($SleepTime)
                    Send("{NUMLOCK off}")
                        Sleep($SleepTime)
                    Send("{CAPSLOCK off}")
                        Sleep($SleepTime)
                    Send("{SCROLLLOCK off}")

It supposed to set all locks off, then num on,caps on,scroll on, each with a second appart ($SleepTime = 1second ), and then num off, caps off, scroll off.

But what it does... locks off,num on,caps on, (here's the prob) scroll on and caps off,num off, "caps off", scroll off.

Why does caps go off when scroll turn on?

Is it an Xp, AutoIt or Swe Keyboard prob?

Not sure if this will help but I had a similar problem that I resolved with

Send("+{CAPSLOCK}")

Share this post


Link to post
Share on other sites
Madman

Not sure if this will help but I had a similar problem that I resolved with

Send("+{CAPSLOCK}")

Nope didn't help

I also tried to add a Caps on after the scroll on...

Sleep($SleepTime)
                    Send("{CAPSLOCK on}")
                        Sleep($SleepTime)
                    Send("{SCROLLLOCK on}")
                    Send("{CAPSLOCK on}")
                        Sleep($SleepTime)
                    Send("{NUMLOCK off}")

That hepled, but, in next step, when num off, then caps off as well...

The only soultion i see, is to send num,caps,scroll state for each on/off, but that would make the code about 3x times longer,

so i rather avoid that...

Share this post


Link to post
Share on other sites
AzKay

Maybe {CAPSLOCK DOWN}?

@Aceloc, Didnt you quit?


# MY LOVE FOR YOU... IS LIKE A TRUCK- #

Share this post


Link to post
Share on other sites
Madman

Maybe {CAPSLOCK DOWN}?

@Aceloc, Didnt you quit?

That hepled, but, when num off, then caps off as well...

Share this post


Link to post
Share on other sites
Madman

Well...Made a work around, that don't require 3x code =)

Func LED($num,$caps,$scroll)
; Scroll is fist beacuse it's cause probs
    If $scroll == "0" Then
        Send("{SCROLLLOCK off}")
    ElseIf $scroll == "1" Then
        Send("{SCROLLLOCK on}")
    EndIf
    If $num == "0" Then
        Send("{NUMLOCK off}")
    ElseIf $num == "1" Then
        Send("{NUMLOCK on}")
    EndIf
    If $caps == "0" Then
        Send("{CAPSLOCK off}")
    ElseIf $caps == "1" Then
        Send("{CAPSLOCK on}")
    EndIf
EndFunc

Share this post


Link to post
Share on other sites
1905russell

I'll not repost with 8 cases in a Select. Your 3 ifs do the job you wanted.

You need Opt("SendCapslockMode",0) to work this - right?

Edited by 1905russell

Share this post


Link to post
Share on other sites
Madman

I'll not repost with 8 cases in a Select. Your 3 ifs do the job you wanted.

You need Opt("SendCapslockMode",0) to work this - right?

Nope, it works just fine without any Opt..

Edited by Madman

Share this post


Link to post
Share on other sites
1905russell

Nope, it works just fine without any Opt..

Okay got it - default it is.

Thanks

Edited by 1905russell

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×