Capslock,ScrollLock,NumLock in a button?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
zutrix
Posts: 5
Joined: Fri Oct 23, 2015 11:31 pm

Capslock,ScrollLock,NumLock in a button?

Post by zutrix » Sat Oct 24, 2015 12:20 am

Hi

How can i turn on or off Capslock or ScrollLock or Numlock from a button in livecode?

if i press a button in mine card i wont it to turn on capslock or scrolllock or numlock.and an other button for turning it off.

Is this possible.

Thanks

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: Capslock,ScrollLock,NumLock in a button?

Post by dunbarx » Sat Oct 24, 2015 2:55 pm

Hmmm.

I don't think you can "set" the state of those keys. You can, of course, use a native function to detect that state:

Code: Select all

answer the capsLockKey
Is it that you want to force user input into all caps, say when typing into a field? That is better done with a "keyDown" or "rawKeyDown" handler, located in the right place.

Write back with your thoughts....

Craig Newman

zutrix
Posts: 5
Joined: Fri Oct 23, 2015 11:31 pm

Re: Capslock,ScrollLock,NumLock in a button?

Post by zutrix » Sun Oct 25, 2015 6:04 am

Ok

I will try other way for what i need it. its how you say i have to change the state off the capslock from button in mine card.one button that says Capslock on and Capslock Off (or it can be numlock or scrollock to) reason is for using keyboard light from one those 3 key.
still of there's a solution for it i will be happy to here from some one.

Thanks

zutrix
Posts: 5
Joined: Fri Oct 23, 2015 11:31 pm

Re: Capslock,ScrollLock,NumLock in a button?

Post by zutrix » Sun Oct 25, 2015 6:36 am

I got this searching in google.just saving it in notepad with .vbs extencion every time open it it change the state

Code: Select all

set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys "{NUMLOCK}"
Is it possible to imple,emt it in livecode or an way i can put it to work?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10331
Joined: Wed May 06, 2009 2:28 pm

Re: Capslock,ScrollLock,NumLock in a button?

Post by dunbarx » Sun Oct 25, 2015 4:06 pm

Hi.

So what if you had a checkBox button that was labelled "All Caps"? And if the hilite of that button was "true", then the text that the user entered into one or more fields was automatically made all caps.

The checkBox need not be visible, or even be a button. It just has to be a property that can be interrogated as required.

Is that what you are needing? If so, write back, or better, give it a try yourself. The whole solution is only a handful of lines in a handler.

Craig

Post Reply