[comp.sys.ti.explorer] Keyboard Lock Keys

mhd@gensym.UUCP (Mark H David) (05/03/91)

Is there any way in lisp on the Explorer to tell if 
if the MODE LOCK key is down (has its light on) or not?

Thanks.
Mark H. David (mhd@gensym.com)

jwz@lucid.com (Jamie Zawinski) (05/03/91)

In article <9105022032.AA07060@gensym.com> mhd@gensym.UUCP (Mark H David) wrote:
> 
> Is there any way in lisp on the Explorer to tell if 
> if the MODE LOCK key is down (has its light on) or not?

Yeah, real simple: see which bits are set in SYS:LOCK-BITS.  To toggle the
state of the lights on those keys, use TV:WRITE-KEYBOARD with certain magic
symbols, like 'TV:BOLD-KEY-LED-ON and 'TV:BOLD-KEY-LED-OFF.

But remember that the mode-lock key already has a meaning: when it's on, the
cursor keys move the mouse pointer in 1-pixel increments.

Check out the code in spice.cs.cmu.edu:/usr/jwz/public/bold-lock.lisp for
examples of how to do this stuff.  This file defines a Zmacs minor-mode that
sets the current font to a bold version of the current font (and interacts
properly with electric-font-lock-mode.)  Terribly convenient.

You may be tempted to make the lights on those four keys cycle in some kind of
nifty pattern.  There are two problems with this: when the caps light is on,
it is as if the caps key is down, which is certainly not something you want
happening spontaneously; and calling TV:WRITE-KEYBOARD too frequently will
cause the keyboard to start reporting parity errors with the frightenly large
"system monitor" popup window.  (At least in older versions of the os.)

	-- Jamie

Bjorn.Victor@docs.uu.se (Bjorn Victor) (05/03/91)

You check the SYS::LOCK-BITS variable.

See mizar.docs.uu.se:~ftp/lispm/debug.lisp for example code.

-- Bjorn Victor			Bjorn.Victor@DoCS.UU.SE
Dept. of Computer Systems	tel: +46 18183169; fax: +46 18550225
Uppsala University, Sweden	"I'd rather hack a Lisp Machine!"