Q: Determing num/caps lock status 
Author Message
 Q: Determing num/caps lock status

Quote:

>How can my script determine whether num lock and
>lock are on when the application starts?

>Is there an easy way to insure that either or both
>are turned on or off by my code?

>TIA

>Steve

Ohh..  I got the code for you.  See attachment.

the first few lines:
  #include "falcon.h"
  #include "util.h"

  extern dyn_AppendResult Tcl_AppendResult;

can get replaced by:

  #define USE_TCL_STUBS
  #include <tcl.h>

  #undef TCL_STORAGE_CLASS
  #define TCL_STORAGE_CLASS DLLEXPORT

  EXTERN int
  Keylock_Init (Tcl_Interp *interp)
  {
    if (Tcl_InitStubs(interp, "8.1", 0) == NULL) {
      return TCL_ERROR;
    }
    Tcl_CreateCommand(interp, "keylock", CmdLock, NULL, NULL);
    return TCL_OK;
  };

And build it to keylock.dll
--
* David Gravereaux *
Tomahawk Software Group

If knowledge is power, how come the more I learn, the more I realize how much I don't know?
That isn't very empowering.

  Lock.cpp
2K Download


Wed, 23 Oct 2002 03:00:00 GMT  
 Q: Determing num/caps lock status
How can my script determine whether num lock and
lock are on when the application starts?

Is there an easy way to insure that either or both
are turned on or off by my code?

TIA

Steve
--
Steve Offutt
*Learning* to program is my hobby

Sent via Deja.com http://www.deja.com/
Before you buy.



Thu, 24 Oct 2002 03:00:00 GMT  
 Q: Determing num/caps lock status


Quote:


> >How can my script determine whether num lock and
> >lock are on when the application starts?

> >Is there an easy way to insure that either or both
> >are turned on or off by my code?

> Ohh..  I got the code for you.  See attachment.

[snip]

David,

Thanks for the reply.  I will *try* to compile this on my
win95 & win 98 boxes.   I really would like to have a
cross-platform win/linux tcl script to do this and not have
to rely on compiling an extension.  Is this possible?

Steve
--
Steve Offutt
*Learning* to program is my hobby

Sent via Deja.com http://www.deja.com/
Before you buy.



Thu, 24 Oct 2002 03:00:00 GMT  
 Q: Determing num/caps lock status

Quote:

>David,

>Thanks for the reply.  I will *try* to compile this on my
>win95 & win 98 boxes.   I really would like to have a
>cross-platform win/linux tcl script to do this and not have
>to rely on compiling an extension.  Is this possible?

>Steve

I doubt it.  Your asking the keyboard for a get/set of a hardware state.  The
code is very minimal on Win32, and I can only guess it would be just as small on
linux.

You're bringing up the common arguments.  Many people (like myself) say Tcl is
too big already and needs to be more modular.  Some say it doesn't do everything
and is missing features.

My whole attitude is everything is there already because of the excellent C
interface for extending the core by adding commands that call into your C.
--
* David Gravereaux *
Tomahawk Software Group

If knowledge is power, how come the more I learn, the more I realize how much I don't know?
That isn't very empowering.



Thu, 24 Oct 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. how to display Num and Caps Lock state on status bar

2. num lock, caps lock, scroll lock lights

3. Num Lock and Caps Lock

4. a traffic light program with lock's (num loack Caps loack and scroll lock)

5. Num, Caps and Scroll Lock state?

6. {caps,num}lock - once more for the record

7. how to on/off num lock, caps lock, scroll lock ???

8. Scroll, Caps and Num blink

9. KBD CAPS/NUM LED Indicators

10. DOS utility that controls Caps Lock & Num Lock keys

11. Num Lock with PB3.20

12. Num lock on at all times

 

 
Powered by phpBB® Forum Software