Jump to content

Caps and scroll


Madman
 Share

Recommended Posts

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?

Link to comment
Share on other sites

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}")

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...